makefile.icc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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 -Isrc/headers/ -Itestprof/ -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. ifdef LTC_SMALL
  40. CFLAGS += -O2 -xP -ip
  41. endif
  42. ifndef IGNORE_SPEED
  43. CFLAGS += -O3 -xP -ip
  44. endif
  45. # want to see stuff?
  46. #CFLAGS += -opt_report
  47. #These flags control how the library gets built.
  48. #Output filenames for various targets.
  49. LIBNAME=libtomcrypt.a
  50. LIBTEST=testprof/libtomcrypt_prof.a
  51. HASH=hashsum
  52. CRYPT=encrypt
  53. SMALL=small
  54. PROF=x86_prof
  55. TV=tv_gen
  56. MULTI=multi
  57. TIMING=timing
  58. TEST=test
  59. #LIBPATH-The directory for libtomcrypt to be installed to.
  60. #INCPATH-The directory to install the header files for libtomcrypt.
  61. #DATAPATH-The directory to install the pdf docs.
  62. DESTDIR=
  63. LIBPATH=/usr/lib
  64. INCPATH=/usr/include
  65. DATAPATH=/usr/share/doc/libtomcrypt/pdf
  66. #List of objects to compile.
  67. #Leave MPI built-in or force developer to link against libtommath?
  68. MPIOBJECT=src/misc/mpi/mpi.o
  69. OBJECTS=src/ciphers/aes/aes_enc.o $(MPIOBJECT) src/ciphers/aes/aes.o src/ciphers/anubis.o \
  70. src/ciphers/blowfish.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/khazad.o src/ciphers/noekeon.o \
  71. src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o src/ciphers/safer/safer.o \
  72. src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
  73. src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \
  74. src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \
  75. src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \
  76. src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \
  77. src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \
  78. src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \
  79. src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o \
  80. src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
  81. src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
  82. src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
  83. src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
  84. src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \
  85. src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \
  86. src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/sha1.o src/hashes/sha2/sha256.o \
  87. src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/hmac/hmac_done.o \
  88. src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \
  89. src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \
  90. src/mac/omac/omac_done.o src/mac/omac/omac_file.o src/mac/omac/omac_init.o src/mac/omac/omac_memory.o \
  91. src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \
  92. src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \
  93. src/mac/pmac/pmac_done.o src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
  94. src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
  95. src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/misc/base64/base64_decode.o \
  96. src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \
  97. src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \
  98. src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \
  99. src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
  100. src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
  101. src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_prng.o \
  102. src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \
  103. src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \
  104. src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \
  105. src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \
  106. src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \
  107. src/misc/error_to_string.o src/misc/mpi/is_prime.o src/misc/mpi/mpi_to_ltc_error.o \
  108. src/misc/mpi/rand_prime.o src/misc/pkcs5/pkcs_5_1.o src/misc/pkcs5/pkcs_5_2.o src/misc/zeromem.o \
  109. src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \
  110. src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \
  111. src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \
  112. src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \
  113. src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \
  114. src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o \
  115. src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
  116. src/modes/ecb/ecb_start.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
  117. src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
  118. src/modes/ofb/ofb_start.o src/pk/asn1/der/bit/der_decode_bit_string.o \
  119. src/pk/asn1/der/bit/der_encode_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
  120. src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
  121. src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
  122. src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
  123. src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
  124. src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
  125. src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
  126. src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
  127. src/pk/asn1/der/octet/der_length_octet_string.o \
  128. src/pk/asn1/der/printable_string/der_decode_printable_string.o \
  129. src/pk/asn1/der/printable_string/der_encode_printable_string.o \
  130. src/pk/asn1/der/printable_string/der_length_printable_string.o \
  131. src/pk/asn1/der/sequence/der_decode_sequence.o src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
  132. src/pk/asn1/der/sequence/der_encode_sequence.o src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
  133. src/pk/asn1/der/sequence/der_length_sequence.o \
  134. src/pk/asn1/der/short_integer/der_decode_short_integer.o \
  135. src/pk/asn1/der/short_integer/der_encode_short_integer.o \
  136. src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/dh/dh.o src/pk/dsa/dsa_export.o \
  137. src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_sign_hash.o \
  138. src/pk/dsa/dsa_verify_hash.o src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/packet_store_header.o \
  139. src/pk/packet_valid_header.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
  140. src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
  141. src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/rsa/rsa_decrypt_key.o \
  142. src/pk/rsa/rsa_encrypt_key.o src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o \
  143. src/pk/rsa/rsa_import.o src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o \
  144. src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \
  145. src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o
  146. HEADERS=src/headers/tommath_superclass.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h \
  147. src/headers/tomcrypt_macros.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h \
  148. src/headers/tomcrypt_cipher.h src/headers/tomcrypt_pk.h src/headers/tommath_class.h \
  149. src/headers/ltc_tommath.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_misc.h \
  150. src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
  151. #ciphers come in two flavours... enc+dec and enc
  152. aes_enc.o: aes.c aes_tab.c
  153. $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o
  154. HASHOBJECTS=demos/hashsum.o
  155. CRYPTOBJECTS=demos/encrypt.o
  156. SMALLOBJECTS=demos/small.o
  157. TVS=demos/tv_gen.o
  158. TIMINGS=demos/timing.o
  159. TESTS=demos/test.o
  160. #Files left over from making the crypt.pdf.
  161. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind
  162. #Compressed filenames
  163. COMPRESSED=crypt.tar.bz2 crypt.zip crypt.tar.gz
  164. #ciphers come in two flavours... enc+dec and enc
  165. src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
  166. $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
  167. #These are the rules to make certain object files.
  168. src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
  169. src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
  170. src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
  171. src/pk/ecc/ecc.o: src/pk/ecc/ecc.c src/pk/ecc/ecc_sys.c
  172. src/pk/dh/dh.o: src/pk/dh/dh.c src/pk/dh/dh_sys.c
  173. src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
  174. src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
  175. #This rule makes the libtomcrypt library.
  176. library: $(LIBTEST) $(LIBNAME)
  177. $(LIBTEST):
  178. cd testprof ; make -f makefile.icc
  179. $(LIBNAME): $(OBJECTS)
  180. $(AR) $(ARFLAGS) $@ $(OBJECTS)
  181. ranlib $(LIBNAME)
  182. #This rule makes the hash program included with libtomcrypt
  183. hashsum: library $(HASHOBJECTS)
  184. $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN)
  185. #makes the crypt program
  186. crypt: library $(CRYPTOBJECTS)
  187. $(CC) $(CRYPTOBJECTS) $(LIBNAME) -o $(CRYPT) $(WARN)
  188. #makes the small program
  189. small: library $(SMALLOBJECTS)
  190. $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN)
  191. tv_gen: library $(TVS)
  192. $(CC) $(TVS) $(LIBNAME) -o $(TV)
  193. timing: library $(TIMINGS)
  194. $(CC) $(TIMINGS) $(LIBTEST) $(LIBNAME) -o $(TIMING)
  195. test: library $(TESTS)
  196. $(CC) $(TESTS) $(LIBTEST) $(LIBNAME) -o $(TEST)
  197. #This rule installs the library and the header files. This must be run
  198. #as root in order to have a high enough permission to write to the correct
  199. #directories and to set the owner and group to root.
  200. install: library
  201. install -d -g root -o root $(DESTDIR)$(LIBPATH)
  202. install -d -g root -o root $(DESTDIR)$(INCPATH)
  203. install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
  204. install -g root -o root $(LIBTEST) $(DESTDIR)$(LIBPATH)
  205. install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
  206. # $Source: /cvs/libtom/libtomcrypt/makefile.icc,v $
  207. # $Revision: 1.32 $
  208. # $Date: 2005/05/23 03:12:44 $