blob: e33fe52f777bdcbb752a6cbe5e71428c3b60960b [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
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020010LDFLAGS += -L../library -lmbedtls$(SHARED_SUFFIX) $(SYS_LDFLAGS)
11DLEXT=so
Paul Bakker0049c2f2009-07-11 19:15:43 +000012
Paul Bakker674e0b02014-03-26 13:26:52 +010013ifndef SHARED
Manuel Pégourié-Gonnardc26a0922015-01-23 12:51:33 +000014DEP=../library/libmbedtls.a
Paul Bakker674e0b02014-03-26 13:26:52 +010015CHECK_PRELOAD=
16else
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020017DEP=../library/libmbedtls.$(DLEXT)
18CHECK_PRELOAD= LD_PRELOAD=../library/libmbedtls.$(DLEXT)
Paul Bakker674e0b02014-03-26 13:26:52 +010019endif
20
Paul Bakkerc7ffd362012-04-05 12:08:29 +000021ifdef DEBUG
22CFLAGS += -g3
23endif
24
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020025#
26# if we running on Windows build
27# for Windows
28#
Paul Bakkercd5b5292012-05-10 20:49:10 +000029ifdef WINDOWS
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020030WINDOWS_BUILD=1
31endif
32
33ifdef WINDOWS_BUILD
34DLEXT=dll
35EXEXT=.exe
Paul Bakkercd5b5292012-05-10 20:49:10 +000036LDFLAGS += -lws2_32
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020037ifdef SHARED
38SHARED_SUFFIX=.$(DLEXT)
39endif
Paul Bakkercd5b5292012-05-10 20:49:10 +000040endif
41
Paul Bakker2770fbd2012-07-03 13:30:23 +000042# Zlib shared library extensions:
43ifdef ZLIB
44LDFLAGS += -lz
45endif
46
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020047APPS = test_suite_aes.ecb$(EXEXT) test_suite_aes.cbc$(EXEXT) \
48 test_suite_aes.cfb$(EXEXT) test_suite_aes.rest$(EXEXT) \
49 test_suite_arc4$(EXEXT) test_suite_asn1write$(EXEXT) \
50 test_suite_base64$(EXEXT) test_suite_blowfish$(EXEXT) \
51 test_suite_camellia$(EXEXT) test_suite_ccm$(EXEXT) \
52 test_suite_cipher.aes$(EXEXT) \
53 test_suite_cipher.arc4$(EXEXT) test_suite_cipher.ccm$(EXEXT) \
54 test_suite_cipher.gcm$(EXEXT) \
55 test_suite_cipher.blowfish$(EXEXT) \
56 test_suite_cipher.camellia$(EXEXT) \
57 test_suite_cipher.des$(EXEXT) test_suite_cipher.null$(EXEXT) \
58 test_suite_cipher.padding$(EXEXT) \
59 test_suite_ctr_drbg$(EXEXT) test_suite_debug$(EXEXT) \
60 test_suite_des$(EXEXT) test_suite_dhm$(EXEXT) \
61 test_suite_ecdh$(EXEXT) test_suite_ecdsa$(EXEXT) \
62 test_suite_ecp$(EXEXT) \
63 test_suite_error$(EXEXT) test_suite_entropy$(EXEXT) \
64 test_suite_gcm.aes128_de$(EXEXT) \
65 test_suite_gcm.aes192_de$(EXEXT) \
66 test_suite_gcm.aes256_de$(EXEXT) \
67 test_suite_gcm.aes128_en$(EXEXT) \
68 test_suite_gcm.aes192_en$(EXEXT) \
69 test_suite_gcm.aes256_en$(EXEXT) \
70 test_suite_gcm.camellia$(EXEXT) test_suite_hmac_shax$(EXEXT) \
71 test_suite_hmac_drbg.misc$(EXEXT) \
72 test_suite_hmac_drbg.no_reseed$(EXEXT) \
73 test_suite_hmac_drbg.nopr$(EXEXT) \
74 test_suite_hmac_drbg.pr$(EXEXT) \
75 test_suite_md$(EXEXT) test_suite_mdx$(EXEXT) \
76 test_suite_memory_buffer_alloc$(EXEXT) \
77 test_suite_mpi$(EXEXT) test_suite_pbkdf2$(EXEXT) \
78 test_suite_pem$(EXEXT) \
79 test_suite_pkcs1_v21$(EXEXT) test_suite_pkcs5$(EXEXT) \
80 test_suite_pkparse$(EXEXT) test_suite_pkwrite$(EXEXT) \
81 test_suite_pk$(EXEXT) \
82 test_suite_rsa$(EXEXT) test_suite_shax$(EXEXT) \
83 test_suite_x509parse$(EXEXT) test_suite_x509write$(EXEXT) \
84 test_suite_xtea$(EXEXT) test_suite_version$(EXEXT)
Paul Bakker0049c2f2009-07-11 19:15:43 +000085
86.SILENT:
87
88all: $(APPS)
89
Paul Bakker19343182013-08-16 13:31:10 +020090test_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 +020091 echo " Generate $@"
92 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
93
Paul Bakker19343182013-08-16 13:31:10 +020094test_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 +020095 echo " Generate $@"
96 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
97
Paul Bakker19343182013-08-16 13:31:10 +020098test_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 +020099 echo " Generate $@"
100 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
101
Paul Bakker19343182013-08-16 13:31:10 +0200102test_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 +0200103 echo " Generate $@"
104 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
105
Paul Bakker19343182013-08-16 13:31:10 +0200106test_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 +0000107 echo " Generate $@"
108 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
109
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200110test_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
111 echo " Generate $@"
112 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
113
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200114test_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
115 echo " Generate $@"
116 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.ccm
117
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200118test_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
119 echo " Generate $@"
120 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
121
Paul Bakker19343182013-08-16 13:31:10 +0200122test_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 +0000123 echo " Generate $@"
124 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
125
Paul Bakker19343182013-08-16 13:31:10 +0200126test_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 +0000127 echo " Generate $@"
128 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
129
Paul Bakker19343182013-08-16 13:31:10 +0200130test_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 +0000131 echo " Generate $@"
132 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
133
Paul Bakker19343182013-08-16 13:31:10 +0200134test_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 +0000135 echo " Generate $@"
136 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
137
Paul Bakker19343182013-08-16 13:31:10 +0200138test_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 +0200139 echo " Generate $@"
140 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
141
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200142test_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 +0000143 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200144 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000145
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200146test_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 +0000147 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200148 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200149
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200150test_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 +0200151 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200152 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200153
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200154test_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 +0200155 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200156 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200157
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200158test_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 +0200159 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200160 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200161
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200162test_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 +0200163 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200164 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000165
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200166test_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
167 echo " Generate $@"
168 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000169
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100170test_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
171 echo " Generate $@"
172 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
173
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100174test_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
175 echo " Generate $@"
176 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
177
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100178test_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
179 echo " Generate $@"
180 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
181
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100182test_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
183 echo " Generate $@"
184 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
185
Paul Bakker19343182013-08-16 13:31:10 +0200186%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000187 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000188 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000189
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200190test_suite_aes.ecb$(EXEXT): test_suite_aes.ecb.c $(DEP)
191 echo " CC $<"
192 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200193
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200194test_suite_aes.cbc$(EXEXT): test_suite_aes.cbc.c $(DEP)
195 echo " CC $<"
196 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200197
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200198test_suite_aes.cfb$(EXEXT): test_suite_aes.cfb.c $(DEP)
199 echo " CC $<"
200 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200201
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200202test_suite_aes.rest$(EXEXT): test_suite_aes.rest.c $(DEP)
203 echo " CC $<"
204 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000205
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200206test_suite_arc4$(EXEXT): test_suite_arc4.c $(DEP)
207 echo " CC $<"
208 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000209
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200210test_suite_asn1write$(EXEXT): test_suite_asn1write.c $(DEP)
211 echo " CC $<"
212 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +0200213
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200214test_suite_base64$(EXEXT): test_suite_base64.c $(DEP)
215 echo " CC $<"
216 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000217
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200218test_suite_blowfish$(EXEXT): test_suite_blowfish.c $(DEP)
219 echo " CC $<"
220 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkera9379c02012-07-04 11:02:11 +0000221
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200222test_suite_camellia$(EXEXT): test_suite_camellia.c $(DEP)
223 echo " CC $<"
224 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000225
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200226test_suite_ccm$(EXEXT): test_suite_ccm.c $(DEP)
227 echo " CC $<"
228 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +0200229
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200230test_suite_cipher.aes$(EXEXT): test_suite_cipher.aes.c $(DEP)
231 echo " CC $<"
232 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker46c17942011-07-13 14:54:54 +0000233
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200234test_suite_cipher.arc4$(EXEXT): test_suite_cipher.arc4.c $(DEP)
235 echo " CC $<"
236 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200237
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200238test_suite_cipher.ccm$(EXEXT): test_suite_cipher.ccm.c $(DEP)
239 echo " CC $<"
240 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200241
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200242test_suite_cipher.gcm$(EXEXT): test_suite_cipher.gcm.c $(DEP)
243 echo " CC $<"
244 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200245
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200246test_suite_cipher.blowfish$(EXEXT): test_suite_cipher.blowfish.c $(DEP)
247 echo " CC $<"
248 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker6132d0a2012-07-04 17:10:40 +0000249
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200250test_suite_cipher.camellia$(EXEXT): test_suite_cipher.camellia.c $(DEP)
251 echo " CC $<"
252 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker46c17942011-07-13 14:54:54 +0000253
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200254test_suite_cipher.des$(EXEXT): test_suite_cipher.des.c $(DEP)
255 echo " CC $<"
256 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000257
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200258test_suite_cipher.null$(EXEXT): test_suite_cipher.null.c $(DEP)
259 echo " CC $<"
260 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerfab5c822012-02-06 16:45:10 +0000261
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200262test_suite_cipher.padding$(EXEXT): test_suite_cipher.padding.c $(DEP)
263 echo " CC $<"
264 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200265
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200266test_suite_ctr_drbg$(EXEXT): test_suite_ctr_drbg.c $(DEP)
267 echo " CC $<"
268 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker8123e9d2011-01-06 15:37:30 +0000269
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200270test_suite_des$(EXEXT): test_suite_des.c $(DEP)
271 echo " CC $<"
272 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000273
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200274test_suite_dhm$(EXEXT): test_suite_dhm.c $(DEP)
275 echo " CC $<"
276 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000277
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200278test_suite_ecdh$(EXEXT): test_suite_ecdh.c $(DEP)
279 echo " CC $<"
280 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100281
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200282test_suite_ecdsa$(EXEXT): test_suite_ecdsa.c $(DEP)
283 echo " CC $<"
284 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100285
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200286test_suite_ecp$(EXEXT): test_suite_ecp.c $(DEP)
287 echo " CC $<"
288 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkera95919b2013-01-16 17:00:05 +0100289
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200290test_suite_entropy$(EXEXT): test_suite_entropy.c $(DEP)
291 echo " CC $<"
292 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200293
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200294test_suite_error$(EXEXT): test_suite_error.c $(DEP)
295 echo " CC $<"
296 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker9d781402011-05-09 16:17:09 +0000297
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200298test_suite_gcm.aes128_de$(EXEXT): test_suite_gcm.aes128_de.c $(DEP)
299 echo " CC $<"
300 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker89e80c92012-03-20 13:50:09 +0000301
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200302test_suite_gcm.aes192_de$(EXEXT): test_suite_gcm.aes192_de.c $(DEP)
303 echo " CC $<"
304 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200305
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200306test_suite_gcm.aes256_de$(EXEXT): test_suite_gcm.aes256_de.c $(DEP)
307 echo " CC $<"
308 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200309
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200310test_suite_gcm.aes128_en$(EXEXT): test_suite_gcm.aes128_en.c $(DEP)
311 echo " CC $<"
312 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200313
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200314test_suite_gcm.aes192_en$(EXEXT): test_suite_gcm.aes192_en.c $(DEP)
315 echo " CC $<"
316 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200317
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200318test_suite_gcm.aes256_en$(EXEXT): test_suite_gcm.aes256_en.c $(DEP)
319 echo " CC $<"
320 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker89e80c92012-03-20 13:50:09 +0000321
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200322test_suite_gcm.camellia$(EXEXT): test_suite_gcm.camellia.c $(DEP)
323 echo " CC $<"
324 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000325
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200326test_suite_hmac_drbg.misc$(EXEXT): test_suite_hmac_drbg.misc.c $(DEP)
327 echo " CC $<"
328 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100329
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200330test_suite_hmac_drbg.no_reseed$(EXEXT): test_suite_hmac_drbg.no_reseed.c $(DEP)
331 echo " CC $<"
332 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100333
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200334test_suite_hmac_drbg.nopr$(EXEXT): test_suite_hmac_drbg.nopr.c $(DEP)
335 echo " CC $<"
336 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100337
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200338test_suite_hmac_drbg.pr$(EXEXT): test_suite_hmac_drbg.pr.c $(DEP)
339 echo " CC $<"
340 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100341
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200342test_suite_hmac_shax$(EXEXT): test_suite_hmac_shax.c $(DEP)
343 echo " CC $<"
344 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000345
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200346test_suite_md$(EXEXT): test_suite_md.c $(DEP)
347 echo " CC $<"
348 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker17373852011-01-06 14:20:01 +0000349
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200350test_suite_mdx$(EXEXT): test_suite_mdx.c $(DEP)
351 echo " CC $<"
352 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000353
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200354test_suite_memory_buffer_alloc$(EXEXT): test_suite_memory_buffer_alloc.c $(DEP)
355 echo " CC $<"
356 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard765bb312014-11-27 11:55:27 +0100357
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200358test_suite_mpi$(EXEXT): test_suite_mpi.c $(DEP)
359 echo " CC $<"
360 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000361
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200362test_suite_pbkdf2$(EXEXT): test_suite_pbkdf2.c $(DEP)
363 echo " CC $<"
364 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerf518b162012-08-23 13:03:18 +0000365
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200366test_suite_pem$(EXEXT): test_suite_pem.c $(DEP)
367 echo " CC $<"
368 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker16300582014-04-11 13:28:43 +0200369
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200370test_suite_pkcs1_v21$(EXEXT): test_suite_pkcs1_v21.c $(DEP)
371 echo " CC $<"
372 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000373
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200374test_suite_pkcs5$(EXEXT): test_suite_pkcs5.c $(DEP)
375 echo " CC $<"
376 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200377
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200378test_suite_pkparse$(EXEXT): test_suite_pkparse.c $(DEP)
379 echo " CC $<"
380 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker1a7550a2013-09-15 13:01:22 +0200381
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200382test_suite_pkwrite$(EXEXT): test_suite_pkwrite.c $(DEP)
383 echo " CC $<"
384 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200385
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200386test_suite_pk$(EXEXT): test_suite_pk.c $(DEP)
387 echo " CC $<"
388 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker32925622013-10-28 17:32:48 +0100389
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200390test_suite_rsa$(EXEXT): test_suite_rsa.c $(DEP)
391 echo " CC $<"
392 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000393
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200394test_suite_shax$(EXEXT): test_suite_shax.c $(DEP)
395 echo " CC $<"
396 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000397
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200398test_suite_x509parse$(EXEXT): test_suite_x509parse.c $(DEP)
399 echo " CC $<"
400 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000401
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200402test_suite_x509write$(EXEXT): test_suite_x509write.c $(DEP)
403 echo " CC $<"
404 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker6d620502012-02-16 14:09:13 +0000405
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200406test_suite_xtea$(EXEXT): test_suite_xtea.c $(DEP)
407 echo " CC $<"
408 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000409
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200410test_suite_debug$(EXEXT): test_suite_debug.c $(DEP)
411 echo " CC $<"
412 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000413
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200414test_suite_version$(EXEXT): test_suite_version.c $(DEP)
415 echo " CC $<"
416 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000417
Paul Bakker0049c2f2009-07-11 19:15:43 +0000418clean:
Manuel Pégourié-Gonnard09eb14c2015-02-16 15:25:31 +0000419ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000420 rm -f $(APPS) *.c
Manuel Pégourié-Gonnard09eb14c2015-02-16 15:25:31 +0000421endif
422ifdef WINDOWS
423 del /Q /F *.c *.exe
424endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000425
Paul Bakker9794cb42009-07-28 18:55:00 +0000426check: $(APPS)
Manuel Pégourié-Gonnard09eb14c2015-02-16 15:25:31 +0000427ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100428 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000429 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000430 for i in $(APPS); \
431 do \
432 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100433 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Rich Evansb1c846e2015-02-02 12:15:44 +0000434 PASSED=`echo $$RESULT |grep PASSED`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000435 echo " $$RESULT"; \
Alon Bar-Leveb53fff2015-02-18 17:23:17 +0200436 if [ "$$PASSED" = "" ]; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000437 then \
438 echo "**** Failed ***************"; \
439 RETURN=1; \
440 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000441 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000442 done; \
443 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Manuel Pégourié-Gonnard09eb14c2015-02-16 15:25:31 +0000444endif