blob: dd9f205b4bd4959328ce3caa59e11b21d8e55cc6 [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 \
Paul Bakker286bf3c2013-04-08 18:09:51 +020049 test_suite_error \
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 \
Paul Bakkerf518b162012-08-23 13:03:18 +000062 test_suite_mpi test_suite_pbkdf2 \
Paul Bakker16300582014-04-11 13:28:43 +020063 test_suite_pem \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020064 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020065 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020066 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000067 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000068 test_suite_x509parse test_suite_x509write \
69 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000070
71.SILENT:
72
73all: $(APPS)
74
Paul Bakker19343182013-08-16 13:31:10 +020075test_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 +020076 echo " Generate $@"
77 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
78
Paul Bakker19343182013-08-16 13:31:10 +020079test_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 +020080 echo " Generate $@"
81 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
82
Paul Bakker19343182013-08-16 13:31:10 +020083test_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 +020084 echo " Generate $@"
85 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
86
Paul Bakker19343182013-08-16 13:31:10 +020087test_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 +020088 echo " Generate $@"
89 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
90
Paul Bakker19343182013-08-16 13:31:10 +020091test_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 +000092 echo " Generate $@"
93 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
94
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020095test_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
96 echo " Generate $@"
97 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
98
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +020099test_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
100 echo " Generate $@"
101 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.ccm
102
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200103test_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
104 echo " Generate $@"
105 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
106
Paul Bakker19343182013-08-16 13:31:10 +0200107test_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 +0000108 echo " Generate $@"
109 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
110
Paul Bakker19343182013-08-16 13:31:10 +0200111test_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 +0000112 echo " Generate $@"
113 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
114
Paul Bakker19343182013-08-16 13:31:10 +0200115test_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 +0000116 echo " Generate $@"
117 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
118
Paul Bakker19343182013-08-16 13:31:10 +0200119test_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 +0000120 echo " Generate $@"
121 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
122
Paul Bakker19343182013-08-16 13:31:10 +0200123test_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 +0200124 echo " Generate $@"
125 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
126
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200127test_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 +0000128 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200129 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000130
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200131test_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 +0000132 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200133 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200134
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200135test_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 +0200136 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200137 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200138
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200139test_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 +0200140 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200141 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200142
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200143test_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 +0200144 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200145 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200146
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200147test_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 +0200148 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200149 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000150
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200151test_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
152 echo " Generate $@"
153 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000154
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100155test_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
156 echo " Generate $@"
157 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
158
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100159test_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
160 echo " Generate $@"
161 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
162
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100163test_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
164 echo " Generate $@"
165 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
166
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100167test_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
168 echo " Generate $@"
169 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
170
Paul Bakker19343182013-08-16 13:31:10 +0200171%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000172 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000173 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000174
Paul Bakker674e0b02014-03-26 13:26:52 +0100175test_suite_aes.ecb: test_suite_aes.ecb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200176 echo " CC $@.c"
177 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
178
Paul Bakker674e0b02014-03-26 13:26:52 +0100179test_suite_aes.cbc: test_suite_aes.cbc.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200180 echo " CC $@.c"
181 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
182
Paul Bakker674e0b02014-03-26 13:26:52 +0100183test_suite_aes.cfb: test_suite_aes.cfb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200184 echo " CC $@.c"
185 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
186
Paul Bakker674e0b02014-03-26 13:26:52 +0100187test_suite_aes.rest: test_suite_aes.rest.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000188 echo " CC $@.c"
189 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
190
Paul Bakker674e0b02014-03-26 13:26:52 +0100191test_suite_arc4: test_suite_arc4.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000192 echo " CC $@.c"
193 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
194
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +0200195test_suite_asn1write: test_suite_asn1write.c $(DEP)
196 echo " CC $@.c"
197 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
198
Paul Bakker674e0b02014-03-26 13:26:52 +0100199test_suite_base64: test_suite_base64.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000200 echo " CC $@.c"
201 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
202
Paul Bakker674e0b02014-03-26 13:26:52 +0100203test_suite_blowfish: test_suite_blowfish.c $(DEP)
Paul Bakkera9379c02012-07-04 11:02:11 +0000204 echo " CC $@.c"
205 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
206
Paul Bakker674e0b02014-03-26 13:26:52 +0100207test_suite_camellia: test_suite_camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000208 echo " CC $@.c"
209 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
210
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +0200211test_suite_ccm: test_suite_ccm.c $(DEP)
212 echo " CC $@.c"
213 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
214
Paul Bakker674e0b02014-03-26 13:26:52 +0100215test_suite_cipher.aes: test_suite_cipher.aes.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000216 echo " CC $@.c"
217 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
218
Paul Bakker674e0b02014-03-26 13:26:52 +0100219test_suite_cipher.arc4: test_suite_cipher.arc4.c $(DEP)
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200220 echo " CC $@.c"
221 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
222
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200223test_suite_cipher.ccm: test_suite_cipher.ccm.c $(DEP)
224 echo " CC $@.c"
225 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
226
Paul Bakker674e0b02014-03-26 13:26:52 +0100227test_suite_cipher.gcm: test_suite_cipher.gcm.c $(DEP)
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200228 echo " CC $@.c"
229 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
230
Paul Bakker674e0b02014-03-26 13:26:52 +0100231test_suite_cipher.blowfish: test_suite_cipher.blowfish.c $(DEP)
Paul Bakker6132d0a2012-07-04 17:10:40 +0000232 echo " CC $@.c"
233 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
234
Paul Bakker674e0b02014-03-26 13:26:52 +0100235test_suite_cipher.camellia: test_suite_cipher.camellia.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000236 echo " CC $@.c"
237 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
238
Paul Bakker674e0b02014-03-26 13:26:52 +0100239test_suite_cipher.des: test_suite_cipher.des.c $(DEP)
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000240 echo " CC $@.c"
241 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
242
Paul Bakker674e0b02014-03-26 13:26:52 +0100243test_suite_cipher.null: test_suite_cipher.null.c $(DEP)
Paul Bakkerfab5c822012-02-06 16:45:10 +0000244 echo " CC $@.c"
245 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
246
Paul Bakker674e0b02014-03-26 13:26:52 +0100247test_suite_cipher.padding: test_suite_cipher.padding.c $(DEP)
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200248 echo " CC $@.c"
249 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
250
Paul Bakker674e0b02014-03-26 13:26:52 +0100251test_suite_ctr_drbg: test_suite_ctr_drbg.c $(DEP)
Paul Bakker8123e9d2011-01-06 15:37:30 +0000252 echo " CC $@.c"
253 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
254
Paul Bakker674e0b02014-03-26 13:26:52 +0100255test_suite_des: test_suite_des.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000256 echo " CC $@.c"
257 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
258
Paul Bakker674e0b02014-03-26 13:26:52 +0100259test_suite_dhm: test_suite_dhm.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000260 echo " CC $@.c"
261 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
262
Paul Bakker674e0b02014-03-26 13:26:52 +0100263test_suite_ecdh: test_suite_ecdh.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100264 echo " CC $@.c"
265 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
266
Paul Bakker674e0b02014-03-26 13:26:52 +0100267test_suite_ecdsa: test_suite_ecdsa.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100268 echo " CC $@.c"
269 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
270
Paul Bakker674e0b02014-03-26 13:26:52 +0100271test_suite_ecp: test_suite_ecp.c $(DEP)
Paul Bakkera95919b2013-01-16 17:00:05 +0100272 echo " CC $@.c"
273 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
274
Paul Bakker674e0b02014-03-26 13:26:52 +0100275test_suite_error: test_suite_error.c $(DEP)
Paul Bakker9d781402011-05-09 16:17:09 +0000276 echo " CC $@.c"
277 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
278
Paul Bakker674e0b02014-03-26 13:26:52 +0100279test_suite_gcm.aes128_de: test_suite_gcm.aes128_de.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000280 echo " CC $@.c"
281 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
282
Paul Bakker674e0b02014-03-26 13:26:52 +0100283test_suite_gcm.aes192_de: test_suite_gcm.aes192_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200284 echo " CC $@.c"
285 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
286
Paul Bakker674e0b02014-03-26 13:26:52 +0100287test_suite_gcm.aes256_de: test_suite_gcm.aes256_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200288 echo " CC $@.c"
289 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
290
Paul Bakker674e0b02014-03-26 13:26:52 +0100291test_suite_gcm.aes128_en: test_suite_gcm.aes128_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200292 echo " CC $@.c"
293 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
294
Paul Bakker674e0b02014-03-26 13:26:52 +0100295test_suite_gcm.aes192_en: test_suite_gcm.aes192_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200296 echo " CC $@.c"
297 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
298
Paul Bakker674e0b02014-03-26 13:26:52 +0100299test_suite_gcm.aes256_en: test_suite_gcm.aes256_en.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000300 echo " CC $@.c"
301 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
302
Paul Bakker674e0b02014-03-26 13:26:52 +0100303test_suite_gcm.camellia: test_suite_gcm.camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000304 echo " CC $@.c"
305 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000306
Paul Bakker674e0b02014-03-26 13:26:52 +0100307test_suite_hmac_drbg.misc: test_suite_hmac_drbg.misc.c $(DEP)
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100308 echo " CC $@.c"
309 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
310
Paul Bakker674e0b02014-03-26 13:26:52 +0100311test_suite_hmac_drbg.no_reseed: test_suite_hmac_drbg.no_reseed.c $(DEP)
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100312 echo " CC $@.c"
313 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
314
Paul Bakker674e0b02014-03-26 13:26:52 +0100315test_suite_hmac_drbg.nopr: test_suite_hmac_drbg.nopr.c $(DEP)
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100316 echo " CC $@.c"
317 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
318
Paul Bakker674e0b02014-03-26 13:26:52 +0100319test_suite_hmac_drbg.pr: test_suite_hmac_drbg.pr.c $(DEP)
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100320 echo " CC $@.c"
321 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
322
Paul Bakker674e0b02014-03-26 13:26:52 +0100323test_suite_hmac_shax: test_suite_hmac_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000324 echo " CC $@.c"
325 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
326
Paul Bakker674e0b02014-03-26 13:26:52 +0100327test_suite_md: test_suite_md.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000328 echo " CC $@.c"
329 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
330
Paul Bakker674e0b02014-03-26 13:26:52 +0100331test_suite_mdx: test_suite_mdx.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000332 echo " CC $@.c"
333 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
334
Paul Bakker674e0b02014-03-26 13:26:52 +0100335test_suite_mpi: test_suite_mpi.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000336 echo " CC $@.c"
337 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
338
Paul Bakker674e0b02014-03-26 13:26:52 +0100339test_suite_pbkdf2: test_suite_pbkdf2.c $(DEP)
Paul Bakkerf518b162012-08-23 13:03:18 +0000340 echo " CC $@.c"
341 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
342
Paul Bakker16300582014-04-11 13:28:43 +0200343test_suite_pem: test_suite_pem.c $(DEP)
344 echo " CC $@.c"
345 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
346
Paul Bakker674e0b02014-03-26 13:26:52 +0100347test_suite_pkcs1_v21: test_suite_pkcs1_v21.c $(DEP)
Paul Bakker9dcc3222011-03-08 14:16:06 +0000348 echo " CC $@.c"
349 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
350
Paul Bakker674e0b02014-03-26 13:26:52 +0100351test_suite_pkcs5: test_suite_pkcs5.c $(DEP)
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200352 echo " CC $@.c"
353 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
354
Paul Bakker674e0b02014-03-26 13:26:52 +0100355test_suite_pkparse: test_suite_pkparse.c $(DEP)
Paul Bakker1a7550a2013-09-15 13:01:22 +0200356 echo " CC $@.c"
357 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
358
Paul Bakker674e0b02014-03-26 13:26:52 +0100359test_suite_pkwrite: test_suite_pkwrite.c $(DEP)
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200360 echo " CC $@.c"
361 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
362
Paul Bakker674e0b02014-03-26 13:26:52 +0100363test_suite_pk: test_suite_pk.c $(DEP)
Paul Bakker32925622013-10-28 17:32:48 +0100364 echo " CC $@.c"
365 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
366
Paul Bakker674e0b02014-03-26 13:26:52 +0100367test_suite_rsa: test_suite_rsa.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000368 echo " CC $@.c"
369 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
370
Paul Bakker674e0b02014-03-26 13:26:52 +0100371test_suite_shax: test_suite_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000372 echo " CC $@.c"
373 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
374
Paul Bakker674e0b02014-03-26 13:26:52 +0100375test_suite_x509parse: test_suite_x509parse.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000376 echo " CC $@.c"
377 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
378
Paul Bakker674e0b02014-03-26 13:26:52 +0100379test_suite_x509write: test_suite_x509write.c $(DEP)
Paul Bakker6d620502012-02-16 14:09:13 +0000380 echo " CC $@.c"
381 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
382
Paul Bakker674e0b02014-03-26 13:26:52 +0100383test_suite_xtea: test_suite_xtea.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000384 echo " CC $@.c"
385 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
386
Paul Bakker674e0b02014-03-26 13:26:52 +0100387test_suite_debug: test_suite_debug.c $(DEP)
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000388 echo " CC $@.c"
389 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
390
Paul Bakker674e0b02014-03-26 13:26:52 +0100391test_suite_version: test_suite_version.c $(DEP)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000392 echo " CC $@.c"
393 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
394
Paul Bakker0049c2f2009-07-11 19:15:43 +0000395clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000396ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000397 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000398endif
399ifdef WINDOWS
400 del /Q /F *.c *.exe
401endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000402
Paul Bakker9794cb42009-07-28 18:55:00 +0000403check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000404ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100405 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000406 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000407 for i in $(APPS); \
408 do \
409 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100410 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000411 FAILED=`echo $$RESULT |grep FAILED`; \
412 echo " $$RESULT"; \
413 if [ "$$FAILED" != "" ]; \
414 then \
415 echo "**** Failed ***************"; \
416 RETURN=1; \
417 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000418 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000419 done; \
420 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000421endif