123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- # MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...)
- # works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems
- #
- # Please do not use here neither any special make syntax nor any unusual tools/utilities!
- #
- # BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION /updatemakes.sh
- ### USAGE:
- #
- # make -f makefile.unix all
- # ./
- # make
- #
- #Or:
- #
- # make /path//libtommath/
- # ./test
- # make -f makefile.unix PREFIX=/opt/libtom install
- #
- #Or if you are using Intel C compiler you might need something like:
- #
- # make -f makefile.unix CC=icc AR=xiar CFLAGS= EXTRALIBS=/path/to/libtommath/libtommath.a all
- #
- #The following can be overridden from command line e.g.
- DESTDIR =
- PREFIX = /usr/local
- LIBPATH = $(PREFIX)/lib
- INCPATH /include
- DATAPATH = $(PREFIX)//doc//pdf
- BINPATH = $(PREFIX)/
- CC
- AR
- ARFLAGS
- RANLIB
- CFLAGS /libtommath
- EXTRALIBS = ..//libtommath.a
- #Compilation flags
- LTC_CFLAGS = -Isrc/
- LTC_LDFLAGS
- VERSION=1.18.2
- #Libraries
- LIBMAIN_S
- #List
- OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o /ciphers//ciphers/
- src/ciphers/camellia.o /ciphers//ciphers//ciphers//ciphers/
- src/ciphers/kseed.o /ciphers//ciphers//ciphers//ciphers/
- src/ciphers/rc6.o /ciphers//safer.o src//safer//ciphers/
- src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o
- src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o /encauth//ccm_init.o \
- src//ccm//encauth//ccm_process.o src//ccm/
- src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o
- src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o
- src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o
- src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o
- src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
- src/encauth/chachapoly/chacha20poly1305_test.o /encauth//eax_addheader.o \
- src//eax//encauth//eax_decrypt_verify_memory.o src//eax/
- src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o
- src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o /encauth//gcm_add_aad.o \
- src//gcm//encauth//gcm_done.o src//gcm/
- src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o /encauth//gcm_mult_h.o \
- src//gcm//encauth//gcm_reset.o src//gcm/
- src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o
- src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o /encauth//ocb_encrypt.o \
- src//ocb//encauth//ocb_init.o src//ocb/
- src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o /encauth//s_ocb_done.o \
- src//ocb3//encauth//ocb3_decrypt.o src//ocb3/
- src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o
- src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o
- src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o /encauth//ocb3_int_ntz.o \
- src//ocb3//encauth//ocb3_test.o src//blake2b.o \
- src//blake2s.o src//chc//hashes//hash_file.o \
- src//helper//hashes//hash_memory.o \
- src//helper//hashes//hashes//hashes/
- src/hashes/rmd128.o /hashes//hashes//hashes//hashes/
- src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o /hashes//sha384.o src//sha2/
- src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o /hashes//hashes/
- src/hashes/tiger.o /hashes//whirl.o src//blake2/
- src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o
- src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o /mac//blake2smac.o \
- src//blake2//mac//blake2smac_memory.o \
- src//blake2//mac//blake2smac_test.o src//f9/
- src/mac/f9/f9_file.o src/mac/f9/f9_init.o /mac//f9_memory.o src//f9/
- src/mac/f9/f9_process.o src/mac/f9/f9_test.o /mac//hmac_done.o src//hmac/
- src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o /mac//hmac_memory_multi.o \
- src//hmac//mac//hmac_test.o src//omac//mac//omac_file.o \
- src//omac//mac//omac_memory.o src//omac/
- src/mac/omac/omac_process.o src/mac/omac/omac_test.o /mac//pelican.o \
- src//pelican//mac//pelican_test.o src//pmac/
- src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o /mac//pmac_memory.o \
- src//pmac//mac//pmac_ntz.o src//pmac/
- src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o /mac//poly1305.o \
- src//poly1305//mac//poly1305_memory.o \
- src//poly1305//mac//poly1305_test.o src//xcbc/
- src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o /mac//xcbc_memory.o \
- src//xcbc//mac//xcbc_process.o src//xcbc/
- src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
- src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
- src/misc/base64/base64_decode.o /misc//base64_encode.o src//burn_stack.o \
- src//compare_testvector.o src//crc32.o src//crypt//misc//crypt_argchk.o \
- src//crypt//misc//crypt_cipher_is_valid.o \
- src//crypt//misc//crypt_find_cipher.o \
- src//crypt//misc//crypt_find_cipher_id.o \
- src//crypt//misc//crypt_find_hash_any.o \
- src//crypt//misc//crypt_find_hash_oid.o \
- src//crypt//misc//crypt_fsa.o src//crypt/
- src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o
- src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o
- src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o
- src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o
- src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o
- src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o /misc//crypt_sizes.o \
- src//crypt//misc//crypt_unregister_hash.o \
- src//crypt//misc//misc//hkdf.o \
- src//hkdf//misc//misc//misc//pkcs_5_1.o \
- src//pkcs5//misc//pkcs_5_test.o src//zeromem.o src//cbc/
- src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o /modes//cbc_getiv.o \
- src//cbc//modes//cbc_start.o src//cfb/
- src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o /modes//cfb_getiv.o \
- src//cfb//modes//cfb_start.o src//ctr/
- src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o /modes//ctr_getiv.o \
- src//ctr//modes//ctr_start.o src//ctr/
- src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o /modes//ecb_encrypt.o \
- src//ecb//modes//f8_decrypt.o src//f8//modes//f8_encrypt.o \
- src//f8//modes//f8_setiv.o src//f8//modes//f8_test_mode.o \
- src//lrw//modes//lrw_done.o src//lrw/
- src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o /modes//lrw_setiv.o \
- src//lrw//modes//lrw_test.o src//ofb//modes//ofb_done.o \
- src//ofb//modes//ofb_getiv.o src//ofb/
- src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o /modes//xts_done.o \
- src//xts//modes//xts_init.o src//xts/
- src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o
- src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o
- src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o
- src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o
- src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o
- src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
- src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o
- src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
- src/pk/asn1/der/ia5/der_decode_ia5_string.o /pk//der//der_encode_ia5_string.o \
- src//asn1//ia5//pk//der//der_decode_integer.o \
- src//asn1//integer//pk//der//der_length_integer.o \
- src//asn1//object_identifier/
- src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
- src/pk/asn1/der/object_identifier/der_length_object_identifier.o
- src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o
- src/pk/asn1/der/octet/der_length_octet_string.o \
- src/pk/asn1/der/printable_string/der_decode_printable_string.o
- src/pk/asn1/der/printable_string/der_encode_printable_string.o \
- src/pk/asn1/der/printable_string/der_length_printable_string.o
- src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
- src/pk/asn1/der/sequence/der_decode_sequence_flexi.o
- src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
- src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o
- src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
- src/pk/asn1/der/sequence/der_encode_sequence_multi.o
- src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
- src/pk/asn1/der/sequence/der_length_sequence.o /pk//der//der_sequence_free.o \
- src//asn1//sequence//pk//der//der_encode_set.o \
- src//asn1//set//pk//der//der_decode_short_integer.o \
- src//asn1//short_integer/
- src/pk/asn1/der/short_integer/der_length_short_integer.o \
- src/pk/asn1/der/teletex_string/der_decode_teletex_string.o
- src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
- src/pk/asn1/der/utctime/der_decode_utctime.o /pk//der//der_encode_utctime.o \
- src//asn1//utctime//pk//der//der_decode_utf8_string.o \
- src//asn1//utf8//pk//der//der_length_utf8_string.o \
- src//dh//pk//dh_check_pubkey.o src//dh//pk//dh_export_key.o \
- src//dh//pk//dh_generate_key.o src//dh//pk//dh_set.o \
- src//dh//pk//dh_shared_secret.o src//dsa/
- src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o /pk//dsa_free.o \
- src//dsa//pk//dsa_generate_pqg.o src//dsa/
- src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o /pk//dsa_set_pqg_dsaparam.o \
- src//dsa//pk//dsa_sign_hash.o src//dsa/
- src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o /pk//ecc_ansi_x963_export.o \
- src//ecc//pk//ecc_decrypt_key.o src//ecc/
- src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o /pk//ecc_get_size.o src//ecc/
- src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o /pk//ecc_sign_hash.o \
- src//ecc//pk//ecc_test.o src//ecc/
- src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o /pk//ltc_ecc_mul2add.o \
- src//ecc//pk//ltc_ecc_mulmod_timing.o src//ecc/
- src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o
- src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o /pk//katja_export.o \
- src//katja//pk//katja_free.o src//katja/
- src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o /pk//pkcs_1_mgf1.o \
- src//pkcs1//pk//pkcs_1_oaep_encode.o src//pkcs1/
- src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o /pk//pkcs_1_v1_5_decode.o \
- src//pkcs1//pk//rsa_decrypt_key.o src//rsa/
- src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o /pk//rsa_free.o src//rsa/
- src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o /pk//rsa_import_x509.o \
- src//rsa//pk//rsa_set.o src//rsa/
- src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o /prngs//prngs/
- src/prngs/rc4.o /prngs//prngs//prngs/
- src/prngs/sprng.o /prngs//stream//chacha_crypt.o src//chacha/
- src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o
- src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o /stream//chacha_test.o \
- src//rc4//stream//rc4_test.o src//sober128/
- src/stream/sober128/sober128_test.o
- #List of test objects to compile (all goes to libtomcrypt_prof.a)
- TOBJECTS=tests/base64_test.o /cipher_hash_test.o tests//der_test.o tests/
- tests/dsa_test.o tests/ecc_test.o /file_test.o tests//mac_test.o tests/
- tests/modes_test.o tests/mpi_test.o /multi_test.o tests//pkcs_1_eme_test.o \
- tests//pkcs_1_oaep_test.o tests//pkcs_1_test.o \
- tests//rotate_test.o tests//store_test.o tests/
- #The
- HEADERS=src/headers/tomcrypt.h /headers//headers/
- src/headers/tomcrypt_cipher.h /headers//headers/
- src/headers/tomcrypt_mac.h /headers//headers/
- src/headers/tomcrypt_misc.h /headers//headers/
- src/headers/tomcrypt_prng.h
- #The
- default: $(LIBMAIN_S)
- #SPECIAL: AES
- src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c /ciphers//aes_tab.c
- $(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src//aes//ciphers//aes_enc.o
- #SPECIAL: these are the rules to make certain object files
- src//aes//ciphers//aes.c src//aes/
- src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c /ciphers//twofish_tab.c
- src//whirl//hashes//whirl.c src//whirl/
- src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c /hashes//sha384.c
- src//sha2//hashes//sha512.c src//sha2/
- src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c /hashes//sha512_256.c
- src//sha2//hashes//sha256.c src//sha2/
- #Dependencies
- $(OBJECTS): $(HEADERS)
- $(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
- #This is necessary for compatibility with BSD make (namely on OpenBSD)
- .SUFFIXES: .o .c
- .c.o:
- $(CC) $(LTC_CFLAGS) -c $< -o $@
- #Create libtomcrypt.a
- $(LIBMAIN_S): $(OBJECTS)
- $(AR) $(ARFLAGS) $@ $(OBJECTS)
- $(RANLIB) $@
- #Demo tools/utilities
- hashsum: demos/hashsum.o $(LIBMAIN_S)
- $(CC) demos/hashsum.o
- ltcrypt: demos/ltcrypt.o $(LIBMAIN_S)
- $(CC) demos/ltcrypt.o
- small: demos/small.o $(LIBMAIN_S)
- $(CC) demos/small.o
- tv_gen: demos/tv_gen.o $(LIBMAIN_S)
- $(CC) demos/tv_gen.o
- sizes: demos/sizes.o $(LIBMAIN_S)
- $(CC) demos/sizes.o
- constants: demos/constants.o $(LIBMAIN_S)
- $(CC) demos/constants.o
- timing: demos/timing.o $(LIBMAIN_S)
- $(CC) demos/timing.o
- #Tests
- test: $(TOBJECTS) $(LIBMAIN_S)
- $(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o
- @echo
- all: $(LIBMAIN_S) hashsum
- #NOTE: this
- clean:
- -@rm
- -@rm
- -@rm /*.o *_tv.txt
- -@rm -f test constants sizes tv_gen hashsum ltcrypt small timing
- -@rm -f test.exe constants.exe sizes.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe
- #Install the library + headers
- install: $(LIBMAIN_S) $(HEADERS)
- @mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/
- @cp /
- @cp $(HEADERS) $(DESTDIR)$(INCPATH)/
- @sed /pkgconfig/
- #Install
- install_bins: hashsum
- @mkdir
- @cp /
- #Install documentation
- install_docs: doc/
- @mkdir
- @cp /crypt.pdf $(DESTDIR)$(DATAPATH)/
|