comparison makefile.icc @ 3:7faae8f46238 libtomcrypt-orig

Branch renaming
author Matt Johnston <matt@ucc.asn.au>
date Mon, 31 May 2004 18:25:41 +0000
parents
children 6362d3854bb4
comparison
equal deleted inserted replaced
-1:000000000000 3:7faae8f46238
1 # MAKEFILE for linux ICC (Intel C compiler)
2 #
3 # Tested with ICC v8....
4 #
5 # Be aware that ICC isn't quite as stable as GCC and several optimization switches
6 # seem to break the code (that GCC and MSVC compile just fine). In particular
7 # "-ip" and "-x*" seem to break the code (ROL/ROR macro problems). As the makefile
8 # is shipped the code will build and execute properly.
9 #
10 # Also note that ICC often makes code that is slower than GCC. This is probably due to
11 # a mix of not being able to use "-ip" and just having fewer optimization algos than GCC.
12 #
13 # Tom St Denis
14
15 #ch1-01-1
16 # Compiler and Linker Names
17 CC=icc
18 #LD=ld
19
20 # Archiver [makes .a files]
21 #AR=ar
22 #ARFLAGS=r
23
24 # Compilation flags. Note the += does not write over the user's CFLAGS!
25 CFLAGS += -c -I./ -DINTEL_CC
26
27 # optimize for SPEED
28 #
29 # -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
30 # -ax? specifies make code specifically for ? but compatible with IA-32
31 # -x? specifies compile solely for ? [not specifically IA-32 compatible]
32 #
33 # where ? is
34 # K - PIII
35 # W - first P4 [Williamette]
36 # N - P4 Northwood
37 # P - P4 Prescott
38 # B - Blend of P4 and PM [mobile]
39 #
40 # Default to just generic max opts
41 CFLAGS += -O3 -xN -ip
42
43 # want to see stuff?
44 #CFLAGS += -opt_report
45
46 #These flags control how the library gets built.
47
48 #Output filenames for various targets.
49 LIBNAME=libtomcrypt.a
50 TEST=test
51 HASH=hashsum
52 CRYPT=encrypt
53 SMALL=small
54 PROF=x86_prof
55 TV=tv_gen
56
57 #LIBPATH-The directory for libtomcrypt to be installed to.
58 #INCPATH-The directory to install the header files for libtomcrypt.
59 #DATAPATH-The directory to install the pdf docs.
60 DESTDIR=
61 LIBPATH=/usr/lib
62 INCPATH=/usr/include
63 DATAPATH=/usr/share/doc/libtomcrypt/pdf
64
65 #List of objects to compile.
66
67 #Leave MPI built-in or force developer to link against libtommath?
68 MPIOBJECT=mpi.o
69
70 OBJECTS=keyring.o gf.o strings.o base64.o \
71 \
72 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 \
74 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 \
76 crypt_find_cipher_id.o crypt_find_prng.o crypt_prng_is_valid.o \
77 crypt_unregister_cipher.o crypt_cipher_is_valid.o crypt_find_hash.o \
78 crypt_hash_descriptor.o crypt_register_cipher.o crypt_unregister_hash.o \
79 \
80 sprng.o yarrow.o rc4.o rng_get_bytes.o rng_make_prng.o \
81 \
82 rand_prime.o is_prime.o \
83 \
84 ecc.o dh.o \
85 \
86 rsa.o rsa_exptmod.o rsa_free.o rsa_make_key.o \
87 \
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 \
89 \
90 xtea.o aes.o des.o safer_tab.o safer.o saferp.o rc2.o \
91 rc6.o rc5.o cast5.o noekeon.o blowfish.o twofish.o skipjack.o \
92 \
93 md2.o md4.o md5.o sha1.o sha256.o sha512.o tiger.o whirl.o \
94 rmd128.o rmd160.o \
95 \
96 packet_store_header.o packet_valid_header.o \
97 \
98 eax_addheader.o eax_decrypt.o eax_decrypt_verify_memory.o eax_done.o eax_encrypt.o \
99 eax_encrypt_authenticate_memory.o eax_init.o eax_test.o \
100 \
101 ocb_decrypt.o ocb_decrypt_verify_memory.o ocb_done_decrypt.o ocb_done_encrypt.o \
102 ocb_encrypt.o ocb_encrypt_authenticate_memory.o ocb_init.o ocb_ntz.o \
103 ocb_shift_xor.o ocb_test.o s_ocb_done.o \
104 \
105 omac_done.o omac_file.o omac_init.o omac_memory.o omac_process.o omac_test.o \
106 \
107 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 \
109 \
110 cbc_start.o cbc_encrypt.o cbc_decrypt.o \
111 cfb_start.o cfb_encrypt.o cfb_decrypt.o \
112 ofb_start.o ofb_encrypt.o ofb_decrypt.o \
113 ctr_start.o ctr_encrypt.o ctr_decrypt.o \
114 ecb_start.o ecb_encrypt.o ecb_decrypt.o \
115 \
116 hash_file.o hash_filehandle.o hash_memory.o \
117 \
118 hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \
119 \
120 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 \
122 \
123 pkcs_5_1.o pkcs_5_2.o \
124 \
125 burn_stack.o zeromem.o \
126 $(MPIOBJECT)
127
128 TESTOBJECTS=demos/test.o
129 HASHOBJECTS=demos/hashsum.o
130 CRYPTOBJECTS=demos/encrypt.o
131 SMALLOBJECTS=demos/small.o
132 PROFS=demos/x86_prof.o
133 TVS=demos/tv_gen.o
134
135 #Files left over from making the crypt.pdf.
136 LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind
137
138 #Compressed filenames
139 COMPRESSED=crypt.tar.bz2 crypt.zip crypt.tar.gz
140
141 #Header files used by libtomcrypt.
142 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 \
144 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
149 #These are the rules to make certain object files.
150 rsa.o: rsa.c rsa_sys.c
151 ecc.o: ecc.c ecc_sys.c
152 dh.o: dh.c dh_sys.c
153 aes.o: aes.c aes_tab.c
154 twofish.o: twofish.c twofish_tab.c
155 sha512.o: sha512.c sha384.c
156 sha256.o: sha256.c sha224.c
157
158 #This rule makes the libtomcrypt library.
159 library: $(LIBNAME)
160
161 $(LIBNAME): $(OBJECTS)
162 $(AR) $(ARFLAGS) $@ $(OBJECTS)
163
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
169 hashsum: library $(HASHOBJECTS)
170 $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN)
171
172 #makes the crypt program
173 crypt: library $(CRYPTOBJECTS)
174 $(CC) $(CRYPTOBJECTS) $(LIBNAME) -o $(CRYPT) $(WARN)
175
176 #makes the small program
177 small: library $(SMALLOBJECTS)
178 $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN)
179
180 x86_prof: library $(PROFS)
181 $(CC) $(PROFS) $(LIBNAME) -o $(PROF)
182
183 tv_gen: library $(TVS)
184 $(CC) $(TVS) $(LIBNAME) -o $(TV)
185
186
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
200 #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.
202 install: library
203 install -d -g root -o root $(DESTDIR)$(LIBPATH)
204 install -d -g root -o root $(DESTDIR)$(INCPATH)
205 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
206 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
207
208 #This rule cleans the source tree of all compiled code, not including the pdf
209 #documentation.
210 clean:
211 rm -f $(OBJECTS) $(TESTOBJECTS) $(HASHOBJECTS) $(CRYPTOBJECTS) $(SMALLOBJECTS) $(LEFTOVERS) $(LIBNAME)
212 rm -f $(TEST) $(HASH) $(COMPRESSED) $(PROFS) $(PROF) $(TVS) $(TV)
213 rm -f *.a *.dll *stackdump *.lib *.exe *.obj demos/*.obj demos/*.o *.bat *.txt *.il *.da demos/*.il demos/*.da *.dyn