blob: 37e1aacc3e29fc7ce1c9bfac23dbfab41bda6385 [file] [log] [blame]
Paul Bakker0049c2f2009-07-11 19:15:43 +00001
2# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
Paul Bakker62f88dc2012-05-10 21:26:28 +00003# To compile on MinGW: add "-lws2_32" to LDFLAGS or define WINDOWS in your env
Paul Bakker43b7e352011-01-18 15:27:19 +00004# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
Paul Bakker0049c2f2009-07-11 19:15:43 +00005
Paul Bakker46eb1382011-01-30 17:10:13 +00006CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement \
Paul Bakker0049c2f2009-07-11 19:15:43 +00007 -Wno-unused-function -Wno-unused-value
8
Paul Bakkerf1ab0ec2012-10-23 12:12:53 +00009OFLAGS = -O2
Paul Bakkera585beb2011-06-21 08:59:44 +000010LDFLAGS += -L../library -lpolarssl $(SYS_LDFLAGS)
Paul Bakker0049c2f2009-07-11 19:15:43 +000011
Paul Bakker674e0b02014-03-26 13:26:52 +010012ifndef SHARED
13DEP=../library/libpolarssl.a
14CHECK_PRELOAD=
15else
16DEP=../library/libpolarssl.so
17CHECK_PRELOAD= LD_PRELOAD=../library/libpolarssl.so
18endif
19
Paul Bakkerc7ffd362012-04-05 12:08:29 +000020ifdef DEBUG
21CFLAGS += -g3
22endif
23
Paul Bakkercd5b5292012-05-10 20:49:10 +000024ifdef WINDOWS
25LDFLAGS += -lws2_32
26endif
27
Paul Bakker2770fbd2012-07-03 13:30:23 +000028# Zlib shared library extensions:
29ifdef ZLIB
30LDFLAGS += -lz
31endif
32
Paul Bakker286bf3c2013-04-08 18:09:51 +020033APPS = test_suite_aes.ecb test_suite_aes.cbc \
34 test_suite_aes.cfb test_suite_aes.rest \
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +020035 test_suite_arc4 test_suite_asn1write \
Paul Bakkera9379c02012-07-04 11:02:11 +000036 test_suite_base64 test_suite_blowfish \
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +020037 test_suite_camellia test_suite_ccm \
38 test_suite_cipher.aes \
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +020039 test_suite_cipher.arc4 test_suite_cipher.ccm \
40 test_suite_cipher.gcm \
Paul Bakker6132d0a2012-07-04 17:10:40 +000041 test_suite_cipher.blowfish \
42 test_suite_cipher.camellia \
Paul Bakkerfab5c822012-02-06 16:45:10 +000043 test_suite_cipher.des test_suite_cipher.null \
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +020044 test_suite_cipher.padding \
Paul Bakkerfab5c822012-02-06 16:45:10 +000045 test_suite_ctr_drbg test_suite_debug \
Paul Bakker9d781402011-05-09 16:17:09 +000046 test_suite_des test_suite_dhm \
Paul Bakkerd589a0d2013-03-13 16:30:17 +010047 test_suite_ecdh test_suite_ecdsa \
Paul Bakkera95919b2013-01-16 17:00:05 +010048 test_suite_ecp \
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +020049 test_suite_error test_suite_entropy \
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +020050 test_suite_gcm.aes128_de \
51 test_suite_gcm.aes192_de \
52 test_suite_gcm.aes256_de \
53 test_suite_gcm.aes128_en \
54 test_suite_gcm.aes192_en \
55 test_suite_gcm.aes256_en \
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +020056 test_suite_gcm.camellia test_suite_hmac_shax \
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +010057 test_suite_hmac_drbg.misc \
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +010058 test_suite_hmac_drbg.no_reseed \
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +010059 test_suite_hmac_drbg.nopr \
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +010060 test_suite_hmac_drbg.pr \
Paul Bakker9d781402011-05-09 16:17:09 +000061 test_suite_md test_suite_mdx \
Manuel Pégourié-Gonnard765bb312014-11-27 11:55:27 +010062 test_suite_memory_buffer_alloc \
Paul Bakkerf518b162012-08-23 13:03:18 +000063 test_suite_mpi test_suite_pbkdf2 \
Paul Bakker16300582014-04-11 13:28:43 +020064 test_suite_pem \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020065 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020066 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020067 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000068 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000069 test_suite_x509parse test_suite_x509write \
70 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000071
72.SILENT:
73
74all: $(APPS)
75
Paul Bakker19343182013-08-16 13:31:10 +020076test_suite_aes.ecb.c : suites/test_suite_aes.function suites/test_suite_aes.ecb.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +020077 echo " Generate $@"
78 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
79
Paul Bakker19343182013-08-16 13:31:10 +020080test_suite_aes.cbc.c : suites/test_suite_aes.function suites/test_suite_aes.cbc.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +020081 echo " Generate $@"
82 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
83
Paul Bakker19343182013-08-16 13:31:10 +020084test_suite_aes.cfb.c : suites/test_suite_aes.function suites/test_suite_aes.cfb.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +020085 echo " Generate $@"
86 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
87
Paul Bakker19343182013-08-16 13:31:10 +020088test_suite_aes.rest.c : suites/test_suite_aes.function suites/test_suite_aes.rest.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +020089 echo " Generate $@"
90 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
91
Paul Bakker19343182013-08-16 13:31:10 +020092test_suite_cipher.aes.c : suites/test_suite_cipher.function suites/test_suite_cipher.aes.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker46c17942011-07-13 14:54:54 +000093 echo " Generate $@"
94 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
95
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020096test_suite_cipher.arc4.c : suites/test_suite_cipher.function suites/test_suite_cipher.arc4.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
97 echo " Generate $@"
98 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
99
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200100test_suite_cipher.ccm.c : suites/test_suite_cipher.function suites/test_suite_cipher.ccm.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
101 echo " Generate $@"
102 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.ccm
103
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200104test_suite_cipher.gcm.c : suites/test_suite_cipher.function suites/test_suite_cipher.gcm.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
105 echo " Generate $@"
106 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
107
Paul Bakker19343182013-08-16 13:31:10 +0200108test_suite_cipher.blowfish.c : suites/test_suite_cipher.function suites/test_suite_cipher.blowfish.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker6132d0a2012-07-04 17:10:40 +0000109 echo " Generate $@"
110 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
111
Paul Bakker19343182013-08-16 13:31:10 +0200112test_suite_cipher.camellia.c : suites/test_suite_cipher.function suites/test_suite_cipher.camellia.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker46c17942011-07-13 14:54:54 +0000113 echo " Generate $@"
114 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
115
Paul Bakker19343182013-08-16 13:31:10 +0200116test_suite_cipher.des.c : suites/test_suite_cipher.function suites/test_suite_cipher.des.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker46c17942011-07-13 14:54:54 +0000117 echo " Generate $@"
118 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
119
Paul Bakker19343182013-08-16 13:31:10 +0200120test_suite_cipher.null.c : suites/test_suite_cipher.function suites/test_suite_cipher.null.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakkerfab5c822012-02-06 16:45:10 +0000121 echo " Generate $@"
122 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
123
Paul Bakker19343182013-08-16 13:31:10 +0200124test_suite_cipher.padding.c : suites/test_suite_cipher.function suites/test_suite_cipher.padding.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200125 echo " Generate $@"
126 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
127
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200128test_suite_gcm.aes128_de.c : suites/test_suite_gcm.function suites/test_suite_gcm.aes128_de.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker89e80c92012-03-20 13:50:09 +0000129 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200130 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000131
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200132test_suite_gcm.aes192_de.c : suites/test_suite_gcm.function suites/test_suite_gcm.aes192_de.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker89e80c92012-03-20 13:50:09 +0000133 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200134 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200135
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200136test_suite_gcm.aes256_de.c : suites/test_suite_gcm.function suites/test_suite_gcm.aes256_de.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200137 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200138 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200139
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200140test_suite_gcm.aes128_en.c : suites/test_suite_gcm.function suites/test_suite_gcm.aes128_en.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200141 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200142 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200143
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200144test_suite_gcm.aes192_en.c : suites/test_suite_gcm.function suites/test_suite_gcm.aes192_en.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200145 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200146 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200147
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200148test_suite_gcm.aes256_en.c : suites/test_suite_gcm.function suites/test_suite_gcm.aes256_en.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200149 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200150 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000151
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200152test_suite_gcm.camellia.c : suites/test_suite_gcm.function suites/test_suite_gcm.camellia.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
153 echo " Generate $@"
154 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000155
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100156test_suite_hmac_drbg.misc.c : suites/test_suite_hmac_drbg.function suites/test_suite_hmac_drbg.misc.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
157 echo " Generate $@"
158 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
159
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100160test_suite_hmac_drbg.no_reseed.c : suites/test_suite_hmac_drbg.function suites/test_suite_hmac_drbg.no_reseed.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
161 echo " Generate $@"
162 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
163
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100164test_suite_hmac_drbg.nopr.c : suites/test_suite_hmac_drbg.function suites/test_suite_hmac_drbg.nopr.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
165 echo " Generate $@"
166 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
167
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100168test_suite_hmac_drbg.pr.c : suites/test_suite_hmac_drbg.function suites/test_suite_hmac_drbg.pr.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
169 echo " Generate $@"
170 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
171
Paul Bakker19343182013-08-16 13:31:10 +0200172%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000173 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000174 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000175
Paul Bakker674e0b02014-03-26 13:26:52 +0100176test_suite_aes.ecb: test_suite_aes.ecb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200177 echo " CC $@.c"
178 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
179
Paul Bakker674e0b02014-03-26 13:26:52 +0100180test_suite_aes.cbc: test_suite_aes.cbc.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200181 echo " CC $@.c"
182 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
183
Paul Bakker674e0b02014-03-26 13:26:52 +0100184test_suite_aes.cfb: test_suite_aes.cfb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200185 echo " CC $@.c"
186 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
187
Paul Bakker674e0b02014-03-26 13:26:52 +0100188test_suite_aes.rest: test_suite_aes.rest.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000189 echo " CC $@.c"
190 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
191
Paul Bakker674e0b02014-03-26 13:26:52 +0100192test_suite_arc4: test_suite_arc4.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000193 echo " CC $@.c"
194 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
195
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +0200196test_suite_asn1write: test_suite_asn1write.c $(DEP)
197 echo " CC $@.c"
198 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
199
Paul Bakker674e0b02014-03-26 13:26:52 +0100200test_suite_base64: test_suite_base64.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000201 echo " CC $@.c"
202 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
203
Paul Bakker674e0b02014-03-26 13:26:52 +0100204test_suite_blowfish: test_suite_blowfish.c $(DEP)
Paul Bakkera9379c02012-07-04 11:02:11 +0000205 echo " CC $@.c"
206 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
207
Paul Bakker674e0b02014-03-26 13:26:52 +0100208test_suite_camellia: test_suite_camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000209 echo " CC $@.c"
210 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
211
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +0200212test_suite_ccm: test_suite_ccm.c $(DEP)
213 echo " CC $@.c"
214 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
215
Paul Bakker674e0b02014-03-26 13:26:52 +0100216test_suite_cipher.aes: test_suite_cipher.aes.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000217 echo " CC $@.c"
218 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
219
Paul Bakker674e0b02014-03-26 13:26:52 +0100220test_suite_cipher.arc4: test_suite_cipher.arc4.c $(DEP)
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200221 echo " CC $@.c"
222 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
223
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200224test_suite_cipher.ccm: test_suite_cipher.ccm.c $(DEP)
225 echo " CC $@.c"
226 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
227
Paul Bakker674e0b02014-03-26 13:26:52 +0100228test_suite_cipher.gcm: test_suite_cipher.gcm.c $(DEP)
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200229 echo " CC $@.c"
230 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
231
Paul Bakker674e0b02014-03-26 13:26:52 +0100232test_suite_cipher.blowfish: test_suite_cipher.blowfish.c $(DEP)
Paul Bakker6132d0a2012-07-04 17:10:40 +0000233 echo " CC $@.c"
234 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
235
Paul Bakker674e0b02014-03-26 13:26:52 +0100236test_suite_cipher.camellia: test_suite_cipher.camellia.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000237 echo " CC $@.c"
238 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
239
Paul Bakker674e0b02014-03-26 13:26:52 +0100240test_suite_cipher.des: test_suite_cipher.des.c $(DEP)
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000241 echo " CC $@.c"
242 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
243
Paul Bakker674e0b02014-03-26 13:26:52 +0100244test_suite_cipher.null: test_suite_cipher.null.c $(DEP)
Paul Bakkerfab5c822012-02-06 16:45:10 +0000245 echo " CC $@.c"
246 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
247
Paul Bakker674e0b02014-03-26 13:26:52 +0100248test_suite_cipher.padding: test_suite_cipher.padding.c $(DEP)
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200249 echo " CC $@.c"
250 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
251
Paul Bakker674e0b02014-03-26 13:26:52 +0100252test_suite_ctr_drbg: test_suite_ctr_drbg.c $(DEP)
Paul Bakker8123e9d2011-01-06 15:37:30 +0000253 echo " CC $@.c"
254 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
255
Paul Bakker674e0b02014-03-26 13:26:52 +0100256test_suite_des: test_suite_des.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000257 echo " CC $@.c"
258 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
259
Paul Bakker674e0b02014-03-26 13:26:52 +0100260test_suite_dhm: test_suite_dhm.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000261 echo " CC $@.c"
262 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
263
Paul Bakker674e0b02014-03-26 13:26:52 +0100264test_suite_ecdh: test_suite_ecdh.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100265 echo " CC $@.c"
266 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
267
Paul Bakker674e0b02014-03-26 13:26:52 +0100268test_suite_ecdsa: test_suite_ecdsa.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100269 echo " CC $@.c"
270 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
271
Paul Bakker674e0b02014-03-26 13:26:52 +0100272test_suite_ecp: test_suite_ecp.c $(DEP)
Paul Bakkera95919b2013-01-16 17:00:05 +0100273 echo " CC $@.c"
274 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
275
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200276test_suite_entropy: test_suite_entropy.c $(DEP)
277 echo " CC $@.c"
278 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
279
Paul Bakker674e0b02014-03-26 13:26:52 +0100280test_suite_error: test_suite_error.c $(DEP)
Paul Bakker9d781402011-05-09 16:17:09 +0000281 echo " CC $@.c"
282 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
283
Paul Bakker674e0b02014-03-26 13:26:52 +0100284test_suite_gcm.aes128_de: test_suite_gcm.aes128_de.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000285 echo " CC $@.c"
286 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
287
Paul Bakker674e0b02014-03-26 13:26:52 +0100288test_suite_gcm.aes192_de: test_suite_gcm.aes192_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200289 echo " CC $@.c"
290 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
291
Paul Bakker674e0b02014-03-26 13:26:52 +0100292test_suite_gcm.aes256_de: test_suite_gcm.aes256_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200293 echo " CC $@.c"
294 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
295
Paul Bakker674e0b02014-03-26 13:26:52 +0100296test_suite_gcm.aes128_en: test_suite_gcm.aes128_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200297 echo " CC $@.c"
298 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
299
Paul Bakker674e0b02014-03-26 13:26:52 +0100300test_suite_gcm.aes192_en: test_suite_gcm.aes192_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200301 echo " CC $@.c"
302 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
303
Paul Bakker674e0b02014-03-26 13:26:52 +0100304test_suite_gcm.aes256_en: test_suite_gcm.aes256_en.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000305 echo " CC $@.c"
306 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
307
Paul Bakker674e0b02014-03-26 13:26:52 +0100308test_suite_gcm.camellia: test_suite_gcm.camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000309 echo " CC $@.c"
310 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000311
Paul Bakker674e0b02014-03-26 13:26:52 +0100312test_suite_hmac_drbg.misc: test_suite_hmac_drbg.misc.c $(DEP)
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100313 echo " CC $@.c"
314 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
315
Paul Bakker674e0b02014-03-26 13:26:52 +0100316test_suite_hmac_drbg.no_reseed: test_suite_hmac_drbg.no_reseed.c $(DEP)
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100317 echo " CC $@.c"
318 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
319
Paul Bakker674e0b02014-03-26 13:26:52 +0100320test_suite_hmac_drbg.nopr: test_suite_hmac_drbg.nopr.c $(DEP)
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100321 echo " CC $@.c"
322 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
323
Paul Bakker674e0b02014-03-26 13:26:52 +0100324test_suite_hmac_drbg.pr: test_suite_hmac_drbg.pr.c $(DEP)
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100325 echo " CC $@.c"
326 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
327
Paul Bakker674e0b02014-03-26 13:26:52 +0100328test_suite_hmac_shax: test_suite_hmac_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000329 echo " CC $@.c"
330 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
331
Paul Bakker674e0b02014-03-26 13:26:52 +0100332test_suite_md: test_suite_md.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000333 echo " CC $@.c"
334 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
335
Paul Bakker674e0b02014-03-26 13:26:52 +0100336test_suite_mdx: test_suite_mdx.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000337 echo " CC $@.c"
338 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
339
Manuel Pégourié-Gonnard765bb312014-11-27 11:55:27 +0100340test_suite_memory_buffer_alloc: test_suite_memory_buffer_alloc.c $(DEP)
341 echo " CC $@.c"
342 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
343
Paul Bakker674e0b02014-03-26 13:26:52 +0100344test_suite_mpi: test_suite_mpi.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000345 echo " CC $@.c"
346 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
347
Paul Bakker674e0b02014-03-26 13:26:52 +0100348test_suite_pbkdf2: test_suite_pbkdf2.c $(DEP)
Paul Bakkerf518b162012-08-23 13:03:18 +0000349 echo " CC $@.c"
350 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
351
Paul Bakker16300582014-04-11 13:28:43 +0200352test_suite_pem: test_suite_pem.c $(DEP)
353 echo " CC $@.c"
354 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
355
Paul Bakker674e0b02014-03-26 13:26:52 +0100356test_suite_pkcs1_v21: test_suite_pkcs1_v21.c $(DEP)
Paul Bakker9dcc3222011-03-08 14:16:06 +0000357 echo " CC $@.c"
358 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
359
Paul Bakker674e0b02014-03-26 13:26:52 +0100360test_suite_pkcs5: test_suite_pkcs5.c $(DEP)
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200361 echo " CC $@.c"
362 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
363
Paul Bakker674e0b02014-03-26 13:26:52 +0100364test_suite_pkparse: test_suite_pkparse.c $(DEP)
Paul Bakker1a7550a2013-09-15 13:01:22 +0200365 echo " CC $@.c"
366 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
367
Paul Bakker674e0b02014-03-26 13:26:52 +0100368test_suite_pkwrite: test_suite_pkwrite.c $(DEP)
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200369 echo " CC $@.c"
370 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
371
Paul Bakker674e0b02014-03-26 13:26:52 +0100372test_suite_pk: test_suite_pk.c $(DEP)
Paul Bakker32925622013-10-28 17:32:48 +0100373 echo " CC $@.c"
374 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
375
Paul Bakker674e0b02014-03-26 13:26:52 +0100376test_suite_rsa: test_suite_rsa.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000377 echo " CC $@.c"
378 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
379
Paul Bakker674e0b02014-03-26 13:26:52 +0100380test_suite_shax: test_suite_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000381 echo " CC $@.c"
382 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
383
Paul Bakker674e0b02014-03-26 13:26:52 +0100384test_suite_x509parse: test_suite_x509parse.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000385 echo " CC $@.c"
386 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
387
Paul Bakker674e0b02014-03-26 13:26:52 +0100388test_suite_x509write: test_suite_x509write.c $(DEP)
Paul Bakker6d620502012-02-16 14:09:13 +0000389 echo " CC $@.c"
390 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
391
Paul Bakker674e0b02014-03-26 13:26:52 +0100392test_suite_xtea: test_suite_xtea.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000393 echo " CC $@.c"
394 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
395
Paul Bakker674e0b02014-03-26 13:26:52 +0100396test_suite_debug: test_suite_debug.c $(DEP)
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000397 echo " CC $@.c"
398 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
399
Paul Bakker674e0b02014-03-26 13:26:52 +0100400test_suite_version: test_suite_version.c $(DEP)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000401 echo " CC $@.c"
402 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
403
Paul Bakker0049c2f2009-07-11 19:15:43 +0000404clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000405ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000406 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000407endif
408ifdef WINDOWS
409 del /Q /F *.c *.exe
410endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000411
Paul Bakker9794cb42009-07-28 18:55:00 +0000412check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000413ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100414 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000415 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000416 for i in $(APPS); \
417 do \
418 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100419 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000420 FAILED=`echo $$RESULT |grep FAILED`; \
421 echo " $$RESULT"; \
422 if [ "$$FAILED" != "" ]; \
423 then \
424 echo "**** Failed ***************"; \
425 RETURN=1; \
426 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000427 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000428 done; \
429 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000430endif