comparison makefile.icc @ 15:6362d3854bb4 libtomcrypt-orig

0.96 release of LibTomCrypt
author Matt Johnston <matt@ucc.asn.au>
date Tue, 15 Jun 2004 14:07:21 +0000
parents 7faae8f46238
children 5d99163f7e32
comparison
equal deleted inserted replaced
3:7faae8f46238 15:6362d3854bb4
21 #AR=ar 21 #AR=ar
22 #ARFLAGS=r 22 #ARFLAGS=r
23 23
24 # Compilation flags. Note the += does not write over the user's CFLAGS! 24 # Compilation flags. Note the += does not write over the user's CFLAGS!
25 CFLAGS += -c -I./ -DINTEL_CC 25 CFLAGS += -c -I./ -DINTEL_CC
26
27 #The default rule for make builds the libtomcrypt library.
28 default:library
26 29
27 # optimize for SPEED 30 # optimize for SPEED
28 # 31 #
29 # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4 32 # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
30 # -ax? specifies make code specifically for ? but compatible with IA-32 33 # -ax? specifies make code specifically for ? but compatible with IA-32
45 48
46 #These flags control how the library gets built. 49 #These flags control how the library gets built.
47 50
48 #Output filenames for various targets. 51 #Output filenames for various targets.
49 LIBNAME=libtomcrypt.a 52 LIBNAME=libtomcrypt.a
50 TEST=test
51 HASH=hashsum 53 HASH=hashsum
52 CRYPT=encrypt 54 CRYPT=encrypt
53 SMALL=small 55 SMALL=small
54 PROF=x86_prof 56 PROF=x86_prof
55 TV=tv_gen 57 TV=tv_gen
65 #List of objects to compile. 67 #List of objects to compile.
66 68
67 #Leave MPI built-in or force developer to link against libtommath? 69 #Leave MPI built-in or force developer to link against libtommath?
68 MPIOBJECT=mpi.o 70 MPIOBJECT=mpi.o
69 71
70 OBJECTS=keyring.o gf.o strings.o base64.o \ 72 OBJECTS=error_to_string.o mpi_to_ltc_error.o base64_encode.o base64_decode.o \
71 \ 73 \
72 crypt.o crypt_find_cipher.o crypt_find_hash_any.o \ 74 crypt.o crypt_find_cipher.o crypt_find_hash_any.o \
73 crypt_hash_is_valid.o crypt_register_hash.o crypt_unregister_prng.o \ 75 crypt_hash_is_valid.o crypt_register_hash.o crypt_unregister_prng.o \
74 crypt_argchk.o crypt_find_cipher_any.o crypt_find_hash_id.o \ 76 crypt_argchk.o crypt_find_cipher_any.o crypt_find_hash_id.o \
75 crypt_prng_descriptor.o crypt_register_prng.o crypt_cipher_descriptor.o \ 77 crypt_prng_descriptor.o crypt_register_prng.o crypt_cipher_descriptor.o \
81 \ 83 \
82 rand_prime.o is_prime.o \ 84 rand_prime.o is_prime.o \
83 \ 85 \
84 ecc.o dh.o \ 86 ecc.o dh.o \
85 \ 87 \
86 rsa.o rsa_exptmod.o rsa_free.o rsa_make_key.o \ 88 rsa_decrypt_key.o rsa_encrypt_key.o rsa_exptmod.o rsa_free.o rsa_make_key.o \
87 \ 89 rsa_sign_hash.o rsa_verify_hash.o rsa_export.o rsa_import.o tim_exptmod.o \
88 dsa_export.o dsa_free.o dsa_import.o dsa_make_key.o dsa_sign_hash.o dsa_verify_hash.o dsa_verify_key.o \ 90 \
89 \ 91 dsa_export.o dsa_free.o dsa_import.o dsa_make_key.o dsa_sign_hash.o \
90 xtea.o aes.o des.o safer_tab.o safer.o saferp.o rc2.o \ 92 dsa_verify_hash.o dsa_verify_key.o \
91 rc6.o rc5.o cast5.o noekeon.o blowfish.o twofish.o skipjack.o \ 93 \
94 aes.o aes_enc.o \
95 \
96 blowfish.o des.o safer_tab.o safer.o saferp.o rc2.o xtea.o \
97 rc6.o rc5.o cast5.o noekeon.o twofish.o skipjack.o \
92 \ 98 \
93 md2.o md4.o md5.o sha1.o sha256.o sha512.o tiger.o whirl.o \ 99 md2.o md4.o md5.o sha1.o sha256.o sha512.o tiger.o whirl.o \
94 rmd128.o rmd160.o \ 100 rmd128.o rmd160.o \
95 \ 101 \
96 packet_store_header.o packet_valid_header.o \ 102 packet_store_header.o packet_valid_header.o \
105 omac_done.o omac_file.o omac_init.o omac_memory.o omac_process.o omac_test.o \ 111 omac_done.o omac_file.o omac_init.o omac_memory.o omac_process.o omac_test.o \
106 \ 112 \
107 pmac_done.o pmac_file.o pmac_init.o pmac_memory.o pmac_ntz.o pmac_process.o \ 113 pmac_done.o pmac_file.o pmac_init.o pmac_memory.o pmac_ntz.o pmac_process.o \
108 pmac_shift_xor.o pmac_test.o \ 114 pmac_shift_xor.o pmac_test.o \
109 \ 115 \
110 cbc_start.o cbc_encrypt.o cbc_decrypt.o \ 116 cbc_start.o cbc_encrypt.o cbc_decrypt.o cbc_getiv.o cbc_setiv.o \
111 cfb_start.o cfb_encrypt.o cfb_decrypt.o \ 117 cfb_start.o cfb_encrypt.o cfb_decrypt.o cfb_getiv.o cfb_setiv.o \
112 ofb_start.o ofb_encrypt.o ofb_decrypt.o \ 118 ofb_start.o ofb_encrypt.o ofb_decrypt.o ofb_getiv.o ofb_setiv.o \
113 ctr_start.o ctr_encrypt.o ctr_decrypt.o \ 119 ctr_start.o ctr_encrypt.o ctr_decrypt.o ctr_getiv.o ctr_setiv.o \
114 ecb_start.o ecb_encrypt.o ecb_decrypt.o \ 120 ecb_start.o ecb_encrypt.o ecb_decrypt.o \
115 \ 121 \
116 hash_file.o hash_filehandle.o hash_memory.o \ 122 hash_file.o hash_filehandle.o hash_memory.o \
117 \ 123 \
118 hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \ 124 hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \
119 \ 125 \
120 pkcs_1_mgf1.o pkcs_1_oaep_encode.o pkcs_1_oaep_decode.o \ 126 pkcs_1_mgf1.o pkcs_1_oaep_encode.o pkcs_1_oaep_decode.o \
121 pkcs_1_pss_encode.o pkcs_1_pss_decode.o pkcs_1_i2osp.o pkcs_1_os2ip.o \ 127 pkcs_1_pss_encode.o pkcs_1_pss_decode.o pkcs_1_i2osp.o pkcs_1_os2ip.o \
128 pkcs_1_v15_es_encode.o pkcs_1_v15_es_decode.o pkcs_1_v15_sa_encode.o pkcs_1_v15_sa_decode.o \
122 \ 129 \
123 pkcs_5_1.o pkcs_5_2.o \ 130 pkcs_5_1.o pkcs_5_2.o \
124 \ 131 \
125 burn_stack.o zeromem.o \ 132 burn_stack.o zeromem.o \
126 $(MPIOBJECT) 133 $(MPIOBJECT)
127 134
128 TESTOBJECTS=demos/test.o 135
136 #ciphers come in two flavours... enc+dec and enc
137 aes_enc.o: aes.c aes_tab.c
138 $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o
139
129 HASHOBJECTS=demos/hashsum.o 140 HASHOBJECTS=demos/hashsum.o
130 CRYPTOBJECTS=demos/encrypt.o 141 CRYPTOBJECTS=demos/encrypt.o
131 SMALLOBJECTS=demos/small.o 142 SMALLOBJECTS=demos/small.o
132 PROFS=demos/x86_prof.o 143 PROFS=demos/x86_prof.o
133 TVS=demos/tv_gen.o 144 TVS=demos/tv_gen.o
140 151
141 #Header files used by libtomcrypt. 152 #Header files used by libtomcrypt.
142 HEADERS=tommath.h mycrypt_cfg.h mycrypt_gf.h mycrypt_kr.h \ 153 HEADERS=tommath.h mycrypt_cfg.h mycrypt_gf.h mycrypt_kr.h \
143 mycrypt_misc.h mycrypt_prng.h mycrypt_cipher.h mycrypt_hash.h \ 154 mycrypt_misc.h mycrypt_prng.h mycrypt_cipher.h mycrypt_hash.h \
144 mycrypt_macros.h mycrypt_pk.h mycrypt.h mycrypt_argchk.h mycrypt_custom.h 155 mycrypt_macros.h mycrypt_pk.h mycrypt.h mycrypt_argchk.h mycrypt_custom.h
145
146 #The default rule for make builds the libtomcrypt library.
147 default:library mycrypt.h mycrypt_cfg.h
148 156
149 #These are the rules to make certain object files. 157 #These are the rules to make certain object files.
150 rsa.o: rsa.c rsa_sys.c 158 rsa.o: rsa.c rsa_sys.c
151 ecc.o: ecc.c ecc_sys.c 159 ecc.o: ecc.c ecc_sys.c
152 dh.o: dh.c dh_sys.c 160 dh.o: dh.c dh_sys.c
159 library: $(LIBNAME) 167 library: $(LIBNAME)
160 168
161 $(LIBNAME): $(OBJECTS) 169 $(LIBNAME): $(OBJECTS)
162 $(AR) $(ARFLAGS) $@ $(OBJECTS) 170 $(AR) $(ARFLAGS) $@ $(OBJECTS)
163 171
164 #This rule makes the test program included with libtomcrypt
165 test: library $(TESTOBJECTS)
166 $(CC) $(TESTOBJECTS) $(LIBNAME) -o $(TEST) $(WARN)
167
168 #This rule makes the hash program included with libtomcrypt 172 #This rule makes the hash program included with libtomcrypt
169 hashsum: library $(HASHOBJECTS) 173 hashsum: library $(HASHOBJECTS)
170 $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN) 174 $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN)
171 175
172 #makes the crypt program 176 #makes the crypt program
181 $(CC) $(PROFS) $(LIBNAME) -o $(PROF) 185 $(CC) $(PROFS) $(LIBNAME) -o $(PROF)
182 186
183 tv_gen: library $(TVS) 187 tv_gen: library $(TVS)
184 $(CC) $(TVS) $(LIBNAME) -o $(TV) 188 $(CC) $(TVS) $(LIBNAME) -o $(TV)
185 189
186 190
187 #make a profiled library (takes a while!!!)
188 #
189 # This will build the library with profile generation
190 # then run the test demo and rebuild the library.
191 #
192 # So far I've seen improvements in the MP math
193 profiled:
194 make -f makefile.icc CFLAGS="$(CFLAGS) -prof_gen" test
195 ./test
196 rm -f *.a *.o test demos/test.o
197 make -f makefile.icc CFLAGS="$(CFLAGS) -prof_use"
198
199 #This rule installs the library and the header files. This must be run 191 #This rule installs the library and the header files. This must be run
200 #as root in order to have a high enough permission to write to the correct 192 #as root in order to have a high enough permission to write to the correct
201 #directories and to set the owner and group to root. 193 #directories and to set the owner and group to root.
202 install: library 194 install: library
203 install -d -g root -o root $(DESTDIR)$(LIBPATH) 195 install -d -g root -o root $(DESTDIR)$(LIBPATH)