makefile.icc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. # MAKEFILE for linux ICC (Intel C compiler)
  2. #
  3. # Tested with ICC v8....
  4. #
  5. # Be aware that ICC isn't quite as stable as GCC and several optimization switches
  6. # seem to break the code (that GCC and MSVC compile just fine). In particular
  7. # "-ip" and "-x*" seem to break the code (ROL/ROR macro problems). As the makefile
  8. # is shipped the code will build and execute properly.
  9. #
  10. # Also note that ICC often makes code that is slower than GCC. This is probably due to
  11. # a mix of not being able to use "-ip" and just having fewer optimization algos than GCC.
  12. #
  13. # Tom St Denis
  14. #ch1-01-1
  15. # Compiler and Linker Names
  16. CC=icc
  17. #LD=ld
  18. # Archiver [makes .a files]
  19. #AR=ar
  20. #ARFLAGS=r
  21. # Compilation flags. Note the += does not write over the user's CFLAGS!
  22. CFLAGS += -c -I./ -DINTEL_CC
  23. #The default rule for make builds the libtomcrypt library.
  24. default:library
  25. # optimize for SPEED
  26. #
  27. # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
  28. # -ax? specifies make code specifically for ? but compatible with IA-32
  29. # -x? specifies compile solely for ? [not specifically IA-32 compatible]
  30. #
  31. # where ? is
  32. # K - PIII
  33. # W - first P4 [Williamette]
  34. # N - P4 Northwood
  35. # P - P4 Prescott
  36. # B - Blend of P4 and PM [mobile]
  37. #
  38. # Default to just generic max opts
  39. CFLAGS += -O3 -xN -ip
  40. # want to see stuff?
  41. #CFLAGS += -opt_report
  42. #These flags control how the library gets built.
  43. #Output filenames for various targets.
  44. LIBNAME=libtomcrypt.a
  45. HASH=hashsum
  46. CRYPT=encrypt
  47. SMALL=small
  48. PROF=x86_prof
  49. TV=tv_gen
  50. #LIBPATH-The directory for libtomcrypt to be installed to.
  51. #INCPATH-The directory to install the header files for libtomcrypt.
  52. #DATAPATH-The directory to install the pdf docs.
  53. DESTDIR=
  54. LIBPATH=/usr/lib
  55. INCPATH=/usr/include
  56. DATAPATH=/usr/share/doc/libtomcrypt/pdf
  57. #List of objects to compile.
  58. #Leave MPI built-in or force developer to link against libtommath?
  59. MPIOBJECT=mpi.o
  60. OBJECTS=error_to_string.o mpi_to_ltc_error.o base64_encode.o base64_decode.o \
  61. \
  62. crypt.o crypt_find_cipher.o crypt_find_hash_any.o \
  63. crypt_hash_is_valid.o crypt_register_hash.o crypt_unregister_prng.o \
  64. crypt_argchk.o crypt_find_cipher_any.o crypt_find_hash_id.o \
  65. crypt_prng_descriptor.o crypt_register_prng.o crypt_cipher_descriptor.o \
  66. crypt_find_cipher_id.o crypt_find_prng.o crypt_prng_is_valid.o \
  67. crypt_unregister_cipher.o crypt_cipher_is_valid.o crypt_find_hash.o \
  68. crypt_hash_descriptor.o crypt_register_cipher.o crypt_unregister_hash.o \
  69. \
  70. sprng.o yarrow.o rc4.o rng_get_bytes.o rng_make_prng.o \
  71. \
  72. rand_prime.o is_prime.o \
  73. \
  74. ecc.o dh.o \
  75. \
  76. rsa_decrypt_key.o rsa_encrypt_key.o rsa_exptmod.o rsa_free.o rsa_make_key.o \
  77. rsa_sign_hash.o rsa_verify_hash.o rsa_export.o rsa_import.o tim_exptmod.o \
  78. \
  79. dsa_export.o dsa_free.o dsa_import.o dsa_make_key.o dsa_sign_hash.o \
  80. dsa_verify_hash.o dsa_verify_key.o \
  81. \
  82. aes.o aes_enc.o \
  83. \
  84. blowfish.o des.o safer_tab.o safer.o saferp.o rc2.o xtea.o \
  85. rc6.o rc5.o cast5.o noekeon.o twofish.o skipjack.o \
  86. \
  87. md2.o md4.o md5.o sha1.o sha256.o sha512.o tiger.o whirl.o \
  88. rmd128.o rmd160.o \
  89. \
  90. packet_store_header.o packet_valid_header.o \
  91. \
  92. eax_addheader.o eax_decrypt.o eax_decrypt_verify_memory.o eax_done.o eax_encrypt.o \
  93. eax_encrypt_authenticate_memory.o eax_init.o eax_test.o \
  94. \
  95. ocb_decrypt.o ocb_decrypt_verify_memory.o ocb_done_decrypt.o ocb_done_encrypt.o \
  96. ocb_encrypt.o ocb_encrypt_authenticate_memory.o ocb_init.o ocb_ntz.o \
  97. ocb_shift_xor.o ocb_test.o s_ocb_done.o \
  98. \
  99. omac_done.o omac_file.o omac_init.o omac_memory.o omac_process.o omac_test.o \
  100. \
  101. pmac_done.o pmac_file.o pmac_init.o pmac_memory.o pmac_ntz.o pmac_process.o \
  102. pmac_shift_xor.o pmac_test.o \
  103. \
  104. cbc_start.o cbc_encrypt.o cbc_decrypt.o cbc_getiv.o cbc_setiv.o \
  105. cfb_start.o cfb_encrypt.o cfb_decrypt.o cfb_getiv.o cfb_setiv.o \
  106. ofb_start.o ofb_encrypt.o ofb_decrypt.o ofb_getiv.o ofb_setiv.o \
  107. ctr_start.o ctr_encrypt.o ctr_decrypt.o ctr_getiv.o ctr_setiv.o \
  108. ecb_start.o ecb_encrypt.o ecb_decrypt.o \
  109. \
  110. hash_file.o hash_filehandle.o hash_memory.o \
  111. \
  112. hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \
  113. \
  114. pkcs_1_mgf1.o pkcs_1_oaep_encode.o pkcs_1_oaep_decode.o \
  115. pkcs_1_pss_encode.o pkcs_1_pss_decode.o pkcs_1_i2osp.o pkcs_1_os2ip.o \
  116. pkcs_1_v15_es_encode.o pkcs_1_v15_es_decode.o pkcs_1_v15_sa_encode.o pkcs_1_v15_sa_decode.o \
  117. \
  118. pkcs_5_1.o pkcs_5_2.o \
  119. \
  120. burn_stack.o zeromem.o \
  121. $(MPIOBJECT)
  122. #ciphers come in two flavours... enc+dec and enc
  123. aes_enc.o: aes.c aes_tab.c
  124. $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o
  125. HASHOBJECTS=demos/hashsum.o
  126. CRYPTOBJECTS=demos/encrypt.o
  127. SMALLOBJECTS=demos/small.o
  128. PROFS=demos/x86_prof.o
  129. TVS=demos/tv_gen.o
  130. #Files left over from making the crypt.pdf.
  131. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind
  132. #Compressed filenames
  133. COMPRESSED=crypt.tar.bz2 crypt.zip crypt.tar.gz
  134. #Header files used by libtomcrypt.
  135. HEADERS=ltc_tommath.h mycrypt_cfg.h \
  136. mycrypt_misc.h mycrypt_prng.h mycrypt_cipher.h mycrypt_hash.h \
  137. mycrypt_macros.h mycrypt_pk.h mycrypt.h mycrypt_argchk.h mycrypt_custom.h
  138. #These are the rules to make certain object files.
  139. rsa.o: rsa.c rsa_sys.c
  140. ecc.o: ecc.c ecc_sys.c
  141. dh.o: dh.c dh_sys.c
  142. aes.o: aes.c aes_tab.c
  143. twofish.o: twofish.c twofish_tab.c
  144. sha512.o: sha512.c sha384.c
  145. sha256.o: sha256.c sha224.c
  146. #This rule makes the libtomcrypt library.
  147. library: $(LIBNAME)
  148. $(LIBNAME): $(OBJECTS)
  149. $(AR) $(ARFLAGS) $@ $(OBJECTS)
  150. #This rule makes the hash program included with libtomcrypt
  151. hashsum: library $(HASHOBJECTS)
  152. $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN)
  153. #makes the crypt program
  154. crypt: library $(CRYPTOBJECTS)
  155. $(CC) $(CRYPTOBJECTS) $(LIBNAME) -o $(CRYPT) $(WARN)
  156. #makes the small program
  157. small: library $(SMALLOBJECTS)
  158. $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN)
  159. x86_prof: library $(PROFS)
  160. $(CC) $(PROFS) $(LIBNAME) -o $(PROF)
  161. tv_gen: library $(TVS)
  162. $(CC) $(TVS) $(LIBNAME) -o $(TV)
  163. #This rule installs the library and the header files. This must be run
  164. #as root in order to have a high enough permission to write to the correct
  165. #directories and to set the owner and group to root.
  166. install: library
  167. install -d -g root -o root $(DESTDIR)$(LIBPATH)
  168. install -d -g root -o root $(DESTDIR)$(INCPATH)
  169. install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
  170. install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
  171. #This rule cleans the source tree of all compiled code, not including the pdf
  172. #documentation.
  173. clean:
  174. rm -f $(OBJECTS) $(TESTOBJECTS) $(HASHOBJECTS) $(CRYPTOBJECTS) $(SMALLOBJECTS) $(LEFTOVERS) $(LIBNAME)
  175. rm -f $(TEST) $(HASH) $(COMPRESSED) $(PROFS) $(PROF) $(TVS) $(TV)
  176. rm -f *.a *.dll *stackdump *.lib *.exe *.obj demos/*.obj demos/*.o *.bat *.txt *.il *.da demos/*.il demos/*.da *.dyn