blob: f32a4e6005051c066689fc9c8003c0f40b2965fa [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 \
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +020040 test_suite_gcm.aes128_de \
41 test_suite_gcm.aes192_de \
42 test_suite_gcm.aes256_de \
43 test_suite_gcm.aes128_en \
44 test_suite_gcm.aes192_en \
45 test_suite_gcm.aes256_en \
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +020046 test_suite_gcm.camellia test_suite_hmac_shax \
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +010047 test_suite_hmac_drbg.no_reseed \
Paul Bakker9d781402011-05-09 16:17:09 +000048 test_suite_md test_suite_mdx \
Paul Bakkerf518b162012-08-23 13:03:18 +000049 test_suite_mpi test_suite_pbkdf2 \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020050 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020051 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020052 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000053 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000054 test_suite_x509parse test_suite_x509write \
55 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000056
57.SILENT:
58
59all: $(APPS)
60
Paul Bakker19343182013-08-16 13:31:10 +020061test_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 +020062 echo " Generate $@"
63 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
64
Paul Bakker19343182013-08-16 13:31:10 +020065test_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 +020066 echo " Generate $@"
67 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
68
Paul Bakker19343182013-08-16 13:31:10 +020069test_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 +020070 echo " Generate $@"
71 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
72
Paul Bakker19343182013-08-16 13:31:10 +020073test_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 +020074 echo " Generate $@"
75 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
76
Paul Bakker19343182013-08-16 13:31:10 +020077test_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 +000078 echo " Generate $@"
79 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
80
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020081test_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
82 echo " Generate $@"
83 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
84
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020085test_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
86 echo " Generate $@"
87 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
88
Paul Bakker19343182013-08-16 13:31:10 +020089test_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 +000090 echo " Generate $@"
91 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
92
Paul Bakker19343182013-08-16 13:31:10 +020093test_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 +000094 echo " Generate $@"
95 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
96
Paul Bakker19343182013-08-16 13:31:10 +020097test_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 +000098 echo " Generate $@"
99 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
100
Paul Bakker19343182013-08-16 13:31:10 +0200101test_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 +0000102 echo " Generate $@"
103 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
104
Paul Bakker19343182013-08-16 13:31:10 +0200105test_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 +0200106 echo " Generate $@"
107 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
108
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200109test_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 +0000110 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200111 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000112
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200113test_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 +0000114 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200115 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200116
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200117test_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 +0200118 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200119 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200120
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200121test_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 +0200122 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200123 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200124
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200125test_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 +0200126 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200127 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200128
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200129test_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 +0200130 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200131 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000132
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200133test_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
134 echo " Generate $@"
135 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000136
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100137test_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
138 echo " Generate $@"
139 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
140
Paul Bakker19343182013-08-16 13:31:10 +0200141%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000142 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000143 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000144
Paul Bakker286bf3c2013-04-08 18:09:51 +0200145test_suite_aes.ecb: test_suite_aes.ecb.c ../library/libpolarssl.a
146 echo " CC $@.c"
147 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
148
149test_suite_aes.cbc: test_suite_aes.cbc.c ../library/libpolarssl.a
150 echo " CC $@.c"
151 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
152
153test_suite_aes.cfb: test_suite_aes.cfb.c ../library/libpolarssl.a
154 echo " CC $@.c"
155 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
156
157test_suite_aes.rest: test_suite_aes.rest.c ../library/libpolarssl.a
Paul Bakker0049c2f2009-07-11 19:15:43 +0000158 echo " CC $@.c"
159 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
160
161test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
162 echo " CC $@.c"
163 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
164
165test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
166 echo " CC $@.c"
167 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
168
Paul Bakkera9379c02012-07-04 11:02:11 +0000169test_suite_blowfish: test_suite_blowfish.c ../library/libpolarssl.a
170 echo " CC $@.c"
171 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
172
Paul Bakker0049c2f2009-07-11 19:15:43 +0000173test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
174 echo " CC $@.c"
175 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
176
Paul Bakker46c17942011-07-13 14:54:54 +0000177test_suite_cipher.aes: test_suite_cipher.aes.c ../library/libpolarssl.a
178 echo " CC $@.c"
179 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
180
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200181test_suite_cipher.arc4: test_suite_cipher.arc4.c ../library/libpolarssl.a
182 echo " CC $@.c"
183 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
184
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200185test_suite_cipher.gcm: test_suite_cipher.gcm.c ../library/libpolarssl.a
186 echo " CC $@.c"
187 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
188
Paul Bakker6132d0a2012-07-04 17:10:40 +0000189test_suite_cipher.blowfish: test_suite_cipher.blowfish.c ../library/libpolarssl.a
190 echo " CC $@.c"
191 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
192
Paul Bakker46c17942011-07-13 14:54:54 +0000193test_suite_cipher.camellia: test_suite_cipher.camellia.c ../library/libpolarssl.a
194 echo " CC $@.c"
195 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
196
Paul Bakkerfab5c822012-02-06 16:45:10 +0000197test_suite_cipher.des: test_suite_cipher.des.c ../library/libpolarssl.a
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000198 echo " CC $@.c"
199 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
200
Paul Bakkerfab5c822012-02-06 16:45:10 +0000201test_suite_cipher.null: test_suite_cipher.null.c ../library/libpolarssl.a
202 echo " CC $@.c"
203 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
204
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200205test_suite_cipher.padding: test_suite_cipher.padding.c ../library/libpolarssl.a
206 echo " CC $@.c"
207 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
208
Paul Bakkerfab5c822012-02-06 16:45:10 +0000209test_suite_ctr_drbg: test_suite_ctr_drbg.c ../library/libpolarssl.a
Paul Bakker8123e9d2011-01-06 15:37:30 +0000210 echo " CC $@.c"
211 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
212
Paul Bakker0049c2f2009-07-11 19:15:43 +0000213test_suite_des: test_suite_des.c ../library/libpolarssl.a
214 echo " CC $@.c"
215 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
216
217test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
218 echo " CC $@.c"
219 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
220
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100221test_suite_ecdh: test_suite_ecdh.c ../library/libpolarssl.a
222 echo " CC $@.c"
223 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
224
225test_suite_ecdsa: test_suite_ecdsa.c ../library/libpolarssl.a
226 echo " CC $@.c"
227 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
228
Paul Bakkera95919b2013-01-16 17:00:05 +0100229test_suite_ecp: test_suite_ecp.c ../library/libpolarssl.a
230 echo " CC $@.c"
231 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
232
Paul Bakker9d781402011-05-09 16:17:09 +0000233test_suite_error: test_suite_error.c ../library/libpolarssl.a
234 echo " CC $@.c"
235 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
236
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200237test_suite_gcm.aes128_de: test_suite_gcm.aes128_de.c ../library/libpolarssl.a
Paul Bakker89e80c92012-03-20 13:50:09 +0000238 echo " CC $@.c"
239 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
240
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200241test_suite_gcm.aes192_de: test_suite_gcm.aes192_de.c ../library/libpolarssl.a
Paul Bakker286bf3c2013-04-08 18:09:51 +0200242 echo " CC $@.c"
243 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
244
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200245test_suite_gcm.aes256_de: test_suite_gcm.aes256_de.c ../library/libpolarssl.a
Paul Bakker286bf3c2013-04-08 18:09:51 +0200246 echo " CC $@.c"
247 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
248
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200249test_suite_gcm.aes128_en: test_suite_gcm.aes128_en.c ../library/libpolarssl.a
Paul Bakker286bf3c2013-04-08 18:09:51 +0200250 echo " CC $@.c"
251 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
252
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200253test_suite_gcm.aes192_en: test_suite_gcm.aes192_en.c ../library/libpolarssl.a
Paul Bakker286bf3c2013-04-08 18:09:51 +0200254 echo " CC $@.c"
255 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
256
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200257test_suite_gcm.aes256_en: test_suite_gcm.aes256_en.c ../library/libpolarssl.a
Paul Bakker89e80c92012-03-20 13:50:09 +0000258 echo " CC $@.c"
259 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
260
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200261test_suite_gcm.camellia: test_suite_gcm.camellia.c ../library/libpolarssl.a
Paul Bakker0049c2f2009-07-11 19:15:43 +0000262 echo " CC $@.c"
263 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000264
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100265test_suite_hmac_drbg.no_reseed: test_suite_hmac_drbg.no_reseed.c ../library/libpolarssl.a
266 echo " CC $@.c"
267 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
268
Paul Bakker0049c2f2009-07-11 19:15:43 +0000269test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
270 echo " CC $@.c"
271 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
272
273test_suite_md: test_suite_md.c ../library/libpolarssl.a
274 echo " CC $@.c"
275 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
276
277test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
278 echo " CC $@.c"
279 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
280
281test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
282 echo " CC $@.c"
283 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
284
Paul Bakkerf518b162012-08-23 13:03:18 +0000285test_suite_pbkdf2: test_suite_pbkdf2.c ../library/libpolarssl.a
286 echo " CC $@.c"
287 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
288
Paul Bakker9dcc3222011-03-08 14:16:06 +0000289test_suite_pkcs1_v21: test_suite_pkcs1_v21.c ../library/libpolarssl.a
290 echo " CC $@.c"
291 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
292
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200293test_suite_pkcs5: test_suite_pkcs5.c ../library/libpolarssl.a
294 echo " CC $@.c"
295 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
296
Paul Bakker1a7550a2013-09-15 13:01:22 +0200297test_suite_pkparse: test_suite_pkparse.c ../library/libpolarssl.a
298 echo " CC $@.c"
299 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
300
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200301test_suite_pkwrite: test_suite_pkwrite.c ../library/libpolarssl.a
302 echo " CC $@.c"
303 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
304
Paul Bakker32925622013-10-28 17:32:48 +0100305test_suite_pk: test_suite_pk.c ../library/libpolarssl.a
306 echo " CC $@.c"
307 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
308
Paul Bakker0049c2f2009-07-11 19:15:43 +0000309test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
310 echo " CC $@.c"
311 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
312
313test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
314 echo " CC $@.c"
315 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
316
317test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
318 echo " CC $@.c"
319 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
320
Paul Bakker6d620502012-02-16 14:09:13 +0000321test_suite_x509write: test_suite_x509write.c ../library/libpolarssl.a
322 echo " CC $@.c"
323 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
324
Paul Bakker0049c2f2009-07-11 19:15:43 +0000325test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
326 echo " CC $@.c"
327 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
328
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000329test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
330 echo " CC $@.c"
331 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
332
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000333test_suite_version: test_suite_version.c ../library/libpolarssl.a
334 echo " CC $@.c"
335 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
336
Paul Bakker0049c2f2009-07-11 19:15:43 +0000337clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000338ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000339 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000340endif
341ifdef WINDOWS
342 del /Q /F *.c *.exe
343endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000344
Paul Bakker9794cb42009-07-28 18:55:00 +0000345check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000346ifndef WINDOWS
Paul Bakkerd14cd352012-05-08 15:39:50 +0000347 echo "Running checks (Success if all tests PASSED)"
348 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000349 for i in $(APPS); \
350 do \
351 echo " - $${i}"; \
Paul Bakker667086b2013-08-20 23:11:06 +0200352 RESULT=`./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000353 FAILED=`echo $$RESULT |grep FAILED`; \
354 echo " $$RESULT"; \
355 if [ "$$FAILED" != "" ]; \
356 then \
357 echo "**** Failed ***************"; \
358 RETURN=1; \
359 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000360 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000361 done; \
362 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000363endif