blob: 4d2bcba61c757cc50915e6dec457d1b300a1e3e9 [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 Bakker9d781402011-05-09 16:17:09 +000050 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000051 test_suite_x509parse test_suite_x509write \
52 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000053
54.SILENT:
55
56all: $(APPS)
57
Paul Bakker19343182013-08-16 13:31:10 +020058test_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 +020059 echo " Generate $@"
60 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
61
Paul Bakker19343182013-08-16 13:31:10 +020062test_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 +020063 echo " Generate $@"
64 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
65
Paul Bakker19343182013-08-16 13:31:10 +020066test_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 +020067 echo " Generate $@"
68 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
69
Paul Bakker19343182013-08-16 13:31:10 +020070test_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 +020071 echo " Generate $@"
72 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
73
Paul Bakker19343182013-08-16 13:31:10 +020074test_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 +000075 echo " Generate $@"
76 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
77
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020078test_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
79 echo " Generate $@"
80 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
81
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020082test_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
83 echo " Generate $@"
84 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
85
Paul Bakker19343182013-08-16 13:31:10 +020086test_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 +000087 echo " Generate $@"
88 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
89
Paul Bakker19343182013-08-16 13:31:10 +020090test_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 +000091 echo " Generate $@"
92 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
93
Paul Bakker19343182013-08-16 13:31:10 +020094test_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 +000095 echo " Generate $@"
96 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
97
Paul Bakker19343182013-08-16 13:31:10 +020098test_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 +000099 echo " Generate $@"
100 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
101
Paul Bakker19343182013-08-16 13:31:10 +0200102test_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 +0200103 echo " Generate $@"
104 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
105
Paul Bakker19343182013-08-16 13:31:10 +0200106test_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 +0000107 echo " Generate $@"
Paul Bakker286bf3c2013-04-08 18:09:51 +0200108 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_128
Paul Bakker89e80c92012-03-20 13:50:09 +0000109
Paul Bakker19343182013-08-16 13:31:10 +0200110test_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 +0000111 echo " Generate $@"
Paul Bakker286bf3c2013-04-08 18:09:51 +0200112 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_192
113
Paul Bakker19343182013-08-16 13:31:10 +0200114test_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 +0200115 echo " Generate $@"
116 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_256
117
Paul Bakker19343182013-08-16 13:31:10 +0200118test_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 +0200119 echo " Generate $@"
120 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_128
121
Paul Bakker19343182013-08-16 13:31:10 +0200122test_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 +0200123 echo " Generate $@"
124 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_192
125
Paul Bakker19343182013-08-16 13:31:10 +0200126test_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 +0200127 echo " Generate $@"
128 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_256
Paul Bakker89e80c92012-03-20 13:50:09 +0000129
Paul Bakker19343182013-08-16 13:31:10 +0200130%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000131 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000132 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000133
Paul Bakker286bf3c2013-04-08 18:09:51 +0200134test_suite_aes.ecb: test_suite_aes.ecb.c ../library/libpolarssl.a
135 echo " CC $@.c"
136 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
137
138test_suite_aes.cbc: test_suite_aes.cbc.c ../library/libpolarssl.a
139 echo " CC $@.c"
140 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
141
142test_suite_aes.cfb: test_suite_aes.cfb.c ../library/libpolarssl.a
143 echo " CC $@.c"
144 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
145
146test_suite_aes.rest: test_suite_aes.rest.c ../library/libpolarssl.a
Paul Bakker0049c2f2009-07-11 19:15:43 +0000147 echo " CC $@.c"
148 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
149
150test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
151 echo " CC $@.c"
152 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
153
154test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
155 echo " CC $@.c"
156 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
157
Paul Bakkera9379c02012-07-04 11:02:11 +0000158test_suite_blowfish: test_suite_blowfish.c ../library/libpolarssl.a
159 echo " CC $@.c"
160 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
161
Paul Bakker0049c2f2009-07-11 19:15:43 +0000162test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
163 echo " CC $@.c"
164 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
165
Paul Bakker46c17942011-07-13 14:54:54 +0000166test_suite_cipher.aes: test_suite_cipher.aes.c ../library/libpolarssl.a
167 echo " CC $@.c"
168 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
169
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200170test_suite_cipher.arc4: test_suite_cipher.arc4.c ../library/libpolarssl.a
171 echo " CC $@.c"
172 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
173
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200174test_suite_cipher.gcm: test_suite_cipher.gcm.c ../library/libpolarssl.a
175 echo " CC $@.c"
176 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
177
Paul Bakker6132d0a2012-07-04 17:10:40 +0000178test_suite_cipher.blowfish: test_suite_cipher.blowfish.c ../library/libpolarssl.a
179 echo " CC $@.c"
180 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
181
Paul Bakker46c17942011-07-13 14:54:54 +0000182test_suite_cipher.camellia: test_suite_cipher.camellia.c ../library/libpolarssl.a
183 echo " CC $@.c"
184 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
185
Paul Bakkerfab5c822012-02-06 16:45:10 +0000186test_suite_cipher.des: test_suite_cipher.des.c ../library/libpolarssl.a
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000187 echo " CC $@.c"
188 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
189
Paul Bakkerfab5c822012-02-06 16:45:10 +0000190test_suite_cipher.null: test_suite_cipher.null.c ../library/libpolarssl.a
191 echo " CC $@.c"
192 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
193
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200194test_suite_cipher.padding: test_suite_cipher.padding.c ../library/libpolarssl.a
195 echo " CC $@.c"
196 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
197
Paul Bakkerfab5c822012-02-06 16:45:10 +0000198test_suite_ctr_drbg: test_suite_ctr_drbg.c ../library/libpolarssl.a
Paul Bakker8123e9d2011-01-06 15:37:30 +0000199 echo " CC $@.c"
200 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
201
Paul Bakker0049c2f2009-07-11 19:15:43 +0000202test_suite_des: test_suite_des.c ../library/libpolarssl.a
203 echo " CC $@.c"
204 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
205
206test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
207 echo " CC $@.c"
208 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
209
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100210test_suite_ecdh: test_suite_ecdh.c ../library/libpolarssl.a
211 echo " CC $@.c"
212 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
213
214test_suite_ecdsa: test_suite_ecdsa.c ../library/libpolarssl.a
215 echo " CC $@.c"
216 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
217
Paul Bakkera95919b2013-01-16 17:00:05 +0100218test_suite_ecp: test_suite_ecp.c ../library/libpolarssl.a
219 echo " CC $@.c"
220 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
221
Paul Bakker9d781402011-05-09 16:17:09 +0000222test_suite_error: test_suite_error.c ../library/libpolarssl.a
223 echo " CC $@.c"
224 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
225
Paul Bakker286bf3c2013-04-08 18:09:51 +0200226test_suite_gcm.decrypt_128: test_suite_gcm.decrypt_128.c ../library/libpolarssl.a
Paul Bakker89e80c92012-03-20 13:50:09 +0000227 echo " CC $@.c"
228 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
229
Paul Bakker286bf3c2013-04-08 18:09:51 +0200230test_suite_gcm.decrypt_192: test_suite_gcm.decrypt_192.c ../library/libpolarssl.a
231 echo " CC $@.c"
232 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
233
234test_suite_gcm.decrypt_256: test_suite_gcm.decrypt_256.c ../library/libpolarssl.a
235 echo " CC $@.c"
236 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
237
238test_suite_gcm.encrypt_128: test_suite_gcm.encrypt_128.c ../library/libpolarssl.a
239 echo " CC $@.c"
240 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
241
242test_suite_gcm.encrypt_192: test_suite_gcm.encrypt_192.c ../library/libpolarssl.a
243 echo " CC $@.c"
244 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
245
246test_suite_gcm.encrypt_256: test_suite_gcm.encrypt_256.c ../library/libpolarssl.a
Paul Bakker89e80c92012-03-20 13:50:09 +0000247 echo " CC $@.c"
248 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
249
Paul Bakker0049c2f2009-07-11 19:15:43 +0000250test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
251 echo " CC $@.c"
252 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
253
Paul Bakker17373852011-01-06 14:20:01 +0000254test_suite_md: test_suite_md.c ../library/libpolarssl.a
255 echo " CC $@.c"
256 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
257
Paul Bakker0049c2f2009-07-11 19:15:43 +0000258test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
259 echo " CC $@.c"
260 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
261
262test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
263 echo " CC $@.c"
264 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
265
Paul Bakkerf518b162012-08-23 13:03:18 +0000266test_suite_pbkdf2: test_suite_pbkdf2.c ../library/libpolarssl.a
267 echo " CC $@.c"
268 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
269
Paul Bakker9dcc3222011-03-08 14:16:06 +0000270test_suite_pkcs1_v21: test_suite_pkcs1_v21.c ../library/libpolarssl.a
271 echo " CC $@.c"
272 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
273
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200274test_suite_pkcs5: test_suite_pkcs5.c ../library/libpolarssl.a
275 echo " CC $@.c"
276 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
277
Paul Bakker0049c2f2009-07-11 19:15:43 +0000278test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
279 echo " CC $@.c"
280 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
281
282test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
283 echo " CC $@.c"
284 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
285
286test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
287 echo " CC $@.c"
288 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
289
Paul Bakker6d620502012-02-16 14:09:13 +0000290test_suite_x509write: test_suite_x509write.c ../library/libpolarssl.a
291 echo " CC $@.c"
292 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
293
Paul Bakker0049c2f2009-07-11 19:15:43 +0000294test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
295 echo " CC $@.c"
296 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
297
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000298test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
299 echo " CC $@.c"
300 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
301
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000302test_suite_version: test_suite_version.c ../library/libpolarssl.a
303 echo " CC $@.c"
304 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
305
Paul Bakker0049c2f2009-07-11 19:15:43 +0000306clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000307ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000308 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000309endif
310ifdef WINDOWS
311 del /Q /F *.c *.exe
312endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000313
Paul Bakker9794cb42009-07-28 18:55:00 +0000314check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000315ifndef WINDOWS
Paul Bakkerd14cd352012-05-08 15:39:50 +0000316 echo "Running checks (Success if all tests PASSED)"
317 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000318 for i in $(APPS); \
319 do \
320 echo " - $${i}"; \
Paul Bakker667086b2013-08-20 23:11:06 +0200321 RESULT=`./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000322 FAILED=`echo $$RESULT |grep FAILED`; \
323 echo " $$RESULT"; \
324 if [ "$$FAILED" != "" ]; \
325 then \
326 echo "**** Failed ***************"; \
327 RETURN=1; \
328 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000329 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000330 done; \
331 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000332endif