blob: ce458ca07c5eafb9775de7654c0d6fc688c7dcde [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 \
Paul Bakker6132d0a2012-07-04 17:10:40 +000037 test_suite_camellia test_suite_cipher.aes \
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020038 test_suite_cipher.arc4 test_suite_cipher.gcm \
Paul Bakker6132d0a2012-07-04 17:10:40 +000039 test_suite_cipher.blowfish \
40 test_suite_cipher.camellia \
Paul Bakkerfab5c822012-02-06 16:45:10 +000041 test_suite_cipher.des test_suite_cipher.null \
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +020042 test_suite_cipher.padding \
Paul Bakkerfab5c822012-02-06 16:45:10 +000043 test_suite_ctr_drbg test_suite_debug \
Paul Bakker9d781402011-05-09 16:17:09 +000044 test_suite_des test_suite_dhm \
Paul Bakkerd589a0d2013-03-13 16:30:17 +010045 test_suite_ecdh test_suite_ecdsa \
Paul Bakkera95919b2013-01-16 17:00:05 +010046 test_suite_ecp \
Paul Bakker286bf3c2013-04-08 18:09:51 +020047 test_suite_error \
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +020048 test_suite_gcm.aes128_de \
49 test_suite_gcm.aes192_de \
50 test_suite_gcm.aes256_de \
51 test_suite_gcm.aes128_en \
52 test_suite_gcm.aes192_en \
53 test_suite_gcm.aes256_en \
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +020054 test_suite_gcm.camellia test_suite_hmac_shax \
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +010055 test_suite_hmac_drbg.misc \
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +010056 test_suite_hmac_drbg.no_reseed \
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +010057 test_suite_hmac_drbg.nopr \
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +010058 test_suite_hmac_drbg.pr \
Paul Bakker9d781402011-05-09 16:17:09 +000059 test_suite_md test_suite_mdx \
Paul Bakkerf518b162012-08-23 13:03:18 +000060 test_suite_mpi test_suite_pbkdf2 \
Paul Bakker16300582014-04-11 13:28:43 +020061 test_suite_pem \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020062 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020063 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020064 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000065 test_suite_rsa test_suite_shax \
Paul Bakker6d620502012-02-16 14:09:13 +000066 test_suite_x509parse test_suite_x509write \
67 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000068
69.SILENT:
70
71all: $(APPS)
72
Paul Bakker19343182013-08-16 13:31:10 +020073test_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 +020074 echo " Generate $@"
75 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
76
Paul Bakker19343182013-08-16 13:31:10 +020077test_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 +020078 echo " Generate $@"
79 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
80
Paul Bakker19343182013-08-16 13:31:10 +020081test_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 +020082 echo " Generate $@"
83 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
84
Paul Bakker19343182013-08-16 13:31:10 +020085test_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 +020086 echo " Generate $@"
87 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
88
Paul Bakker19343182013-08-16 13:31:10 +020089test_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 +000090 echo " Generate $@"
91 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
92
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020093test_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
94 echo " Generate $@"
95 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
96
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +020097test_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
98 echo " Generate $@"
99 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
100
Paul Bakker19343182013-08-16 13:31:10 +0200101test_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 +0000102 echo " Generate $@"
103 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
104
Paul Bakker19343182013-08-16 13:31:10 +0200105test_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 +0000106 echo " Generate $@"
107 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
108
Paul Bakker19343182013-08-16 13:31:10 +0200109test_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 +0000110 echo " Generate $@"
111 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
112
Paul Bakker19343182013-08-16 13:31:10 +0200113test_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 +0000114 echo " Generate $@"
115 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
116
Paul Bakker19343182013-08-16 13:31:10 +0200117test_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 +0200118 echo " Generate $@"
119 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
120
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200121test_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 +0000122 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200123 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000124
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200125test_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 +0000126 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200127 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200128
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200129test_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 +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_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200132
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200133test_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 +0200134 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200135 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200136
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200137test_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 +0200138 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200139 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200140
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200141test_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 +0200142 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200143 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000144
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200145test_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
146 echo " Generate $@"
147 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000148
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100149test_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
150 echo " Generate $@"
151 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
152
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100153test_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
154 echo " Generate $@"
155 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
156
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100157test_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
158 echo " Generate $@"
159 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
160
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100161test_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
162 echo " Generate $@"
163 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
164
Paul Bakker19343182013-08-16 13:31:10 +0200165%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000166 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000167 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000168
Paul Bakker674e0b02014-03-26 13:26:52 +0100169test_suite_aes.ecb: test_suite_aes.ecb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200170 echo " CC $@.c"
171 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
172
Paul Bakker674e0b02014-03-26 13:26:52 +0100173test_suite_aes.cbc: test_suite_aes.cbc.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200174 echo " CC $@.c"
175 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
176
Paul Bakker674e0b02014-03-26 13:26:52 +0100177test_suite_aes.cfb: test_suite_aes.cfb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200178 echo " CC $@.c"
179 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
180
Paul Bakker674e0b02014-03-26 13:26:52 +0100181test_suite_aes.rest: test_suite_aes.rest.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000182 echo " CC $@.c"
183 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
184
Paul Bakker674e0b02014-03-26 13:26:52 +0100185test_suite_arc4: test_suite_arc4.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000186 echo " CC $@.c"
187 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
188
Paul Bakker674e0b02014-03-26 13:26:52 +0100189test_suite_base64: test_suite_base64.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000190 echo " CC $@.c"
191 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
192
Paul Bakker674e0b02014-03-26 13:26:52 +0100193test_suite_blowfish: test_suite_blowfish.c $(DEP)
Paul Bakkera9379c02012-07-04 11:02:11 +0000194 echo " CC $@.c"
195 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
196
Paul Bakker674e0b02014-03-26 13:26:52 +0100197test_suite_camellia: test_suite_camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000198 echo " CC $@.c"
199 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
200
Paul Bakker674e0b02014-03-26 13:26:52 +0100201test_suite_cipher.aes: test_suite_cipher.aes.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000202 echo " CC $@.c"
203 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
204
Paul Bakker674e0b02014-03-26 13:26:52 +0100205test_suite_cipher.arc4: test_suite_cipher.arc4.c $(DEP)
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200206 echo " CC $@.c"
207 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
208
Paul Bakker674e0b02014-03-26 13:26:52 +0100209test_suite_cipher.gcm: test_suite_cipher.gcm.c $(DEP)
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200210 echo " CC $@.c"
211 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
212
Paul Bakker674e0b02014-03-26 13:26:52 +0100213test_suite_cipher.blowfish: test_suite_cipher.blowfish.c $(DEP)
Paul Bakker6132d0a2012-07-04 17:10:40 +0000214 echo " CC $@.c"
215 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
216
Paul Bakker674e0b02014-03-26 13:26:52 +0100217test_suite_cipher.camellia: test_suite_cipher.camellia.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000218 echo " CC $@.c"
219 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
220
Paul Bakker674e0b02014-03-26 13:26:52 +0100221test_suite_cipher.des: test_suite_cipher.des.c $(DEP)
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000222 echo " CC $@.c"
223 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
224
Paul Bakker674e0b02014-03-26 13:26:52 +0100225test_suite_cipher.null: test_suite_cipher.null.c $(DEP)
Paul Bakkerfab5c822012-02-06 16:45:10 +0000226 echo " CC $@.c"
227 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
228
Paul Bakker674e0b02014-03-26 13:26:52 +0100229test_suite_cipher.padding: test_suite_cipher.padding.c $(DEP)
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200230 echo " CC $@.c"
231 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
232
Paul Bakker674e0b02014-03-26 13:26:52 +0100233test_suite_ctr_drbg: test_suite_ctr_drbg.c $(DEP)
Paul Bakker8123e9d2011-01-06 15:37:30 +0000234 echo " CC $@.c"
235 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
236
Paul Bakker674e0b02014-03-26 13:26:52 +0100237test_suite_des: test_suite_des.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000238 echo " CC $@.c"
239 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
240
Paul Bakker674e0b02014-03-26 13:26:52 +0100241test_suite_dhm: test_suite_dhm.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000242 echo " CC $@.c"
243 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
244
Paul Bakker674e0b02014-03-26 13:26:52 +0100245test_suite_ecdh: test_suite_ecdh.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100246 echo " CC $@.c"
247 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
248
Paul Bakker674e0b02014-03-26 13:26:52 +0100249test_suite_ecdsa: test_suite_ecdsa.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100250 echo " CC $@.c"
251 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
252
Paul Bakker674e0b02014-03-26 13:26:52 +0100253test_suite_ecp: test_suite_ecp.c $(DEP)
Paul Bakkera95919b2013-01-16 17:00:05 +0100254 echo " CC $@.c"
255 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
256
Paul Bakker674e0b02014-03-26 13:26:52 +0100257test_suite_error: test_suite_error.c $(DEP)
Paul Bakker9d781402011-05-09 16:17:09 +0000258 echo " CC $@.c"
259 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
260
Paul Bakker674e0b02014-03-26 13:26:52 +0100261test_suite_gcm.aes128_de: test_suite_gcm.aes128_de.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000262 echo " CC $@.c"
263 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
264
Paul Bakker674e0b02014-03-26 13:26:52 +0100265test_suite_gcm.aes192_de: test_suite_gcm.aes192_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200266 echo " CC $@.c"
267 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
268
Paul Bakker674e0b02014-03-26 13:26:52 +0100269test_suite_gcm.aes256_de: test_suite_gcm.aes256_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200270 echo " CC $@.c"
271 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
272
Paul Bakker674e0b02014-03-26 13:26:52 +0100273test_suite_gcm.aes128_en: test_suite_gcm.aes128_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200274 echo " CC $@.c"
275 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
276
Paul Bakker674e0b02014-03-26 13:26:52 +0100277test_suite_gcm.aes192_en: test_suite_gcm.aes192_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200278 echo " CC $@.c"
279 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
280
Paul Bakker674e0b02014-03-26 13:26:52 +0100281test_suite_gcm.aes256_en: test_suite_gcm.aes256_en.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000282 echo " CC $@.c"
283 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
284
Paul Bakker674e0b02014-03-26 13:26:52 +0100285test_suite_gcm.camellia: test_suite_gcm.camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000286 echo " CC $@.c"
287 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000288
Paul Bakker674e0b02014-03-26 13:26:52 +0100289test_suite_hmac_drbg.misc: test_suite_hmac_drbg.misc.c $(DEP)
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100290 echo " CC $@.c"
291 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
292
Paul Bakker674e0b02014-03-26 13:26:52 +0100293test_suite_hmac_drbg.no_reseed: test_suite_hmac_drbg.no_reseed.c $(DEP)
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100294 echo " CC $@.c"
295 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
296
Paul Bakker674e0b02014-03-26 13:26:52 +0100297test_suite_hmac_drbg.nopr: test_suite_hmac_drbg.nopr.c $(DEP)
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100298 echo " CC $@.c"
299 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
300
Paul Bakker674e0b02014-03-26 13:26:52 +0100301test_suite_hmac_drbg.pr: test_suite_hmac_drbg.pr.c $(DEP)
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100302 echo " CC $@.c"
303 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
304
Paul Bakker674e0b02014-03-26 13:26:52 +0100305test_suite_hmac_shax: test_suite_hmac_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000306 echo " CC $@.c"
307 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
308
Paul Bakker674e0b02014-03-26 13:26:52 +0100309test_suite_md: test_suite_md.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000310 echo " CC $@.c"
311 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
312
Paul Bakker674e0b02014-03-26 13:26:52 +0100313test_suite_mdx: test_suite_mdx.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000314 echo " CC $@.c"
315 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
316
Paul Bakker674e0b02014-03-26 13:26:52 +0100317test_suite_mpi: test_suite_mpi.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000318 echo " CC $@.c"
319 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
320
Paul Bakker674e0b02014-03-26 13:26:52 +0100321test_suite_pbkdf2: test_suite_pbkdf2.c $(DEP)
Paul Bakkerf518b162012-08-23 13:03:18 +0000322 echo " CC $@.c"
323 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
324
Paul Bakker16300582014-04-11 13:28:43 +0200325test_suite_pem: test_suite_pem.c $(DEP)
326 echo " CC $@.c"
327 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
328
Paul Bakker674e0b02014-03-26 13:26:52 +0100329test_suite_pkcs1_v21: test_suite_pkcs1_v21.c $(DEP)
Paul Bakker9dcc3222011-03-08 14:16:06 +0000330 echo " CC $@.c"
331 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
332
Paul Bakker674e0b02014-03-26 13:26:52 +0100333test_suite_pkcs5: test_suite_pkcs5.c $(DEP)
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200334 echo " CC $@.c"
335 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
336
Paul Bakker674e0b02014-03-26 13:26:52 +0100337test_suite_pkparse: test_suite_pkparse.c $(DEP)
Paul Bakker1a7550a2013-09-15 13:01:22 +0200338 echo " CC $@.c"
339 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
340
Paul Bakker674e0b02014-03-26 13:26:52 +0100341test_suite_pkwrite: test_suite_pkwrite.c $(DEP)
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200342 echo " CC $@.c"
343 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
344
Paul Bakker674e0b02014-03-26 13:26:52 +0100345test_suite_pk: test_suite_pk.c $(DEP)
Paul Bakker32925622013-10-28 17:32:48 +0100346 echo " CC $@.c"
347 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
348
Paul Bakker674e0b02014-03-26 13:26:52 +0100349test_suite_rsa: test_suite_rsa.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000350 echo " CC $@.c"
351 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
352
Paul Bakker674e0b02014-03-26 13:26:52 +0100353test_suite_shax: test_suite_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000354 echo " CC $@.c"
355 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
356
Paul Bakker674e0b02014-03-26 13:26:52 +0100357test_suite_x509parse: test_suite_x509parse.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000358 echo " CC $@.c"
359 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
360
Paul Bakker674e0b02014-03-26 13:26:52 +0100361test_suite_x509write: test_suite_x509write.c $(DEP)
Paul Bakker6d620502012-02-16 14:09:13 +0000362 echo " CC $@.c"
363 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
364
Paul Bakker674e0b02014-03-26 13:26:52 +0100365test_suite_xtea: test_suite_xtea.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000366 echo " CC $@.c"
367 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
368
Paul Bakker674e0b02014-03-26 13:26:52 +0100369test_suite_debug: test_suite_debug.c $(DEP)
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000370 echo " CC $@.c"
371 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
372
Paul Bakker674e0b02014-03-26 13:26:52 +0100373test_suite_version: test_suite_version.c $(DEP)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000374 echo " CC $@.c"
375 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
376
Paul Bakker0049c2f2009-07-11 19:15:43 +0000377clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000378ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000379 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000380endif
381ifdef WINDOWS
382 del /Q /F *.c *.exe
383endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000384
Paul Bakker9794cb42009-07-28 18:55:00 +0000385check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000386ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100387 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000388 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000389 for i in $(APPS); \
390 do \
391 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100392 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000393 FAILED=`echo $$RESULT |grep FAILED`; \
394 echo " $$RESULT"; \
395 if [ "$$FAILED" != "" ]; \
396 then \
397 echo "**** Failed ***************"; \
398 RETURN=1; \
399 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000400 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000401 done; \
402 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000403endif