comparison makefile @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05

Import of libtomcrypt 1.05
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jul 2005 03:53:40 +0000
parents 1c15b283127b
children
comparison
equal deleted inserted replaced
191:1c15b283127b 209:39d5d58461d6
2 # 2 #
3 # Tom St Denis 3 # Tom St Denis
4 # Modified by Clay Culver 4 # Modified by Clay Culver
5 5
6 # The version 6 # The version
7 VERSION=1.02 7 VERSION=1.05
8 8
9 # Compiler and Linker Names 9 # Compiler and Linker Names
10 #CC=gcc 10 #CC=gcc
11 #LD=ld 11 #LD=ld
12 12
19 19
20 # additional warnings (newer GCC 3.4 and higher) 20 # additional warnings (newer GCC 3.4 and higher)
21 #CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \ 21 #CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wmissing-prototypes \
22 # -Wmissing-declarations -Wpointer-arith 22 # -Wmissing-declarations -Wpointer-arith
23 23
24 ifndef IGNORE_SPEED
25
24 # optimize for SPEED 26 # optimize for SPEED
25 CFLAGS += -O3 -funroll-loops 27 CFLAGS += -O3 -funroll-loops
26 28
27 # add -fomit-frame-pointer. hinders debugging! 29 # add -fomit-frame-pointer. hinders debugging!
28 CFLAGS += -fomit-frame-pointer 30 CFLAGS += -fomit-frame-pointer
29 31
30 # optimize for SIZE 32 # optimize for SIZE
31 #CFLAGS += -Os -DLTC_SMALL_CODE 33 #CFLAGS += -Os -DLTC_SMALL_CODE
34
35 endif
32 36
33 # older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros 37 # older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
34 # define this to help 38 # define this to help
35 #CFLAGS += -DLTC_NO_ROLC 39 #CFLAGS += -DLTC_NO_ROLC
36 40
56 LIBPATH=/usr/lib 60 LIBPATH=/usr/lib
57 INCPATH=/usr/include 61 INCPATH=/usr/include
58 DATAPATH=/usr/share/doc/libtomcrypt/pdf 62 DATAPATH=/usr/share/doc/libtomcrypt/pdf
59 63
60 #Who do we install as? 64 #Who do we install as?
65 ifdef INSTALL_USER
66 USER=$(INSTALL_USER)
67 else
61 USER=root 68 USER=root
69 endif
70
71 ifdef INSTALL_GROUP
72 GROUP=$(INSTALL_GROUP)
73 else
62 GROUP=wheel 74 GROUP=wheel
75 endif
63 76
64 #List of objects to compile. 77 #List of objects to compile.
65 78
66 #Leave MPI built-in or force developer to link against libtommath? 79 #Leave MPI built-in or force developer to link against libtommath?
80 ifndef IGNORE_MPI
67 MPIOBJECT=src/misc/mpi/mpi.o 81 MPIOBJECT=src/misc/mpi/mpi.o
82 endif
68 83
69 OBJECTS=src/ciphers/aes/aes_enc.o $(MPIOBJECT) src/ciphers/aes/aes.o src/ciphers/anubis.o \ 84 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 \ 85 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 \ 86 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 \ 87 src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
113 src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \ 128 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 \ 129 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 \ 130 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 \ 131 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 \ 132 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/der_decode_integer.o src/pk/asn1/der/der_encode_integer.o \ 133 src/modes/ofb/ofb_start.o src/pk/asn1/der/bit/der_decode_bit_string.o \
119 src/pk/asn1/der/der_get_multi_integer.o src/pk/asn1/der/der_length_integer.o \ 134 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/der_put_multi_integer.o src/pk/dh/dh.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \ 135 src/pk/asn1/der/choice/der_decode_choice.o src/pk/asn1/der/ia5/der_decode_ia5_string.o \
121 src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_sign_hash.o \ 136 src/pk/asn1/der/ia5/der_encode_ia5_string.o src/pk/asn1/der/ia5/der_length_ia5_string.o \
122 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 \ 137 src/pk/asn1/der/integer/der_decode_integer.o src/pk/asn1/der/integer/der_encode_integer.o \
123 src/pk/packet_valid_header.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \ 138 src/pk/asn1/der/integer/der_length_integer.o \
124 src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \ 139 src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
125 src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v15_es_decode.o \ 140 src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
126 src/pk/pkcs1/pkcs_1_v15_es_encode.o src/pk/pkcs1/pkcs_1_v15_sa_decode.o \ 141 src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
127 src/pk/pkcs1/pkcs_1_v15_sa_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \ 142 src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
143 src/pk/asn1/der/octet/der_length_octet_string.o \
144 src/pk/asn1/der/printable_string/der_decode_printable_string.o \
145 src/pk/asn1/der/printable_string/der_encode_printable_string.o \
146 src/pk/asn1/der/printable_string/der_length_printable_string.o \
147 src/pk/asn1/der/sequence/der_decode_sequence.o src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
148 src/pk/asn1/der/sequence/der_encode_sequence.o src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
149 src/pk/asn1/der/sequence/der_length_sequence.o \
150 src/pk/asn1/der/short_integer/der_decode_short_integer.o \
151 src/pk/asn1/der/short_integer/der_encode_short_integer.o \
152 src/pk/asn1/der/short_integer/der_length_short_integer.o src/pk/asn1/der/utctime/der_decode_utctime.o \
153 src/pk/asn1/der/utctime/der_encode_utctime.o src/pk/asn1/der/utctime/der_length_utctime.o \
154 src/pk/dh/dh.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o src/pk/dsa/dsa_import.o \
155 src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
156 src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/packet_store_header.o src/pk/packet_valid_header.o \
157 src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o src/pk/pkcs1/pkcs_1_oaep_decode.o \
158 src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o src/pk/pkcs1/pkcs_1_pss_decode.o \
159 src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
128 src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \ 160 src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_import.o \
129 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_v15_decrypt_key.o \ 161 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o \
130 src/pk/rsa/rsa_v15_encrypt_key.o src/pk/rsa/rsa_v15_sign_hash.o src/pk/rsa/rsa_v15_verify_hash.o \ 162 src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
131 src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \ 163 src/prngs/sprng.o src/prngs/yarrow.o
132 src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o 164
133 165 HEADERS=src/headers/tommath_superclass.h src/headers/tomcrypt_cfg.h src/headers/tomcrypt_mac.h \
134 HEADERS=src/headers/tommath_superclass.h src/headers/tomcrypt_cfg.h \ 166 src/headers/tomcrypt_macros.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h \
135 src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \ 167 src/headers/tomcrypt_cipher.h src/headers/tomcrypt_pk.h src/headers/tommath_class.h \
136 src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h \ 168 src/headers/ltc_tommath.h src/headers/tomcrypt_hash.h src/headers/tomcrypt_misc.h \
137 src/headers/tomcrypt_cipher.h src/headers/tomcrypt_pk.h \ 169 src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
138 src/headers/tommath_class.h src/headers/ltc_tommath.h src/headers/tomcrypt_hash.h \
139 src/headers/tomcrypt_misc.h src/headers/tomcrypt.h src/headers/tomcrypt_pkcs.h \
140 src/headers/tomcrypt_prng.h testprof/tomcrypt_test.h
141 170
142 TESTOBJECTS=demos/test.o 171 TESTOBJECTS=demos/test.o
143 HASHOBJECTS=demos/hashsum.o 172 HASHOBJECTS=demos/hashsum.o
144 CRYPTOBJECTS=demos/encrypt.o 173 CRYPTOBJECTS=demos/encrypt.o
145 SMALLOBJECTS=demos/small.o 174 SMALLOBJECTS=demos/small.o
169 src/pk/dh/dh.o: src/pk/dh/dh.c src/pk/dh/dh_sys.c 198 src/pk/dh/dh.o: src/pk/dh/dh.c src/pk/dh/dh_sys.c
170 src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c 199 src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
171 src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c 200 src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
172 201
173 #This rule makes the libtomcrypt library. 202 #This rule makes the libtomcrypt library.
174 library: $(LIBTEST) $(LIBNAME) 203 library: $(LIBNAME)
175 204
176 $(LIBTEST): 205 $(LIBTEST):
177 cd testprof ; CFLAGS="$(CFLAGS)" make 206 cd testprof ; CFLAGS="$(CFLAGS)" make
178 207
179 $(LIBNAME): $(OBJECTS) 208 $(LIBNAME): $(OBJECTS)
191 #makes the small program 220 #makes the small program
192 small: library $(SMALLOBJECTS) 221 small: library $(SMALLOBJECTS)
193 $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN) 222 $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN)
194 223
195 tv_gen: library $(TVS) 224 tv_gen: library $(TVS)
196 $(CC) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) 225 $(CC) $(TVS) $(LIBNAME) -o $(TV)
197 226
198 multi: library $(MULTIS) 227 multi: library $(MULTIS)
199 $(CC) $(MULTIS) $(LIBNAME) -o $(MULTI) 228 $(CC) $(MULTIS) $(LIBNAME) -o $(MULTI)
200 229
201 timing: library $(TIMINGS) 230 timing: library $(LIBTEST) $(TIMINGS)
202 $(CC) $(TIMINGS) $(LIBTEST) $(LIBNAME) -o $(TIMING) 231 $(CC) $(TIMINGS) $(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING)
203 232
204 test: library $(TESTS) 233 test: library $(LIBTEST) $(TESTS)
205 $(CC) $(TESTS) $(LIBTEST) $(LIBNAME) -o $(TEST) 234 $(CC) $(TESTS) $(LIBTEST) $(LIBNAME) -o $(TEST)
206 235
207 236
208 #This rule installs the library and the header files. This must be run 237 #This rule installs the library and the header files. This must be run
209 #as root in order to have a high enough permission to write to the correct 238 #as root in order to have a high enough permission to write to the correct
214 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH) 243 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH)
215 install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH) 244 install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
216 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) 245 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
217 install -g $(GROUP) -o $(USER) doc/crypt.pdf $(DESTDIR)$(DATAPATH) 246 install -g $(GROUP) -o $(USER) doc/crypt.pdf $(DESTDIR)$(DATAPATH)
218 247
219 install_lib: library 248 install_test: $(LIBTEST)
220 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH) 249 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
221 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) 250 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
222 install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH) 251 install -g $(GROUP) -o $(USER) $(LIBTEST) $(DESTDIR)$(LIBPATH)
223 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) 252
253 profile:
254 CFLAGS="$(CFLAGS) -fprofile-generate" make timing EXTRALIBS=-lgcov
255 ./timing
256 rm -f timing `find . -type f | grep [.][ao] | xargs`
257 CFLAGS="$(CFLAGS) -fprofile-use" make timing EXTRALIBS=-lgcov
258
224 259
225 #This rule cleans the source tree of all compiled code, not including the pdf 260 #This rule cleans the source tree of all compiled code, not including the pdf
226 #documentation. 261 #documentation.
227 clean: 262 clean:
228 rm -f `find . -type f | grep "[.]o" | xargs` 263 rm -f `find . -type f | grep "[.]o" | xargs`
240 rm -rf `find . -type d | grep "[.]libs" | xargs` 275 rm -rf `find . -type d | grep "[.]libs" | xargs`
241 rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc 276 rm -f crypt.aux crypt.dvi crypt.idx crypt.ilg crypt.ind crypt.log crypt.toc
242 rm -f $(TV) $(PROF) $(SMALL) $(CRYPT) $(HASHSUM) $(MULTI) $(TIMING) $(TEST) 277 rm -f $(TV) $(PROF) $(SMALL) $(CRYPT) $(HASHSUM) $(MULTI) $(TIMING) $(TEST)
243 rm -rf doc/doxygen 278 rm -rf doc/doxygen
244 rm -f doc/*.pdf 279 rm -f doc/*.pdf
280 rm -f *.txt
245 281
246 #build the doxy files (requires Doxygen, tetex and patience) 282 #build the doxy files (requires Doxygen, tetex and patience)
247 doxy: 283 doxy:
248 doxygen 284 doxygen
249 cd doc/doxygen/latex ; make ; mv -f refman.pdf ../../. 285 cd doc/doxygen/latex ; make ; mv -f refman.pdf ../../.
272 latex crypt > /dev/null 308 latex crypt > /dev/null
273 309
274 #zipup the project (take that!) 310 #zipup the project (take that!)
275 no_oops: clean 311 no_oops: clean
276 cd .. ; cvs commit 312 cd .. ; cvs commit
313 echo Scanning for scratch/dirty files
314 find . -type f | grep -v CVS | xargs -n 1 bash mess.sh
277 315
278 zipup: no_oops docs 316 zipup: no_oops docs
279 cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \ 317 cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \
280 cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; \ 318 cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; \
281 cd libtomcrypt-$(VERSION) ; rm -rf `find . -type d | grep CVS | xargs` ; cd .. ; \ 319 cd libtomcrypt-$(VERSION) ; rm -rf `find . -type d | grep CVS | xargs` ; cd .. ; \
282 tar -cjvf crypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) ; \ 320 tar -cjvf crypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) ; \
283 zip -9r crypt-$(VERSION).zip libtomcrypt-$(VERSION) ; \ 321 zip -9r crypt-$(VERSION).zip libtomcrypt-$(VERSION) ; \
284 gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip ; \ 322 gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip ; \
285 mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION) 323 mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION)
324
325
326 # $Source: /cvs/libtom/libtomcrypt/makefile,v $
327 # $Revision: 1.70 $
328 # $Date: 2005/06/19 18:03:24 $