blob: 0bd6ee9a911c2be0478153150ba90a4d3c74f258 [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
Manuel Pégourié-Gonnard6a4ae352015-01-27 14:03:24 +010010LDFLAGS += -L../library -lmbedtls $(SYS_LDFLAGS)
Paul Bakker0049c2f2009-07-11 19:15:43 +000011
Paul Bakker674e0b02014-03-26 13:26:52 +010012ifndef SHARED
Manuel Pégourié-Gonnardc26a0922015-01-23 12:51:33 +000013DEP=../library/libmbedtls.a
Paul Bakker674e0b02014-03-26 13:26:52 +010014CHECK_PRELOAD=
15else
Manuel Pégourié-Gonnard6a4ae352015-01-27 14:03:24 +010016DEP=../library/libmbedtls.so
17CHECK_PRELOAD= LD_PRELOAD=../library/libmbedtls.so
Paul Bakker674e0b02014-03-26 13:26:52 +010018endif
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 \
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +020049 test_suite_error test_suite_entropy \
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 \
Manuel Pégourié-Gonnard765bb312014-11-27 11:55:27 +010062 test_suite_memory_buffer_alloc \
Paul Bakkerf518b162012-08-23 13:03:18 +000063 test_suite_mpi test_suite_pbkdf2 \
Paul Bakker16300582014-04-11 13:28:43 +020064 test_suite_pem \
Paul Bakkerb0c19a42013-06-24 19:26:38 +020065 test_suite_pkcs1_v21 test_suite_pkcs5 \
Paul Bakkerc7bb02b2013-09-15 14:54:56 +020066 test_suite_pkparse test_suite_pkwrite \
Manuel Pégourié-Gonnardb0a467f2013-09-21 12:31:05 +020067 test_suite_pk \
Paul Bakker9d781402011-05-09 16:17:09 +000068 test_suite_rsa test_suite_shax \
Manuel Pégourié-Gonnard4956fd72014-09-24 11:13:44 +020069 test_suite_ssl \
Paul Bakker6d620502012-02-16 14:09:13 +000070 test_suite_x509parse test_suite_x509write \
71 test_suite_xtea test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000072
73.SILENT:
74
75all: $(APPS)
76
Paul Bakker19343182013-08-16 13:31:10 +020077test_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 +020078 echo " Generate $@"
79 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
80
Paul Bakker19343182013-08-16 13:31:10 +020081test_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 +020082 echo " Generate $@"
83 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
84
Paul Bakker19343182013-08-16 13:31:10 +020085test_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 +020086 echo " Generate $@"
87 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
88
Paul Bakker19343182013-08-16 13:31:10 +020089test_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 +020090 echo " Generate $@"
91 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
92
Paul Bakker19343182013-08-16 13:31:10 +020093test_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 +000094 echo " Generate $@"
95 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
96
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +020097test_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
98 echo " Generate $@"
99 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
100
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200101test_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
102 echo " Generate $@"
103 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.ccm
104
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200105test_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
106 echo " Generate $@"
107 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
108
Paul Bakker19343182013-08-16 13:31:10 +0200109test_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 +0000110 echo " Generate $@"
111 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
112
Paul Bakker19343182013-08-16 13:31:10 +0200113test_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 +0000114 echo " Generate $@"
115 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
116
Paul Bakker19343182013-08-16 13:31:10 +0200117test_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 +0000118 echo " Generate $@"
119 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
120
Paul Bakker19343182013-08-16 13:31:10 +0200121test_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 +0000122 echo " Generate $@"
123 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
124
Paul Bakker19343182013-08-16 13:31:10 +0200125test_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 +0200126 echo " Generate $@"
127 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
128
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200129test_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 +0000130 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200131 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000132
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200133test_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 +0000134 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200135 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200136
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200137test_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 +0200138 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200139 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200140
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200141test_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 +0200142 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200143 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200144
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200145test_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 +0200146 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200147 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200148
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200149test_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 +0200150 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200151 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000152
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200153test_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
154 echo " Generate $@"
155 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000156
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100157test_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
158 echo " Generate $@"
159 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
160
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100161test_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
162 echo " Generate $@"
163 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
164
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100165test_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
166 echo " Generate $@"
167 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
168
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100169test_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
170 echo " Generate $@"
171 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
172
Paul Bakker19343182013-08-16 13:31:10 +0200173%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000174 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000175 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000176
Paul Bakker674e0b02014-03-26 13:26:52 +0100177test_suite_aes.ecb: test_suite_aes.ecb.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.cbc: test_suite_aes.cbc.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200182 echo " CC $@.c"
183 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
184
Paul Bakker674e0b02014-03-26 13:26:52 +0100185test_suite_aes.cfb: test_suite_aes.cfb.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200186 echo " CC $@.c"
187 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
188
Paul Bakker674e0b02014-03-26 13:26:52 +0100189test_suite_aes.rest: test_suite_aes.rest.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_arc4: test_suite_arc4.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000194 echo " CC $@.c"
195 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
196
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +0200197test_suite_asn1write: test_suite_asn1write.c $(DEP)
198 echo " CC $@.c"
199 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
200
Paul Bakker674e0b02014-03-26 13:26:52 +0100201test_suite_base64: test_suite_base64.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000202 echo " CC $@.c"
203 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
204
Paul Bakker674e0b02014-03-26 13:26:52 +0100205test_suite_blowfish: test_suite_blowfish.c $(DEP)
Paul Bakkera9379c02012-07-04 11:02:11 +0000206 echo " CC $@.c"
207 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
208
Paul Bakker674e0b02014-03-26 13:26:52 +0100209test_suite_camellia: test_suite_camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000210 echo " CC $@.c"
211 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
212
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +0200213test_suite_ccm: test_suite_ccm.c $(DEP)
214 echo " CC $@.c"
215 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
216
Paul Bakker674e0b02014-03-26 13:26:52 +0100217test_suite_cipher.aes: test_suite_cipher.aes.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.arc4: test_suite_cipher.arc4.c $(DEP)
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200222 echo " CC $@.c"
223 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
224
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200225test_suite_cipher.ccm: test_suite_cipher.ccm.c $(DEP)
226 echo " CC $@.c"
227 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
228
Paul Bakker674e0b02014-03-26 13:26:52 +0100229test_suite_cipher.gcm: test_suite_cipher.gcm.c $(DEP)
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200230 echo " CC $@.c"
231 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
232
Paul Bakker674e0b02014-03-26 13:26:52 +0100233test_suite_cipher.blowfish: test_suite_cipher.blowfish.c $(DEP)
Paul Bakker6132d0a2012-07-04 17:10:40 +0000234 echo " CC $@.c"
235 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
236
Paul Bakker674e0b02014-03-26 13:26:52 +0100237test_suite_cipher.camellia: test_suite_cipher.camellia.c $(DEP)
Paul Bakker46c17942011-07-13 14:54:54 +0000238 echo " CC $@.c"
239 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
240
Paul Bakker674e0b02014-03-26 13:26:52 +0100241test_suite_cipher.des: test_suite_cipher.des.c $(DEP)
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000242 echo " CC $@.c"
243 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
244
Paul Bakker674e0b02014-03-26 13:26:52 +0100245test_suite_cipher.null: test_suite_cipher.null.c $(DEP)
Paul Bakkerfab5c822012-02-06 16:45:10 +0000246 echo " CC $@.c"
247 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
248
Paul Bakker674e0b02014-03-26 13:26:52 +0100249test_suite_cipher.padding: test_suite_cipher.padding.c $(DEP)
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200250 echo " CC $@.c"
251 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
252
Paul Bakker674e0b02014-03-26 13:26:52 +0100253test_suite_ctr_drbg: test_suite_ctr_drbg.c $(DEP)
Paul Bakker8123e9d2011-01-06 15:37:30 +0000254 echo " CC $@.c"
255 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
256
Paul Bakker674e0b02014-03-26 13:26:52 +0100257test_suite_des: test_suite_des.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000258 echo " CC $@.c"
259 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
260
Paul Bakker674e0b02014-03-26 13:26:52 +0100261test_suite_dhm: test_suite_dhm.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000262 echo " CC $@.c"
263 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
264
Paul Bakker674e0b02014-03-26 13:26:52 +0100265test_suite_ecdh: test_suite_ecdh.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100266 echo " CC $@.c"
267 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
268
Paul Bakker674e0b02014-03-26 13:26:52 +0100269test_suite_ecdsa: test_suite_ecdsa.c $(DEP)
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100270 echo " CC $@.c"
271 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
272
Paul Bakker674e0b02014-03-26 13:26:52 +0100273test_suite_ecp: test_suite_ecp.c $(DEP)
Paul Bakkera95919b2013-01-16 17:00:05 +0100274 echo " CC $@.c"
275 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
276
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200277test_suite_entropy: test_suite_entropy.c $(DEP)
278 echo " CC $@.c"
279 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
280
Paul Bakker674e0b02014-03-26 13:26:52 +0100281test_suite_error: test_suite_error.c $(DEP)
Paul Bakker9d781402011-05-09 16:17:09 +0000282 echo " CC $@.c"
283 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
284
Paul Bakker674e0b02014-03-26 13:26:52 +0100285test_suite_gcm.aes128_de: test_suite_gcm.aes128_de.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000286 echo " CC $@.c"
287 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
288
Paul Bakker674e0b02014-03-26 13:26:52 +0100289test_suite_gcm.aes192_de: test_suite_gcm.aes192_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200290 echo " CC $@.c"
291 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
292
Paul Bakker674e0b02014-03-26 13:26:52 +0100293test_suite_gcm.aes256_de: test_suite_gcm.aes256_de.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200294 echo " CC $@.c"
295 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
296
Paul Bakker674e0b02014-03-26 13:26:52 +0100297test_suite_gcm.aes128_en: test_suite_gcm.aes128_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200298 echo " CC $@.c"
299 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
300
Paul Bakker674e0b02014-03-26 13:26:52 +0100301test_suite_gcm.aes192_en: test_suite_gcm.aes192_en.c $(DEP)
Paul Bakker286bf3c2013-04-08 18:09:51 +0200302 echo " CC $@.c"
303 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
304
Paul Bakker674e0b02014-03-26 13:26:52 +0100305test_suite_gcm.aes256_en: test_suite_gcm.aes256_en.c $(DEP)
Paul Bakker89e80c92012-03-20 13:50:09 +0000306 echo " CC $@.c"
307 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
308
Paul Bakker674e0b02014-03-26 13:26:52 +0100309test_suite_gcm.camellia: test_suite_gcm.camellia.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000310 echo " CC $@.c"
311 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000312
Paul Bakker674e0b02014-03-26 13:26:52 +0100313test_suite_hmac_drbg.misc: test_suite_hmac_drbg.misc.c $(DEP)
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100314 echo " CC $@.c"
315 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
316
Paul Bakker674e0b02014-03-26 13:26:52 +0100317test_suite_hmac_drbg.no_reseed: test_suite_hmac_drbg.no_reseed.c $(DEP)
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100318 echo " CC $@.c"
319 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
320
Paul Bakker674e0b02014-03-26 13:26:52 +0100321test_suite_hmac_drbg.nopr: test_suite_hmac_drbg.nopr.c $(DEP)
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100322 echo " CC $@.c"
323 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
324
Paul Bakker674e0b02014-03-26 13:26:52 +0100325test_suite_hmac_drbg.pr: test_suite_hmac_drbg.pr.c $(DEP)
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100326 echo " CC $@.c"
327 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
328
Paul Bakker674e0b02014-03-26 13:26:52 +0100329test_suite_hmac_shax: test_suite_hmac_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000330 echo " CC $@.c"
331 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
332
Paul Bakker674e0b02014-03-26 13:26:52 +0100333test_suite_md: test_suite_md.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000334 echo " CC $@.c"
335 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
336
Paul Bakker674e0b02014-03-26 13:26:52 +0100337test_suite_mdx: test_suite_mdx.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000338 echo " CC $@.c"
339 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
340
Manuel Pégourié-Gonnard765bb312014-11-27 11:55:27 +0100341test_suite_memory_buffer_alloc: test_suite_memory_buffer_alloc.c $(DEP)
342 echo " CC $@.c"
343 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
344
Paul Bakker674e0b02014-03-26 13:26:52 +0100345test_suite_mpi: test_suite_mpi.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000346 echo " CC $@.c"
347 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
348
Paul Bakker674e0b02014-03-26 13:26:52 +0100349test_suite_pbkdf2: test_suite_pbkdf2.c $(DEP)
Paul Bakkerf518b162012-08-23 13:03:18 +0000350 echo " CC $@.c"
351 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
352
Paul Bakker16300582014-04-11 13:28:43 +0200353test_suite_pem: test_suite_pem.c $(DEP)
354 echo " CC $@.c"
355 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
356
Paul Bakker674e0b02014-03-26 13:26:52 +0100357test_suite_pkcs1_v21: test_suite_pkcs1_v21.c $(DEP)
Paul Bakker9dcc3222011-03-08 14:16:06 +0000358 echo " CC $@.c"
359 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
360
Paul Bakker674e0b02014-03-26 13:26:52 +0100361test_suite_pkcs5: test_suite_pkcs5.c $(DEP)
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200362 echo " CC $@.c"
363 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
364
Paul Bakker674e0b02014-03-26 13:26:52 +0100365test_suite_pkparse: test_suite_pkparse.c $(DEP)
Paul Bakker1a7550a2013-09-15 13:01:22 +0200366 echo " CC $@.c"
367 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
368
Paul Bakker674e0b02014-03-26 13:26:52 +0100369test_suite_pkwrite: test_suite_pkwrite.c $(DEP)
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200370 echo " CC $@.c"
371 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
372
Paul Bakker674e0b02014-03-26 13:26:52 +0100373test_suite_pk: test_suite_pk.c $(DEP)
Paul Bakker32925622013-10-28 17:32:48 +0100374 echo " CC $@.c"
375 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
376
Paul Bakker674e0b02014-03-26 13:26:52 +0100377test_suite_rsa: test_suite_rsa.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000378 echo " CC $@.c"
379 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
380
Paul Bakker674e0b02014-03-26 13:26:52 +0100381test_suite_shax: test_suite_shax.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000382 echo " CC $@.c"
383 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
384
Manuel Pégourié-Gonnard4956fd72014-09-24 11:13:44 +0200385test_suite_ssl: test_suite_ssl.c $(DEP)
386 echo " CC $@.c"
387 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
388
Paul Bakker674e0b02014-03-26 13:26:52 +0100389test_suite_x509parse: test_suite_x509parse.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000390 echo " CC $@.c"
391 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
392
Paul Bakker674e0b02014-03-26 13:26:52 +0100393test_suite_x509write: test_suite_x509write.c $(DEP)
Paul Bakker6d620502012-02-16 14:09:13 +0000394 echo " CC $@.c"
395 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
396
Paul Bakker674e0b02014-03-26 13:26:52 +0100397test_suite_xtea: test_suite_xtea.c $(DEP)
Paul Bakker0049c2f2009-07-11 19:15:43 +0000398 echo " CC $@.c"
399 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
400
Paul Bakker674e0b02014-03-26 13:26:52 +0100401test_suite_debug: test_suite_debug.c $(DEP)
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000402 echo " CC $@.c"
403 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
404
Paul Bakker674e0b02014-03-26 13:26:52 +0100405test_suite_version: test_suite_version.c $(DEP)
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000406 echo " CC $@.c"
407 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
408
Paul Bakker0049c2f2009-07-11 19:15:43 +0000409clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000410ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000411 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000412endif
413ifdef WINDOWS
414 del /Q /F *.c *.exe
415endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000416
Paul Bakker9794cb42009-07-28 18:55:00 +0000417check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000418ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100419 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000420 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000421 for i in $(APPS); \
422 do \
423 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100424 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000425 FAILED=`echo $$RESULT |grep FAILED`; \
426 echo " $$RESULT"; \
427 if [ "$$FAILED" != "" ]; \
428 then \
429 echo "**** Failed ***************"; \
430 RETURN=1; \
431 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000432 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000433 done; \
434 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000435endif