blob: b75dd52fcfcb2d56049b59467b4e18febe9a088d [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 Bakkerc7ffd362012-04-05 12:08:29 +000012ifdef DEBUG
13CFLAGS += -g3
14endif
15
Paul Bakkercd5b5292012-05-10 20:49:10 +000016ifdef WINDOWS
17LDFLAGS += -lws2_32
18endif
19
Paul Bakker2770fbd2012-07-03 13:30:23 +000020# Zlib shared library extensions:
21ifdef ZLIB
22LDFLAGS += -lz
23endif
24
Paul Bakker286bf3c2013-04-08 18:09:51 +020025APPS = test_suite_aes.ecb test_suite_aes.cbc \
26 test_suite_aes.cfb test_suite_aes.rest \
27 test_suite_arc4 \
Paul Bakkera9379c02012-07-04 11:02:11 +000028 test_suite_base64 test_suite_blowfish \
Paul Bakker6132d0a2012-07-04 17:10:40 +000029 test_suite_camellia test_suite_cipher.aes \
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020030 test_suite_cipher.arc4 test_suite_cipher.gcm \
Paul Bakker6132d0a2012-07-04 17:10:40 +000031 test_suite_cipher.blowfish \
32 test_suite_cipher.camellia \
Paul Bakkerfab5c822012-02-06 16:45:10 +000033 test_suite_cipher.des test_suite_cipher.null \
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +020034 test_suite_cipher.padding \
Paul Bakkerfab5c822012-02-06 16:45:10 +000035 test_suite_ctr_drbg test_suite_debug \
Paul Bakker9d781402011-05-09 16:17:09 +000036 test_suite_des test_suite_dhm \
Paul Bakkerd589a0d2013-03-13 16:30:17 +010037 test_suite_ecdh test_suite_ecdsa \
Paul Bakkera95919b2013-01-16 17:00:05 +010038 test_suite_ecp \
Paul Bakker286bf3c2013-04-08 18:09:51 +020039 test_suite_error \
40 test_suite_gcm.decrypt_128 \
41 test_suite_gcm.decrypt_192 \
42 test_suite_gcm.decrypt_256 \
43 test_suite_gcm.encrypt_128 \
44 test_suite_gcm.encrypt_192 \
45 test_suite_gcm.encrypt_256 \
46 test_suite_hmac_shax \
Paul Bakker9d781402011-05-09 16:17:09 +000047 test_suite_md test_suite_mdx \
Paul Bakkerf518b162012-08-23 13:03:18 +000048 test_suite_mpi test_suite_pbkdf2 \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020049 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020050 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020051 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000052 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000053 test_suite_x509parse test_suite_x509write \
54 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000055
56.SILENT:
57
58all: $(APPS)
59
Paul Bakker19343182013-08-16 13:31:10 +020060test_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 +020061 echo " Generate $@"
62 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
63
Paul Bakker19343182013-08-16 13:31:10 +020064test_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 +020065 echo " Generate $@"
66 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
67
Paul Bakker19343182013-08-16 13:31:10 +020068test_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 +020069 echo " Generate $@"
70 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
71
Paul Bakker19343182013-08-16 13:31:10 +020072test_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 +020073 echo " Generate $@"
74 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
75
Paul Bakker19343182013-08-16 13:31:10 +020076test_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 +000077 echo " Generate $@"
78 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
79
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020080test_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
81 echo " Generate $@"
82 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
83
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020084test_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
85 echo " Generate $@"
86 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
87
Paul Bakker19343182013-08-16 13:31:10 +020088test_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 +000089 echo " Generate $@"
90 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
91
Paul Bakker19343182013-08-16 13:31:10 +020092test_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 +000093 echo " Generate $@"
94 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
95
Paul Bakker19343182013-08-16 13:31:10 +020096test_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 +000097 echo " Generate $@"
98 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
99
Paul Bakker19343182013-08-16 13:31:10 +0200100test_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 +0000101 echo " Generate $@"
102 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
103
Paul Bakker19343182013-08-16 13:31:10 +0200104test_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 +0200105 echo " Generate $@"
106 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
107
Paul Bakker19343182013-08-16 13:31:10 +0200108test_suite_gcm.decrypt_128.c : suites/test_suite_gcm.function suites/test_suite_gcm.decrypt_128.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker89e80c92012-03-20 13:50:09 +0000109 echo " Generate $@"
Paul Bakker286bf3c2013-04-08 18:09:51 +0200110 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_128
Paul Bakker89e80c92012-03-20 13:50:09 +0000111
Paul Bakker19343182013-08-16 13:31:10 +0200112test_suite_gcm.decrypt_192.c : suites/test_suite_gcm.function suites/test_suite_gcm.decrypt_192.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker89e80c92012-03-20 13:50:09 +0000113 echo " Generate $@"
Paul Bakker286bf3c2013-04-08 18:09:51 +0200114 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_192
115
Paul Bakker19343182013-08-16 13:31:10 +0200116test_suite_gcm.decrypt_256.c : suites/test_suite_gcm.function suites/test_suite_gcm.decrypt_256.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200117 echo " Generate $@"
118 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_256
119
Paul Bakker19343182013-08-16 13:31:10 +0200120test_suite_gcm.encrypt_128.c : suites/test_suite_gcm.function suites/test_suite_gcm.encrypt_128.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200121 echo " Generate $@"
122 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_128
123
Paul Bakker19343182013-08-16 13:31:10 +0200124test_suite_gcm.encrypt_192.c : suites/test_suite_gcm.function suites/test_suite_gcm.encrypt_192.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200125 echo " Generate $@"
126 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_192
127
Paul Bakker19343182013-08-16 13:31:10 +0200128test_suite_gcm.encrypt_256.c : suites/test_suite_gcm.function suites/test_suite_gcm.encrypt_256.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker286bf3c2013-04-08 18:09:51 +0200129 echo " Generate $@"
130 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_256
Paul Bakker89e80c92012-03-20 13:50:09 +0000131
Paul Bakker19343182013-08-16 13:31:10 +0200132%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000133 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000134 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000135
Paul Bakker286bf3c2013-04-08 18:09:51 +0200136test_suite_aes.ecb: test_suite_aes.ecb.c ../library/libpolarssl.a
137 echo " CC $@.c"
138 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
139
140test_suite_aes.cbc: test_suite_aes.cbc.c ../library/libpolarssl.a
141 echo " CC $@.c"
142 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
143
144test_suite_aes.cfb: test_suite_aes.cfb.c ../library/libpolarssl.a
145 echo " CC $@.c"
146 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
147
148test_suite_aes.rest: test_suite_aes.rest.c ../library/libpolarssl.a
Paul Bakker0049c2f2009-07-11 19:15:43 +0000149 echo " CC $@.c"
150 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
151
152test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
153 echo " CC $@.c"
154 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
155
156test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
157 echo " CC $@.c"
158 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
159
Paul Bakkera9379c02012-07-04 11:02:11 +0000160test_suite_blowfish: test_suite_blowfish.c ../library/libpolarssl.a
161 echo " CC $@.c"
162 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
163
Paul Bakker0049c2f2009-07-11 19:15:43 +0000164test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
165 echo " CC $@.c"
166 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
167
Paul Bakker46c17942011-07-13 14:54:54 +0000168test_suite_cipher.aes: test_suite_cipher.aes.c ../library/libpolarssl.a
169 echo " CC $@.c"
170 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
171
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200172test_suite_cipher.arc4: test_suite_cipher.arc4.c ../library/libpolarssl.a
173 echo " CC $@.c"
174 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
175
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200176test_suite_cipher.gcm: test_suite_cipher.gcm.c ../library/libpolarssl.a
177 echo " CC $@.c"
178 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
179
Paul Bakker6132d0a2012-07-04 17:10:40 +0000180test_suite_cipher.blowfish: test_suite_cipher.blowfish.c ../library/libpolarssl.a
181 echo " CC $@.c"
182 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
183
Paul Bakker46c17942011-07-13 14:54:54 +0000184test_suite_cipher.camellia: test_suite_cipher.camellia.c ../library/libpolarssl.a
185 echo " CC $@.c"
186 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
187
Paul Bakkerfab5c822012-02-06 16:45:10 +0000188test_suite_cipher.des: test_suite_cipher.des.c ../library/libpolarssl.a
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000189 echo " CC $@.c"
190 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
191
Paul Bakkerfab5c822012-02-06 16:45:10 +0000192test_suite_cipher.null: test_suite_cipher.null.c ../library/libpolarssl.a
193 echo " CC $@.c"
194 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
195
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200196test_suite_cipher.padding: test_suite_cipher.padding.c ../library/libpolarssl.a
197 echo " CC $@.c"
198 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
199
Paul Bakkerfab5c822012-02-06 16:45:10 +0000200test_suite_ctr_drbg: test_suite_ctr_drbg.c ../library/libpolarssl.a
Paul Bakker8123e9d2011-01-06 15:37:30 +0000201 echo " CC $@.c"
202 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
203
Paul Bakker0049c2f2009-07-11 19:15:43 +0000204test_suite_des: test_suite_des.c ../library/libpolarssl.a
205 echo " CC $@.c"
206 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
207
208test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
209 echo " CC $@.c"
210 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
211
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100212test_suite_ecdh: test_suite_ecdh.c ../library/libpolarssl.a
213 echo " CC $@.c"
214 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
215
216test_suite_ecdsa: test_suite_ecdsa.c ../library/libpolarssl.a
217 echo " CC $@.c"
218 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
219
Paul Bakkera95919b2013-01-16 17:00:05 +0100220test_suite_ecp: test_suite_ecp.c ../library/libpolarssl.a
221 echo " CC $@.c"
222 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
223
Paul Bakker9d781402011-05-09 16:17:09 +0000224test_suite_error: test_suite_error.c ../library/libpolarssl.a
225 echo " CC $@.c"
226 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
227
Paul Bakker286bf3c2013-04-08 18:09:51 +0200228test_suite_gcm.decrypt_128: test_suite_gcm.decrypt_128.c ../library/libpolarssl.a
Paul Bakker89e80c92012-03-20 13:50:09 +0000229 echo " CC $@.c"
230 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
231
Paul Bakker286bf3c2013-04-08 18:09:51 +0200232test_suite_gcm.decrypt_192: test_suite_gcm.decrypt_192.c ../library/libpolarssl.a
233 echo " CC $@.c"
234 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
235
236test_suite_gcm.decrypt_256: test_suite_gcm.decrypt_256.c ../library/libpolarssl.a
237 echo " CC $@.c"
238 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
239
240test_suite_gcm.encrypt_128: test_suite_gcm.encrypt_128.c ../library/libpolarssl.a
241 echo " CC $@.c"
242 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
243
244test_suite_gcm.encrypt_192: test_suite_gcm.encrypt_192.c ../library/libpolarssl.a
245 echo " CC $@.c"
246 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
247
248test_suite_gcm.encrypt_256: test_suite_gcm.encrypt_256.c ../library/libpolarssl.a
Paul Bakker89e80c92012-03-20 13:50:09 +0000249 echo " CC $@.c"
250 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
251
Paul Bakker0049c2f2009-07-11 19:15:43 +0000252test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
253 echo " CC $@.c"
254 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
255
Paul Bakker17373852011-01-06 14:20:01 +0000256test_suite_md: test_suite_md.c ../library/libpolarssl.a
257 echo " CC $@.c"
258 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
259
Paul Bakker0049c2f2009-07-11 19:15:43 +0000260test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
261 echo " CC $@.c"
262 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
263
264test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
265 echo " CC $@.c"
266 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
267
Paul Bakkerf518b162012-08-23 13:03:18 +0000268test_suite_pbkdf2: test_suite_pbkdf2.c ../library/libpolarssl.a
269 echo " CC $@.c"
270 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
271
Paul Bakker9dcc3222011-03-08 14:16:06 +0000272test_suite_pkcs1_v21: test_suite_pkcs1_v21.c ../library/libpolarssl.a
273 echo " CC $@.c"
274 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
275
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200276test_suite_pkcs5: test_suite_pkcs5.c ../library/libpolarssl.a
277 echo " CC $@.c"
278 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
279
Paul Bakker1a7550a2013-09-15 13:01:22 +0200280test_suite_pkparse: test_suite_pkparse.c ../library/libpolarssl.a
281 echo " CC $@.c"
282 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
283
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200284test_suite_pkwrite: test_suite_pkwrite.c ../library/libpolarssl.a
285 echo " CC $@.c"
286 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
287
Paul Bakker0049c2f2009-07-11 19:15:43 +0000288test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
289 echo " CC $@.c"
290 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
291
292test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
293 echo " CC $@.c"
294 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
295
296test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
297 echo " CC $@.c"
298 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
299
Paul Bakker6d620502012-02-16 14:09:13 +0000300test_suite_x509write: test_suite_x509write.c ../library/libpolarssl.a
301 echo " CC $@.c"
302 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
303
Paul Bakker0049c2f2009-07-11 19:15:43 +0000304test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
305 echo " CC $@.c"
306 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
307
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000308test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
309 echo " CC $@.c"
310 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
311
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000312test_suite_version: test_suite_version.c ../library/libpolarssl.a
313 echo " CC $@.c"
314 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
315
Paul Bakker0049c2f2009-07-11 19:15:43 +0000316clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000317ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000318 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000319endif
320ifdef WINDOWS
321 del /Q /F *.c *.exe
322endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000323
Paul Bakker9794cb42009-07-28 18:55:00 +0000324check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000325ifndef WINDOWS
Paul Bakkerd14cd352012-05-08 15:39:50 +0000326 echo "Running checks (Success if all tests PASSED)"
327 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000328 for i in $(APPS); \
329 do \
330 echo " - $${i}"; \
Paul Bakker667086b2013-08-20 23:11:06 +0200331 RESULT=`./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000332 FAILED=`echo $$RESULT |grep FAILED`; \
333 echo " $$RESULT"; \
334 if [ "$$FAILED" != "" ]; \
335 then \
336 echo "**** Failed ***************"; \
337 RETURN=1; \
338 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000339 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000340 done; \
341 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000342endif