comparison makefile @ 191:1c15b283127b libtomcrypt-orig

Import of libtomcrypt 1.02 with manual path rename rearrangement etc
author Matt Johnston <matt@ucc.asn.au>
date Fri, 06 May 2005 13:23:02 +0000
parents 5d99163f7e32
children 39d5d58461d6
comparison
equal deleted inserted replaced
143:5d99163f7e32 191:1c15b283127b
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=0.99 7 VERSION=1.02
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
13 # Archiver [makes .a files] 13 # Archiver [makes .a files]
14 #AR=ar 14 #AR=ar
15 #ARFLAGS=r 15 #ARFLAGS=r
16 16
17 # Compilation flags. Note the += does not write over the user's CFLAGS! 17 # Compilation flags. Note the += does not write over the user's CFLAGS!
18 CFLAGS += -c -I./ -Wall -Wsign-compare -W -Wshadow 18 CFLAGS += -c -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -W -Wshadow -Wno-unused-parameter
19 # -Werror 19
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 \
22 # -Wmissing-declarations -Wpointer-arith
20 23
21 # optimize for SPEED 24 # optimize for SPEED
22 #CFLAGS += -O3 -funroll-all-loops 25 CFLAGS += -O3 -funroll-loops
23 26
24 #add -fomit-frame-pointer. hinders debugging! 27 # add -fomit-frame-pointer. hinders debugging!
25 #CFLAGS += -fomit-frame-pointer 28 CFLAGS += -fomit-frame-pointer
26 29
27 # optimize for SIZE 30 # optimize for SIZE
28 CFLAGS += -Os -DSMALL_CODE 31 #CFLAGS += -Os -DLTC_SMALL_CODE
32
33 # older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
34 # define this to help
35 #CFLAGS += -DLTC_NO_ROLC
29 36
30 # compile for DEBUGING (required for ccmalloc checking!!!) 37 # compile for DEBUGING (required for ccmalloc checking!!!)
31 #CFLAGS += -g3 38 #CFLAGS += -g3 -DLTC_NO_ASM
32
33 #These flags control how the library gets built.
34 39
35 #Output filenames for various targets. 40 #Output filenames for various targets.
36 LIBNAME=libtomcrypt.a 41 LIBNAME=libtomcrypt.a
42 LIBTEST=testprof/libtomcrypt_prof.a
37 HASH=hashsum 43 HASH=hashsum
38 CRYPT=encrypt 44 CRYPT=encrypt
39 SMALL=small 45 SMALL=small
40 PROF=x86_prof 46 PROF=x86_prof
41 TV=tv_gen 47 TV=tv_gen
48 MULTI=multi
49 TIMING=timing
50 TEST=test
42 51
43 #LIBPATH-The directory for libtomcrypt to be installed to. 52 #LIBPATH-The directory for libtomcrypt to be installed to.
44 #INCPATH-The directory to install the header files for libtomcrypt. 53 #INCPATH-The directory to install the header files for libtomcrypt.
45 #DATAPATH-The directory to install the pdf docs. 54 #DATAPATH-The directory to install the pdf docs.
46 DESTDIR= 55 DESTDIR=
47 LIBPATH=/usr/lib 56 LIBPATH=/usr/lib
48 INCPATH=/usr/include 57 INCPATH=/usr/include
49 DATAPATH=/usr/share/doc/libtomcrypt/pdf 58 DATAPATH=/usr/share/doc/libtomcrypt/pdf
50 59
60 #Who do we install as?
61 USER=root
62 GROUP=wheel
63
51 #List of objects to compile. 64 #List of objects to compile.
52 65
53 #Leave MPI built-in or force developer to link against libtommath? 66 #Leave MPI built-in or force developer to link against libtommath?
54 MPIOBJECT=mpi.o 67 MPIOBJECT=src/misc/mpi/mpi.o
55 68
56 OBJECTS=error_to_string.o mpi_to_ltc_error.o base64_encode.o base64_decode.o \ 69 OBJECTS=src/ciphers/aes/aes_enc.o $(MPIOBJECT) src/ciphers/aes/aes.o src/ciphers/anubis.o \
57 \ 70 src/ciphers/blowfish.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/khazad.o src/ciphers/noekeon.o \
58 crypt.o crypt_find_cipher.o crypt_find_hash_any.o \ 71 src/ciphers/rc2.o src/ciphers/rc5.o src/ciphers/rc6.o src/ciphers/safer/safer.o \
59 crypt_hash_is_valid.o crypt_register_hash.o crypt_unregister_prng.o \ 72 src/ciphers/safer/safer_tab.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
60 crypt_argchk.o crypt_find_cipher_any.o crypt_find_hash_id.o \ 73 src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_memory.o \
61 crypt_prng_descriptor.o crypt_register_prng.o crypt_cipher_descriptor.o \ 74 src/encauth/ccm/ccm_test.o src/encauth/eax/eax_addheader.o src/encauth/eax/eax_decrypt.o \
62 crypt_find_cipher_id.o crypt_find_prng.o crypt_prng_is_valid.o \ 75 src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o src/encauth/eax/eax_encrypt.o \
63 crypt_unregister_cipher.o crypt_cipher_is_valid.o crypt_find_hash.o \ 76 src/encauth/eax/eax_encrypt_authenticate_memory.o src/encauth/eax/eax_init.o \
64 crypt_hash_descriptor.o crypt_register_cipher.o crypt_unregister_hash.o \ 77 src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o src/encauth/gcm/gcm_add_iv.o \
65 \ 78 src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o src/encauth/gcm/gcm_init.o \
66 sober128.o fortuna.o sprng.o yarrow.o rc4.o rng_get_bytes.o rng_make_prng.o \ 79 src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o \
67 \ 80 src/encauth/gcm/gcm_test.o src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
68 rand_prime.o is_prime.o \ 81 src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
69 \ 82 src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
70 ecc.o dh.o \ 83 src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
71 \ 84 src/hashes/chc/chc.o src/hashes/helper/hash_file.o src/hashes/helper/hash_filehandle.o \
72 rsa_decrypt_key.o rsa_encrypt_key.o rsa_exptmod.o rsa_free.o rsa_make_key.o \ 85 src/hashes/helper/hash_memory.o src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o \
73 rsa_sign_hash.o rsa_verify_hash.o rsa_export.o rsa_import.o tim_exptmod.o \ 86 src/hashes/md5.o src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/sha1.o src/hashes/sha2/sha256.o \
74 rsa_v15_encrypt_key.o rsa_v15_decrypt_key.o rsa_v15_sign_hash.o rsa_v15_verify_hash.o \ 87 src/hashes/sha2/sha512.o src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/hmac/hmac_done.o \
75 \ 88 src/mac/hmac/hmac_file.o src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o \
76 dsa_export.o dsa_free.o dsa_import.o dsa_make_key.o dsa_sign_hash.o \ 89 src/mac/hmac/hmac_memory_multi.o src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o \
77 dsa_verify_hash.o dsa_verify_key.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 \
78 \ 91 src/mac/omac/omac_memory_multi.o src/mac/omac/omac_process.o src/mac/omac/omac_test.o \
79 aes.o aes_enc.o \ 92 src/mac/pelican/pelican.o src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o \
80 \ 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 \
81 blowfish.o des.o safer_tab.o safer.o saferp.o rc2.o xtea.o \ 94 src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
82 rc6.o rc5.o cast5.o noekeon.o twofish.o skipjack.o \ 95 src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/misc/base64/base64_decode.o \
83 \ 96 src/misc/base64/base64_encode.o src/misc/burn_stack.o src/misc/crypt/crypt.o \
84 md2.o md4.o md5.o sha1.o sha256.o sha512.o tiger.o whirl.o \ 97 src/misc/crypt/crypt_argchk.o src/misc/crypt/crypt_cipher_descriptor.o \
85 rmd128.o rmd160.o chc.o \ 98 src/misc/crypt/crypt_cipher_is_valid.o src/misc/crypt/crypt_find_cipher.o \
86 \ 99 src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
87 packet_store_header.o packet_valid_header.o \ 100 src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
88 \ 101 src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_prng.o \
89 eax_addheader.o eax_decrypt.o eax_decrypt_verify_memory.o eax_done.o eax_encrypt.o \ 102 src/misc/crypt/crypt_hash_descriptor.o src/misc/crypt/crypt_hash_is_valid.o \
90 eax_encrypt_authenticate_memory.o eax_init.o eax_test.o \ 103 src/misc/crypt/crypt_prng_descriptor.o src/misc/crypt/crypt_prng_is_valid.o \
91 \ 104 src/misc/crypt/crypt_register_cipher.o src/misc/crypt/crypt_register_hash.o \
92 ocb_decrypt.o ocb_decrypt_verify_memory.o ocb_done_decrypt.o ocb_done_encrypt.o \ 105 src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_unregister_cipher.o \
93 ocb_encrypt.o ocb_encrypt_authenticate_memory.o ocb_init.o ocb_ntz.o \ 106 src/misc/crypt/crypt_unregister_hash.o src/misc/crypt/crypt_unregister_prng.o \
94 ocb_shift_xor.o ocb_test.o s_ocb_done.o \ 107 src/misc/error_to_string.o src/misc/mpi/is_prime.o src/misc/mpi/mpi_to_ltc_error.o \
95 \ 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 \
96 omac_done.o omac_file.o omac_init.o omac_memory.o omac_process.o omac_test.o \ 109 src/modes/cbc/cbc_decrypt.o src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o \
97 \ 110 src/modes/cbc/cbc_getiv.o src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o \
98 pmac_done.o pmac_file.o pmac_init.o pmac_memory.o pmac_ntz.o pmac_process.o \ 111 src/modes/cfb/cfb_decrypt.o src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o \
99 pmac_shift_xor.o pmac_test.o \ 112 src/modes/cfb/cfb_getiv.o src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o \
100 \ 113 src/modes/ctr/ctr_decrypt.o src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o \
101 cbc_start.o cbc_encrypt.o cbc_decrypt.o cbc_getiv.o cbc_setiv.o \ 114 src/modes/ctr/ctr_getiv.o src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o \
102 cfb_start.o cfb_encrypt.o cfb_decrypt.o cfb_getiv.o cfb_setiv.o \ 115 src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
103 ofb_start.o ofb_encrypt.o ofb_decrypt.o ofb_getiv.o ofb_setiv.o \ 116 src/modes/ecb/ecb_start.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
104 ctr_start.o ctr_encrypt.o ctr_decrypt.o ctr_getiv.o ctr_setiv.o \ 117 src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
105 ecb_start.o ecb_encrypt.o ecb_decrypt.o \ 118 src/modes/ofb/ofb_start.o src/pk/asn1/der/der_decode_integer.o src/pk/asn1/der/der_encode_integer.o \
106 \ 119 src/pk/asn1/der/der_get_multi_integer.o src/pk/asn1/der/der_length_integer.o \
107 hash_file.o hash_filehandle.o hash_memory.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 \
108 \ 121 src/pk/dsa/dsa_import.o src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_sign_hash.o \
109 hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.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 \
110 \ 123 src/pk/packet_valid_header.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
111 pkcs_1_mgf1.o pkcs_1_oaep_encode.o pkcs_1_oaep_decode.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 \
112 pkcs_1_pss_encode.o pkcs_1_pss_decode.o pkcs_1_i2osp.o pkcs_1_os2ip.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 \
113 pkcs_1_v15_es_encode.o pkcs_1_v15_es_decode.o pkcs_1_v15_sa_encode.o pkcs_1_v15_sa_decode.o \ 126 src/pk/pkcs1/pkcs_1_v15_es_encode.o src/pk/pkcs1/pkcs_1_v15_sa_decode.o \
114 \ 127 src/pk/pkcs1/pkcs_1_v15_sa_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
115 pkcs_5_1.o pkcs_5_2.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 \
116 \ 129 src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_sign_hash.o src/pk/rsa/rsa_v15_decrypt_key.o \
117 der_encode_integer.o der_decode_integer.o der_length_integer.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 \
118 der_put_multi_integer.o der_get_multi_integer.o \ 131 src/pk/rsa/rsa_verify_hash.o src/prngs/fortuna.o src/prngs/rc4.o src/prngs/rng_get_bytes.o \
119 \ 132 src/prngs/rng_make_prng.o src/prngs/sober128.o src/prngs/sprng.o src/prngs/yarrow.o
120 burn_stack.o zeromem.o \ 133
121 \ 134 HEADERS=src/headers/tommath_superclass.h src/headers/tomcrypt_cfg.h \
122 $(MPIOBJECT) 135 src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h \
136 src/headers/tomcrypt_custom.h src/headers/tomcrypt_argchk.h \
137 src/headers/tomcrypt_cipher.h src/headers/tomcrypt_pk.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
123 141
124 TESTOBJECTS=demos/test.o 142 TESTOBJECTS=demos/test.o
125 HASHOBJECTS=demos/hashsum.o 143 HASHOBJECTS=demos/hashsum.o
126 CRYPTOBJECTS=demos/encrypt.o 144 CRYPTOBJECTS=demos/encrypt.o
127 SMALLOBJECTS=demos/small.o 145 SMALLOBJECTS=demos/small.o
128 PROFS=demos/x86_prof.o
129 TVS=demos/tv_gen.o 146 TVS=demos/tv_gen.o
147 MULTIS=demos/multi.o
148 TIMINGS=demos/timing.o
149 TESTS=demos/test.o
130 150
131 #Files left over from making the crypt.pdf. 151 #Files left over from making the crypt.pdf.
132 LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out 152 LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
133 153
134 #Compressed filenames 154 #Compressed filenames
135 COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip 155 COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip
136 156
137 #Header files used by libtomcrypt.
138 HEADERS=ltc_tommath.h mycrypt_cfg.h \
139 mycrypt_misc.h mycrypt_prng.h mycrypt_cipher.h mycrypt_hash.h \
140 mycrypt_macros.h mycrypt_pk.h mycrypt.h mycrypt_argchk.h \
141 mycrypt_custom.h mycrypt_pkcs.h tommath_class.h tommath_superclass.h
142
143 #The default rule for make builds the libtomcrypt library. 157 #The default rule for make builds the libtomcrypt library.
144 default:library 158 default:library
145 159
146 #ciphers come in two flavours... enc+dec and enc 160 #ciphers come in two flavours... enc+dec and enc
147 aes_enc.o: aes.c aes_tab.c 161 src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
148 $(CC) $(CFLAGS) -DENCRYPT_ONLY -c aes.c -o aes_enc.o 162 $(CC) $(CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
149 163
150 #These are the rules to make certain object files. 164 #These are the rules to make certain object files.
151 aes.o: aes.c aes_tab.c 165 src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
152 twofish.o: twofish.c twofish_tab.c 166 src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
153 whirl.o: whirl.c whirltab.c 167 src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
154 ecc.o: ecc.c ecc_sys.c 168 src/pk/ecc/ecc.o: src/pk/ecc/ecc.c src/pk/ecc/ecc_sys.c
155 dh.o: dh.c dh_sys.c 169 src/pk/dh/dh.o: src/pk/dh/dh.c src/pk/dh/dh_sys.c
156 sha512.o: sha512.c sha384.c 170 src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
157 sha256.o: sha256.c sha224.c 171 src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
158 172
159 #This rule makes the libtomcrypt library. 173 #This rule makes the libtomcrypt library.
160 library: $(LIBNAME) 174 library: $(LIBTEST) $(LIBNAME)
175
176 $(LIBTEST):
177 cd testprof ; CFLAGS="$(CFLAGS)" make
161 178
162 $(LIBNAME): $(OBJECTS) 179 $(LIBNAME): $(OBJECTS)
163 $(AR) $(ARFLAGS) $@ $(OBJECTS) 180 $(AR) $(ARFLAGS) $@ $(OBJECTS)
181 ranlib $(LIBNAME)
164 182
165 #This rule makes the hash program included with libtomcrypt 183 #This rule makes the hash program included with libtomcrypt
166 hashsum: library $(HASHOBJECTS) 184 hashsum: library $(HASHOBJECTS)
167 $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN) 185 $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN)
168 186
172 190
173 #makes the small program 191 #makes the small program
174 small: library $(SMALLOBJECTS) 192 small: library $(SMALLOBJECTS)
175 $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN) 193 $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN)
176 194
177 x86_prof: library $(PROFS)
178 $(CC) $(PROFS) $(LIBNAME) $(EXTRALIBS) -o $(PROF)
179
180 tv_gen: library $(TVS) 195 tv_gen: library $(TVS)
181 $(CC) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV) 196 $(CC) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV)
197
198 multi: library $(MULTIS)
199 $(CC) $(MULTIS) $(LIBNAME) -o $(MULTI)
200
201 timing: library $(TIMINGS)
202 $(CC) $(TIMINGS) $(LIBTEST) $(LIBNAME) -o $(TIMING)
203
204 test: library $(TESTS)
205 $(CC) $(TESTS) $(LIBTEST) $(LIBNAME) -o $(TEST)
206
182 207
183 #This rule installs the library and the header files. This must be run 208 #This rule installs the library and the header files. This must be run
184 #as root in order to have a high enough permission to write to the correct 209 #as root in order to have a high enough permission to write to the correct
185 #directories and to set the owner and group to root. 210 #directories and to set the owner and group to root.
186 install: library docs 211 install: library docs
187 install -d -g root -o root $(DESTDIR)$(LIBPATH) 212 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
188 install -d -g root -o root $(DESTDIR)$(INCPATH) 213 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
189 install -d -g root -o root $(DESTDIR)$(DATAPATH) 214 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(DATAPATH)
190 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH) 215 install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
191 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH) 216 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
192 install -g root -o root doc/crypt.pdf $(DESTDIR)$(DATAPATH) 217 install -g $(GROUP) -o $(USER) doc/crypt.pdf $(DESTDIR)$(DATAPATH)
193 218
194 install_lib: library 219 install_lib: library
195 install -d -g root -o root $(DESTDIR)$(LIBPATH) 220 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
196 install -d -g root -o root $(DESTDIR)$(INCPATH) 221 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
197 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH) 222 install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
198 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH) 223 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
199 224
200 #This rule cleans the source tree of all compiled code, not including the pdf 225 #This rule cleans the source tree of all compiled code, not including the pdf
201 #documentation. 226 #documentation.
202 clean: 227 clean:
203 rm -f $(OBJECTS) $(TESTOBJECTS) $(HASHOBJECTS) $(CRYPTOBJECTS) $(SMALLOBJECTS) $(LEFTOVERS) $(LIBNAME) 228 rm -f `find . -type f | grep "[.]o" | xargs`
204 rm -f $(TEST) $(HASH) $(COMPRESSED) $(PROFS) $(PROF) $(TVS) $(TV) 229 rm -f `find . -type f | grep "[.]lo" | xargs`
205 rm -f *.la *.lo *.o *.a *.dll *stackdump *.lib *.exe *.obj demos/*.obj demos/*.o *.bat *.txt *.il *.da demos/*.il demos/*.da *.dyn *.dpi \ 230 rm -f `find . -type f | grep "[.]a" | xargs`
206 *.gcda *.gcno demos/*.gcno demos/*.gcda *~ doc/* 231 rm -f `find . -type f | grep "[.]la" | xargs`
207 cd demos/test ; make clean 232 rm -f `find . -type f | grep "[.]obj" | xargs`
208 rm -rf .libs demos/.libs demos/test/.libs 233 rm -f `find . -type f | grep "[.]lib" | xargs`
234 rm -f `find . -type f | grep "[.]exe" | xargs`
235 rm -f `find . -type f | grep "[.]gcda" | xargs`
236 rm -f `find . -type f | grep "[.]gcno" | xargs`
237 rm -f `find . -type f | grep "[.]il" | xargs`
238 rm -f `find . -type f | grep "[.]dyn" | xargs`
239 rm -f `find . -type f | grep "[.]dpi" | xargs`
240 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
242 rm -f $(TV) $(PROF) $(SMALL) $(CRYPT) $(HASHSUM) $(MULTI) $(TIMING) $(TEST)
243 rm -rf doc/doxygen
244 rm -f doc/*.pdf
245
246 #build the doxy files (requires Doxygen, tetex and patience)
247 doxy:
248 doxygen
249 cd doc/doxygen/latex ; make ; mv -f refman.pdf ../../.
250 echo The huge doxygen PDF should be available as doc/refman.pdf
209 251
210 #This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed 252 #This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed
211 #from the clean command! This is because most people would like to keep the 253 #from the clean command! This is because most people would like to keep the
212 #nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to 254 #nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to
213 #delete it if we are rebuilding it. 255 #delete it if we are rebuilding it.
227 latex crypt > /dev/null 269 latex crypt > /dev/null
228 latex crypt > /dev/null 270 latex crypt > /dev/null
229 makeindex crypt.idx 271 makeindex crypt.idx
230 latex crypt > /dev/null 272 latex crypt > /dev/null
231 273
232 #pretty build
233 pretty:
234 perl pretty.build
235
236 #for GCC 3.4+
237 profiled:
238 make clean
239 make CFLAGS="$(CFLAGS) -fprofile-generate" EXTRALIBS=-lgcov x86_prof
240 ./x86_prof
241 rm *.o *.a x86_prof
242 make CFLAGS="$(CFLAGS) -fprofile-use" EXTRALIBS=-lgcov x86_prof
243
244 #zipup the project (take that!) 274 #zipup the project (take that!)
245 zipup: clean docs 275 no_oops: clean
276 cd .. ; cvs commit
277
278 zipup: no_oops docs
246 cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \ 279 cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \
247 cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; tar -c libtomcrypt-$(VERSION)/* > crypt-$(VERSION).tar ; \ 280 cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; \
248 bzip2 -9vv crypt-$(VERSION).tar ; zip -9 -r crypt-$(VERSION).zip libtomcrypt-$(VERSION)/* ; \ 281 cd libtomcrypt-$(VERSION) ; rm -rf `find . -type d | grep CVS | xargs` ; cd .. ; \
249 gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip 282 tar -cjvf crypt-$(VERSION).tar.bz2 libtomcrypt-$(VERSION) ; \
283 zip -9r crypt-$(VERSION).zip libtomcrypt-$(VERSION) ; \
284 gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip ; \
285 mv -fv crypt* ~ ; rm -rf libtomcrypt-$(VERSION)