makefile.shared 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. # MAKEFILE for linux GCC
  2. #
  3. # Tom St Denis
  4. # Modified by Clay Culver
  5. # The version
  6. VERSION=0:99
  7. # Compiler and Linker Names
  8. CC=libtool --mode=compile gcc
  9. # Archiver [makes .a files]
  10. AR=libtool --mode=link
  11. # Compilation flags. Note the += does not write over the user's CFLAGS!
  12. CFLAGS += -c -I./ -Wall -Wsign-compare -W -Wshadow
  13. # -Werror
  14. # optimize for SPEED
  15. CFLAGS += -O3 -funroll-all-loops
  16. #add -fomit-frame-pointer. hinders debugging!
  17. CFLAGS += -fomit-frame-pointer
  18. # optimize for SIZE
  19. #CFLAGS += -Os
  20. # compile for DEBUGING (required for ccmalloc checking!!!)
  21. #CFLAGS += -g3
  22. #These flags control how the library gets built.
  23. #Output filenames for various targets.
  24. LIBNAME=libtomcrypt.la
  25. HASH=hashsum
  26. CRYPT=encrypt
  27. SMALL=small
  28. PROF=x86_prof
  29. TV=tv_gen
  30. #LIBPATH-The directory for libtomcrypt to be installed to.
  31. #INCPATH-The directory to install the header files for libtomcrypt.
  32. #DATAPATH-The directory to install the pdf docs.
  33. DESTDIR=
  34. LIBPATH=/usr/lib
  35. INCPATH=/usr/include
  36. DATAPATH=/usr/share/doc/libtomcrypt/pdf
  37. #List of objects to compile.
  38. #Leave MPI built-in or force developer to link against libtommath?
  39. MPIOBJECT=mpi.o
  40. #If you don't want mpi.o then add this
  41. #MPISHARED=$(LIBPATH)/libtommath.la
  42. OBJECTS=error_to_string.o mpi_to_ltc_error.o base64_encode.o base64_decode.o \
  43. \
  44. crypt.o crypt_find_cipher.o crypt_find_hash_any.o \
  45. crypt_hash_is_valid.o crypt_register_hash.o crypt_unregister_prng.o \
  46. crypt_argchk.o crypt_find_cipher_any.o crypt_find_hash_id.o \
  47. crypt_prng_descriptor.o crypt_register_prng.o crypt_cipher_descriptor.o \
  48. crypt_find_cipher_id.o crypt_find_prng.o crypt_prng_is_valid.o \
  49. crypt_unregister_cipher.o crypt_cipher_is_valid.o crypt_find_hash.o \
  50. crypt_hash_descriptor.o crypt_register_cipher.o crypt_unregister_hash.o \
  51. \
  52. sober128.o fortuna.o sprng.o yarrow.o rc4.o rng_get_bytes.o rng_make_prng.o \
  53. \
  54. rand_prime.o is_prime.o \
  55. \
  56. ecc.o dh.o \
  57. \
  58. rsa_decrypt_key.o rsa_encrypt_key.o rsa_exptmod.o rsa_free.o rsa_make_key.o \
  59. rsa_sign_hash.o rsa_verify_hash.o rsa_export.o rsa_import.o tim_exptmod.o \
  60. rsa_v15_encrypt_key.o rsa_v15_decrypt_key.o rsa_v15_sign_hash.o rsa_v15_verify_hash.o \
  61. \
  62. dsa_export.o dsa_free.o dsa_import.o dsa_make_key.o dsa_sign_hash.o \
  63. dsa_verify_hash.o dsa_verify_key.o \
  64. \
  65. aes.o aes_enc.o \
  66. \
  67. blowfish.o des.o safer_tab.o safer.o saferp.o rc2.o xtea.o \
  68. rc6.o rc5.o cast5.o noekeon.o twofish.o skipjack.o \
  69. \
  70. md2.o md4.o md5.o sha1.o sha256.o sha512.o tiger.o whirl.o \
  71. rmd128.o rmd160.o chc.o \
  72. \
  73. packet_store_header.o packet_valid_header.o \
  74. \
  75. eax_addheader.o eax_decrypt.o eax_decrypt_verify_memory.o eax_done.o eax_encrypt.o \
  76. eax_encrypt_authenticate_memory.o eax_init.o eax_test.o \
  77. \
  78. ocb_decrypt.o ocb_decrypt_verify_memory.o ocb_done_decrypt.o ocb_done_encrypt.o \
  79. ocb_encrypt.o ocb_encrypt_authenticate_memory.o ocb_init.o ocb_ntz.o \
  80. ocb_shift_xor.o ocb_test.o s_ocb_done.o \
  81. \
  82. omac_done.o omac_file.o omac_init.o omac_memory.o omac_process.o omac_test.o \
  83. \
  84. pmac_done.o pmac_file.o pmac_init.o pmac_memory.o pmac_ntz.o pmac_process.o \
  85. pmac_shift_xor.o pmac_test.o \
  86. \
  87. cbc_start.o cbc_encrypt.o cbc_decrypt.o cbc_getiv.o cbc_setiv.o \
  88. cfb_start.o cfb_encrypt.o cfb_decrypt.o cfb_getiv.o cfb_setiv.o \
  89. ofb_start.o ofb_encrypt.o ofb_decrypt.o ofb_getiv.o ofb_setiv.o \
  90. ctr_start.o ctr_encrypt.o ctr_decrypt.o ctr_getiv.o ctr_setiv.o \
  91. ecb_start.o ecb_encrypt.o ecb_decrypt.o \
  92. \
  93. hash_file.o hash_filehandle.o hash_memory.o \
  94. \
  95. hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \
  96. \
  97. pkcs_1_mgf1.o pkcs_1_oaep_encode.o pkcs_1_oaep_decode.o \
  98. pkcs_1_pss_encode.o pkcs_1_pss_decode.o pkcs_1_i2osp.o pkcs_1_os2ip.o \
  99. pkcs_1_v15_es_encode.o pkcs_1_v15_es_decode.o pkcs_1_v15_sa_encode.o pkcs_1_v15_sa_decode.o \
  100. \
  101. pkcs_5_1.o pkcs_5_2.o \
  102. \
  103. der_encode_integer.o der_decode_integer.o der_length_integer.o \
  104. der_put_multi_integer.o der_get_multi_integer.o \
  105. \
  106. burn_stack.o zeromem.o \
  107. \
  108. $(MPIOBJECT)
  109. TESTOBJECTS=demos/test.o
  110. HASHOBJECTS=demos/hashsum.o
  111. CRYPTOBJECTS=demos/encrypt.o
  112. SMALLOBJECTS=demos/small.o
  113. PROFS=demos/x86_prof.o
  114. TVS=demos/tv_gen.o
  115. #Files left over from making the crypt.pdf.
  116. LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
  117. #Compressed filenames
  118. COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip
  119. #Header files used by libtomcrypt.
  120. HEADERS=ltc_tommath.h mycrypt_cfg.h \
  121. mycrypt_misc.h mycrypt_prng.h mycrypt_cipher.h mycrypt_hash.h \
  122. mycrypt_macros.h mycrypt_pk.h mycrypt.h mycrypt_argchk.h \
  123. mycrypt_custom.h mycrypt_pkcs.h tommath_class.h tommath_superclass.h
  124. #The default rule for make builds the libtomcrypt library.
  125. default:library
  126. #ciphers come in two flavours... enc+dec and enc
  127. aes_enc.o: aes.c aes_tab.c
  128. $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o
  129. #These are the rules to make certain object files.
  130. aes.o: aes.c aes_tab.c
  131. twofish.o: twofish.c twofish_tab.c
  132. whirl.o: whirl.c whirltab.c
  133. ecc.o: ecc.c ecc_sys.c
  134. dh.o: dh.c dh_sys.c
  135. sha512.o: sha512.c sha384.c
  136. sha256.o: sha256.c sha224.c
  137. #This rule makes the libtomcrypt library.
  138. library: $(LIBNAME)
  139. $(LIBNAME): $(OBJECTS)
  140. libtool --mode=link gcc $(CFLAGS) *.lo -o libtomcrypt.la -rpath $(LIBPATH) -version-info $(VERSION)
  141. libtool --mode=link gcc $(CFLAGS) *.o -o libtomcrypt.a
  142. libtool --mode=install install -c libtomcrypt.la $(LIBPATH)/libtomcrypt.la
  143. install -d -g root -o root $(DESTDIR)$(INCPATH)
  144. install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
  145. #This rule makes the hash program included with libtomcrypt
  146. hashsum: library
  147. gcc $(CFLAGS) demos/hashsum.c -o hashsum.o
  148. libtool --mode=link gcc -o hashsum hashsum.o -ltomcrypt $(MPISHARED)
  149. #makes the crypt program
  150. crypt: library
  151. gcc $(CFLAGS) demos/encrypt.c -o encrypt.o
  152. libtool --mode=link gcc -o crypt encrypt.o -ltomcrypt $(MPISHARED)
  153. x86_prof: library
  154. gcc $(CFLAGS) demos/x86_prof.c -o x86_prof.o
  155. libtool --mode=link gcc -o x86_prof x86_prof.o -ltomcrypt $(MPISHARED) $(EXTRALIBS)
  156. tv_gen: library $(TVS)
  157. gcc $(CFLAGS) demos/tv_gen.c -o tv_gen.o
  158. libtool --mode=link gcc -o tv_gen tv_gen.o -ltomcrypt $(MPISHARED)