blob: a0d136a0a2009d920d572f6572f2da41bf4e9d8a [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 \
35 test_suite_arc4 \
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é-Gonnard07f8fa52013-08-30 18:34:08 +020039 test_suite_cipher.arc4 test_suite_cipher.gcm \
Paul Bakker6132d0a2012-07-04 17:10:40 +000040 test_suite_cipher.blowfish \
41 test_suite_cipher.camellia \
Paul Bakkerfab5c822012-02-06 16:45:10 +000042 test_suite_cipher.des test_suite_cipher.null \
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +020043 test_suite_cipher.padding \
Paul Bakkerfab5c822012-02-06 16:45:10 +000044 test_suite_ctr_drbg test_suite_debug \
Paul Bakker9d781402011-05-09 16:17:09 +000045 test_suite_des test_suite_dhm \
Paul Bakkerd589a0d2013-03-13 16:30:17 +010046 test_suite_ecdh test_suite_ecdsa \
Paul Bakkera95919b2013-01-16 17:00:05 +010047 test_suite_ecp \
Paul Bakker286bf3c2013-04-08 18:09:51 +020048 test_suite_error \
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +020049 test_suite_gcm.aes128_de \
50 test_suite_gcm.aes192_de \
51 test_suite_gcm.aes256_de \
52 test_suite_gcm.aes128_en \
53 test_suite_gcm.aes192_en \
54 test_suite_gcm.aes256_en \
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +020055 test_suite_gcm.camellia test_suite_hmac_shax \
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +010056 test_suite_hmac_drbg.misc \
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +010057 test_suite_hmac_drbg.no_reseed \
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +010058 test_suite_hmac_drbg.nopr \
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +010059 test_suite_hmac_drbg.pr \
Paul Bakker9d781402011-05-09 16:17:09 +000060 test_suite_md test_suite_mdx \
Paul Bakkerf518b162012-08-23 13:03:18 +000061 test_suite_mpi test_suite_pbkdf2 \
Paul Bakker16300582014-04-11 13:28:43 +020062 test_suite_pem \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020063 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020064 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020065 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000066 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000067 test_suite_x509parse test_suite_x509write \
68 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000069
70.SILENT:
71
72all: $(APPS)
73
Paul Bakker19343182013-08-16 13:31:10 +020074test_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 +020075 echo " Generate $@"
76 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
77
Paul Bakker19343182013-08-16 13:31:10 +020078test_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 +020079 echo " Generate $@"
80 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
81
Paul Bakker19343182013-08-16 13:31:10 +020082test_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 +020083 echo " Generate $@"
84 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
85
Paul Bakker19343182013-08-16 13:31:10 +020086test_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 +020087 echo " Generate $@"
88 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
89
Paul Bakker19343182013-08-16 13:31:10 +020090test_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 +000091 echo " Generate $@"
92 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
93
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020094test_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
95 echo " Generate $@"
96 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
97
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020098test_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
99 echo " Generate $@"
100 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
101
Paul Bakker19343182013-08-16 13:31:10 +0200102test_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 +0000103 echo " Generate $@"
104 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
105
Paul Bakker19343182013-08-16 13:31:10 +0200106test_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 +0000107 echo " Generate $@"
108 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
109
Paul Bakker19343182013-08-16 13:31:10 +0200110test_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 +0000111 echo " Generate $@"
112 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
113
Paul Bakker19343182013-08-16 13:31:10 +0200114test_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 +0000115 echo " Generate $@"
116 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
117
Paul Bakker19343182013-08-16 13:31:10 +0200118test_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 +0200119 echo " Generate $@"
120 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
121
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200122test_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 +0000123 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200124 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000125
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200126test_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 +0000127 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200128 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200129
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200130test_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 +0200131 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200132 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200133
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200134test_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 +0200135 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200136 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200137
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200138test_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 +0200139 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200140 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200141
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200142test_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 +0200143 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200144 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000145
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200146test_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
147 echo " Generate $@"
148 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000149
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100150test_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
151 echo " Generate $@"
152 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
153
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100154test_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
155 echo " Generate $@"
156 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
157
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100158test_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
159 echo " Generate $@"
160 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
161
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100162test_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
163 echo " Generate $@"
164 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
165
Paul Bakker19343182013-08-16 13:31:10 +0200166%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000167 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000168 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000169
Paul Bakker674e0b02014-03-26 13:26:52 +0100170test_suite_aes.ecb: test_suite_aes.ecb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200171 echo " CC $@.c"
172 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
173
Paul Bakker674e0b02014-03-26 13:26:52 +0100174test_suite_aes.cbc: test_suite_aes.cbc.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200175 echo " CC $@.c"
176 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
177
Paul Bakker674e0b02014-03-26 13:26:52 +0100178test_suite_aes.cfb: test_suite_aes.cfb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200179 echo " CC $@.c"
180 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
181
Paul Bakker674e0b02014-03-26 13:26:52 +0100182test_suite_aes.rest: test_suite_aes.rest.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000183 echo " CC $@.c"
184 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
185
Paul Bakker674e0b02014-03-26 13:26:52 +0100186test_suite_arc4: test_suite_arc4.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000187 echo " CC $@.c"
188 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
189
Paul Bakker674e0b02014-03-26 13:26:52 +0100190test_suite_base64: test_suite_base64.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000191 echo " CC $@.c"
192 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
193
Paul Bakker674e0b02014-03-26 13:26:52 +0100194test_suite_blowfish: test_suite_blowfish.c $(DEP)
Paul Bakkera9379c02012-07-04 11:02:11 +0000195 echo " CC $@.c"
196 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
197
Paul Bakker674e0b02014-03-26 13:26:52 +0100198test_suite_camellia: test_suite_camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000199 echo " CC $@.c"
200 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
201
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +0200202test_suite_ccm: test_suite_ccm.c $(DEP)
203 echo " CC $@.c"
204 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
205
Paul Bakker674e0b02014-03-26 13:26:52 +0100206test_suite_cipher.aes: test_suite_cipher.aes.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000207 echo " CC $@.c"
208 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
209
Paul Bakker674e0b02014-03-26 13:26:52 +0100210test_suite_cipher.arc4: test_suite_cipher.arc4.c $(DEP)
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200211 echo " CC $@.c"
212 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
213
Paul Bakker674e0b02014-03-26 13:26:52 +0100214test_suite_cipher.gcm: test_suite_cipher.gcm.c $(DEP)
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200215 echo " CC $@.c"
216 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
217
Paul Bakker674e0b02014-03-26 13:26:52 +0100218test_suite_cipher.blowfish: test_suite_cipher.blowfish.c $(DEP)
Paul Bakker6132d0a2012-07-04 17:10:40 +0000219 echo " CC $@.c"
220 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
221
Paul Bakker674e0b02014-03-26 13:26:52 +0100222test_suite_cipher.camellia: test_suite_cipher.camellia.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000223 echo " CC $@.c"
224 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
225
Paul Bakker674e0b02014-03-26 13:26:52 +0100226test_suite_cipher.des: test_suite_cipher.des.c $(DEP)
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000227 echo " CC $@.c"
228 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
229
Paul Bakker674e0b02014-03-26 13:26:52 +0100230test_suite_cipher.null: test_suite_cipher.null.c $(DEP)
Paul Bakkerfab5c822012-02-06 16:45:10 +0000231 echo " CC $@.c"
232 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
233
Paul Bakker674e0b02014-03-26 13:26:52 +0100234test_suite_cipher.padding: test_suite_cipher.padding.c $(DEP)
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200235 echo " CC $@.c"
236 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
237
Paul Bakker674e0b02014-03-26 13:26:52 +0100238test_suite_ctr_drbg: test_suite_ctr_drbg.c $(DEP)
Paul Bakker8123e9d2011-01-06 15:37:30 +0000239 echo " CC $@.c"
240 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
241
Paul Bakker674e0b02014-03-26 13:26:52 +0100242test_suite_des: test_suite_des.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000243 echo " CC $@.c"
244 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
245
Paul Bakker674e0b02014-03-26 13:26:52 +0100246test_suite_dhm: test_suite_dhm.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000247 echo " CC $@.c"
248 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
249
Paul Bakker674e0b02014-03-26 13:26:52 +0100250test_suite_ecdh: test_suite_ecdh.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100251 echo " CC $@.c"
252 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
253
Paul Bakker674e0b02014-03-26 13:26:52 +0100254test_suite_ecdsa: test_suite_ecdsa.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100255 echo " CC $@.c"
256 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
257
Paul Bakker674e0b02014-03-26 13:26:52 +0100258test_suite_ecp: test_suite_ecp.c $(DEP)
Paul Bakkera95919b2013-01-16 17:00:05 +0100259 echo " CC $@.c"
260 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
261
Paul Bakker674e0b02014-03-26 13:26:52 +0100262test_suite_error: test_suite_error.c $(DEP)
Paul Bakker9d781402011-05-09 16:17:09 +0000263 echo " CC $@.c"
264 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
265
Paul Bakker674e0b02014-03-26 13:26:52 +0100266test_suite_gcm.aes128_de: test_suite_gcm.aes128_de.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000267 echo " CC $@.c"
268 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
269
Paul Bakker674e0b02014-03-26 13:26:52 +0100270test_suite_gcm.aes192_de: test_suite_gcm.aes192_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200271 echo " CC $@.c"
272 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
273
Paul Bakker674e0b02014-03-26 13:26:52 +0100274test_suite_gcm.aes256_de: test_suite_gcm.aes256_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200275 echo " CC $@.c"
276 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
277
Paul Bakker674e0b02014-03-26 13:26:52 +0100278test_suite_gcm.aes128_en: test_suite_gcm.aes128_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200279 echo " CC $@.c"
280 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
281
Paul Bakker674e0b02014-03-26 13:26:52 +0100282test_suite_gcm.aes192_en: test_suite_gcm.aes192_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200283 echo " CC $@.c"
284 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
285
Paul Bakker674e0b02014-03-26 13:26:52 +0100286test_suite_gcm.aes256_en: test_suite_gcm.aes256_en.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000287 echo " CC $@.c"
288 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
289
Paul Bakker674e0b02014-03-26 13:26:52 +0100290test_suite_gcm.camellia: test_suite_gcm.camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000291 echo " CC $@.c"
292 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000293
Paul Bakker674e0b02014-03-26 13:26:52 +0100294test_suite_hmac_drbg.misc: test_suite_hmac_drbg.misc.c $(DEP)
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100295 echo " CC $@.c"
296 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
297
Paul Bakker674e0b02014-03-26 13:26:52 +0100298test_suite_hmac_drbg.no_reseed: test_suite_hmac_drbg.no_reseed.c $(DEP)
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100299 echo " CC $@.c"
300 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
301
Paul Bakker674e0b02014-03-26 13:26:52 +0100302test_suite_hmac_drbg.nopr: test_suite_hmac_drbg.nopr.c $(DEP)
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100303 echo " CC $@.c"
304 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
305
Paul Bakker674e0b02014-03-26 13:26:52 +0100306test_suite_hmac_drbg.pr: test_suite_hmac_drbg.pr.c $(DEP)
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100307 echo " CC $@.c"
308 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
309
Paul Bakker674e0b02014-03-26 13:26:52 +0100310test_suite_hmac_shax: test_suite_hmac_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000311 echo " CC $@.c"
312 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
313
Paul Bakker674e0b02014-03-26 13:26:52 +0100314test_suite_md: test_suite_md.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000315 echo " CC $@.c"
316 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
317
Paul Bakker674e0b02014-03-26 13:26:52 +0100318test_suite_mdx: test_suite_mdx.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000319 echo " CC $@.c"
320 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
321
Paul Bakker674e0b02014-03-26 13:26:52 +0100322test_suite_mpi: test_suite_mpi.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000323 echo " CC $@.c"
324 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
325
Paul Bakker674e0b02014-03-26 13:26:52 +0100326test_suite_pbkdf2: test_suite_pbkdf2.c $(DEP)
Paul Bakkerf518b162012-08-23 13:03:18 +0000327 echo " CC $@.c"
328 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
329
Paul Bakker16300582014-04-11 13:28:43 +0200330test_suite_pem: test_suite_pem.c $(DEP)
331 echo " CC $@.c"
332 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
333
Paul Bakker674e0b02014-03-26 13:26:52 +0100334test_suite_pkcs1_v21: test_suite_pkcs1_v21.c $(DEP)
Paul Bakker9dcc3222011-03-08 14:16:06 +0000335 echo " CC $@.c"
336 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
337
Paul Bakker674e0b02014-03-26 13:26:52 +0100338test_suite_pkcs5: test_suite_pkcs5.c $(DEP)
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200339 echo " CC $@.c"
340 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
341
Paul Bakker674e0b02014-03-26 13:26:52 +0100342test_suite_pkparse: test_suite_pkparse.c $(DEP)
Paul Bakker1a7550a2013-09-15 13:01:22 +0200343 echo " CC $@.c"
344 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
345
Paul Bakker674e0b02014-03-26 13:26:52 +0100346test_suite_pkwrite: test_suite_pkwrite.c $(DEP)
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200347 echo " CC $@.c"
348 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
349
Paul Bakker674e0b02014-03-26 13:26:52 +0100350test_suite_pk: test_suite_pk.c $(DEP)
Paul Bakker32925622013-10-28 17:32:48 +0100351 echo " CC $@.c"
352 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
353
Paul Bakker674e0b02014-03-26 13:26:52 +0100354test_suite_rsa: test_suite_rsa.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000355 echo " CC $@.c"
356 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
357
Paul Bakker674e0b02014-03-26 13:26:52 +0100358test_suite_shax: test_suite_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000359 echo " CC $@.c"
360 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
361
Paul Bakker674e0b02014-03-26 13:26:52 +0100362test_suite_x509parse: test_suite_x509parse.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000363 echo " CC $@.c"
364 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
365
Paul Bakker674e0b02014-03-26 13:26:52 +0100366test_suite_x509write: test_suite_x509write.c $(DEP)
Paul Bakker6d620502012-02-16 14:09:13 +0000367 echo " CC $@.c"
368 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
369
Paul Bakker674e0b02014-03-26 13:26:52 +0100370test_suite_xtea: test_suite_xtea.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000371 echo " CC $@.c"
372 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
373
Paul Bakker674e0b02014-03-26 13:26:52 +0100374test_suite_debug: test_suite_debug.c $(DEP)
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000375 echo " CC $@.c"
376 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
377
Paul Bakker674e0b02014-03-26 13:26:52 +0100378test_suite_version: test_suite_version.c $(DEP)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000379 echo " CC $@.c"
380 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
381
Paul Bakker0049c2f2009-07-11 19:15:43 +0000382clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000383ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000384 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000385endif
386ifdef WINDOWS
387 del /Q /F *.c *.exe
388endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000389
Paul Bakker9794cb42009-07-28 18:55:00 +0000390check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000391ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100392 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000393 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000394 for i in $(APPS); \
395 do \
396 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100397 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000398 FAILED=`echo $$RESULT |grep FAILED`; \
399 echo " $$RESULT"; \
400 if [ "$$FAILED" != "" ]; \
401 then \
402 echo "**** Failed ***************"; \
403 RETURN=1; \
404 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000405 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000406 done; \
407 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000408endif