blob: 408e953314f6261143b4c0234b444cfab4e4c16d [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) \
Manuel Pégourié-Gonnardd901d172015-02-16 18:37:53 +000083 test_suite_ssl$(EXEXT) \
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020084 test_suite_x509parse$(EXEXT) test_suite_x509write$(EXEXT) \
85 test_suite_xtea$(EXEXT) test_suite_version$(EXEXT)
Paul Bakker0049c2f2009-07-11 19:15:43 +000086
87.SILENT:
88
89all: $(APPS)
90
Paul Bakker19343182013-08-16 13:31:10 +020091test_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 +020092 echo " Generate $@"
93 scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb
94
Paul Bakker19343182013-08-16 13:31:10 +020095test_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 +020096 echo " Generate $@"
97 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc
98
Paul Bakker19343182013-08-16 13:31:10 +020099test_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 +0200100 echo " Generate $@"
101 scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb
102
Paul Bakker19343182013-08-16 13:31:10 +0200103test_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 +0200104 echo " Generate $@"
105 scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest
106
Paul Bakker19343182013-08-16 13:31:10 +0200107test_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 +0000108 echo " Generate $@"
109 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes
110
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200111test_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
112 echo " Generate $@"
113 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4
114
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200115test_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
116 echo " Generate $@"
117 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.ccm
118
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200119test_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
120 echo " Generate $@"
121 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm
122
Paul Bakker19343182013-08-16 13:31:10 +0200123test_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 +0000124 echo " Generate $@"
125 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish
126
Paul Bakker19343182013-08-16 13:31:10 +0200127test_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 +0000128 echo " Generate $@"
129 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia
130
Paul Bakker19343182013-08-16 13:31:10 +0200131test_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 +0000132 echo " Generate $@"
133 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des
134
Paul Bakker19343182013-08-16 13:31:10 +0200135test_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 +0000136 echo " Generate $@"
137 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null
138
Paul Bakker19343182013-08-16 13:31:10 +0200139test_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 +0200140 echo " Generate $@"
141 scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding
142
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200143test_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 +0000144 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200145 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
Paul Bakker89e80c92012-03-20 13:50:09 +0000146
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200147test_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 +0000148 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200149 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200150
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200151test_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 +0200152 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200153 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
Paul Bakker286bf3c2013-04-08 18:09:51 +0200154
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200155test_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 +0200156 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200157 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200158
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200159test_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 +0200160 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200161 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
Paul Bakker286bf3c2013-04-08 18:09:51 +0200162
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200163test_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 +0200164 echo " Generate $@"
Manuel Pégourié-Gonnard94dd5b42013-10-24 11:57:47 +0200165 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
Paul Bakker89e80c92012-03-20 13:50:09 +0000166
Manuel Pégourié-Gonnard13e0d442013-10-24 12:59:00 +0200167test_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
168 echo " Generate $@"
169 scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
Paul Bakker0049c2f2009-07-11 19:15:43 +0000170
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100171test_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
172 echo " Generate $@"
173 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc
174
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100175test_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
176 echo " Generate $@"
177 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed
178
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100179test_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
180 echo " Generate $@"
181 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr
182
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100183test_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
184 echo " Generate $@"
185 scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr
186
Paul Bakker19343182013-08-16 13:31:10 +0200187%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker0049c2f2009-07-11 19:15:43 +0000188 echo " Generate $@"
Paul Bakker46c17942011-07-13 14:54:54 +0000189 scripts/generate_code.pl suites $* $*
Paul Bakker0049c2f2009-07-11 19:15:43 +0000190
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200191test_suite_aes.ecb$(EXEXT): test_suite_aes.ecb.c $(DEP)
192 echo " CC $<"
193 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200194
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200195test_suite_aes.cbc$(EXEXT): test_suite_aes.cbc.c $(DEP)
196 echo " CC $<"
197 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200198
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200199test_suite_aes.cfb$(EXEXT): test_suite_aes.cfb.c $(DEP)
200 echo " CC $<"
201 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200202
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200203test_suite_aes.rest$(EXEXT): test_suite_aes.rest.c $(DEP)
204 echo " CC $<"
205 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000206
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200207test_suite_arc4$(EXEXT): test_suite_arc4.c $(DEP)
208 echo " CC $<"
209 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000210
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200211test_suite_asn1write$(EXEXT): test_suite_asn1write.c $(DEP)
212 echo " CC $<"
213 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard36178ff2014-05-29 14:26:03 +0200214
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200215test_suite_base64$(EXEXT): test_suite_base64.c $(DEP)
216 echo " CC $<"
217 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000218
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200219test_suite_blowfish$(EXEXT): test_suite_blowfish.c $(DEP)
220 echo " CC $<"
221 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkera9379c02012-07-04 11:02:11 +0000222
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200223test_suite_camellia$(EXEXT): test_suite_camellia.c $(DEP)
224 echo " CC $<"
225 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000226
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200227test_suite_ccm$(EXEXT): test_suite_ccm.c $(DEP)
228 echo " CC $<"
229 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnarda6916fa2014-05-02 15:17:29 +0200230
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200231test_suite_cipher.aes$(EXEXT): test_suite_cipher.aes.c $(DEP)
232 echo " CC $<"
233 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker46c17942011-07-13 14:54:54 +0000234
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200235test_suite_cipher.arc4$(EXEXT): test_suite_cipher.arc4.c $(DEP)
236 echo " CC $<"
237 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard37e230c2013-08-28 13:50:42 +0200238
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200239test_suite_cipher.ccm$(EXEXT): test_suite_cipher.ccm.c $(DEP)
240 echo " CC $<"
241 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard542eac52014-05-15 16:03:07 +0200242
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200243test_suite_cipher.gcm$(EXEXT): test_suite_cipher.gcm.c $(DEP)
244 echo " CC $<"
245 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard07f8fa52013-08-30 18:34:08 +0200246
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200247test_suite_cipher.blowfish$(EXEXT): test_suite_cipher.blowfish.c $(DEP)
248 echo " CC $<"
249 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker6132d0a2012-07-04 17:10:40 +0000250
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200251test_suite_cipher.camellia$(EXEXT): test_suite_cipher.camellia.c $(DEP)
252 echo " CC $<"
253 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker46c17942011-07-13 14:54:54 +0000254
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200255test_suite_cipher.des$(EXEXT): test_suite_cipher.des.c $(DEP)
256 echo " CC $<"
257 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0e04d0e2011-11-27 14:46:59 +0000258
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200259test_suite_cipher.null$(EXEXT): test_suite_cipher.null.c $(DEP)
260 echo " CC $<"
261 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerfab5c822012-02-06 16:45:10 +0000262
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200263test_suite_cipher.padding$(EXEXT): test_suite_cipher.padding.c $(DEP)
264 echo " CC $<"
265 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnardd5fdcaf2013-07-24 18:05:00 +0200266
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200267test_suite_ctr_drbg$(EXEXT): test_suite_ctr_drbg.c $(DEP)
268 echo " CC $<"
269 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker8123e9d2011-01-06 15:37:30 +0000270
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200271test_suite_des$(EXEXT): test_suite_des.c $(DEP)
272 echo " CC $<"
273 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000274
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200275test_suite_dhm$(EXEXT): test_suite_dhm.c $(DEP)
276 echo " CC $<"
277 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000278
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200279test_suite_ecdh$(EXEXT): test_suite_ecdh.c $(DEP)
280 echo " CC $<"
281 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100282
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200283test_suite_ecdsa$(EXEXT): test_suite_ecdsa.c $(DEP)
284 echo " CC $<"
285 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerd589a0d2013-03-13 16:30:17 +0100286
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200287test_suite_ecp$(EXEXT): test_suite_ecp.c $(DEP)
288 echo " CC $<"
289 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkera95919b2013-01-16 17:00:05 +0100290
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200291test_suite_entropy$(EXEXT): test_suite_entropy.c $(DEP)
292 echo " CC $<"
293 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard2c25eb02014-05-30 10:38:18 +0200294
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200295test_suite_error$(EXEXT): test_suite_error.c $(DEP)
296 echo " CC $<"
297 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker9d781402011-05-09 16:17:09 +0000298
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200299test_suite_gcm.aes128_de$(EXEXT): test_suite_gcm.aes128_de.c $(DEP)
300 echo " CC $<"
301 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker89e80c92012-03-20 13:50:09 +0000302
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200303test_suite_gcm.aes192_de$(EXEXT): test_suite_gcm.aes192_de.c $(DEP)
304 echo " CC $<"
305 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200306
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200307test_suite_gcm.aes256_de$(EXEXT): test_suite_gcm.aes256_de.c $(DEP)
308 echo " CC $<"
309 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200310
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200311test_suite_gcm.aes128_en$(EXEXT): test_suite_gcm.aes128_en.c $(DEP)
312 echo " CC $<"
313 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200314
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200315test_suite_gcm.aes192_en$(EXEXT): test_suite_gcm.aes192_en.c $(DEP)
316 echo " CC $<"
317 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker286bf3c2013-04-08 18:09:51 +0200318
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200319test_suite_gcm.aes256_en$(EXEXT): test_suite_gcm.aes256_en.c $(DEP)
320 echo " CC $<"
321 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker89e80c92012-03-20 13:50:09 +0000322
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200323test_suite_gcm.camellia$(EXEXT): test_suite_gcm.camellia.c $(DEP)
324 echo " CC $<"
325 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000326
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200327test_suite_hmac_drbg.misc$(EXEXT): test_suite_hmac_drbg.misc.c $(DEP)
328 echo " CC $<"
329 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard48bc3e82014-01-30 21:11:16 +0100330
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200331test_suite_hmac_drbg.no_reseed$(EXEXT): test_suite_hmac_drbg.no_reseed.c $(DEP)
332 echo " CC $<"
333 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard6801f392014-01-30 17:22:14 +0100334
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200335test_suite_hmac_drbg.nopr$(EXEXT): test_suite_hmac_drbg.nopr.c $(DEP)
336 echo " CC $<"
337 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard24600b72014-01-31 09:54:14 +0100338
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200339test_suite_hmac_drbg.pr$(EXEXT): test_suite_hmac_drbg.pr.c $(DEP)
340 echo " CC $<"
341 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard62273b82014-01-31 10:16:57 +0100342
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200343test_suite_hmac_shax$(EXEXT): test_suite_hmac_shax.c $(DEP)
344 echo " CC $<"
345 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000346
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200347test_suite_md$(EXEXT): test_suite_md.c $(DEP)
348 echo " CC $<"
349 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker17373852011-01-06 14:20:01 +0000350
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200351test_suite_mdx$(EXEXT): test_suite_mdx.c $(DEP)
352 echo " CC $<"
353 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000354
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200355test_suite_memory_buffer_alloc$(EXEXT): test_suite_memory_buffer_alloc.c $(DEP)
356 echo " CC $<"
357 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard765bb312014-11-27 11:55:27 +0100358
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200359test_suite_mpi$(EXEXT): test_suite_mpi.c $(DEP)
360 echo " CC $<"
361 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000362
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200363test_suite_pbkdf2$(EXEXT): test_suite_pbkdf2.c $(DEP)
364 echo " CC $<"
365 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerf518b162012-08-23 13:03:18 +0000366
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200367test_suite_pem$(EXEXT): test_suite_pem.c $(DEP)
368 echo " CC $<"
369 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker16300582014-04-11 13:28:43 +0200370
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200371test_suite_pkcs1_v21$(EXEXT): test_suite_pkcs1_v21.c $(DEP)
372 echo " CC $<"
373 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker9dcc3222011-03-08 14:16:06 +0000374
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200375test_suite_pkcs5$(EXEXT): test_suite_pkcs5.c $(DEP)
376 echo " CC $<"
377 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerb0c19a42013-06-24 19:26:38 +0200378
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200379test_suite_pkparse$(EXEXT): test_suite_pkparse.c $(DEP)
380 echo " CC $<"
381 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker1a7550a2013-09-15 13:01:22 +0200382
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200383test_suite_pkwrite$(EXEXT): test_suite_pkwrite.c $(DEP)
384 echo " CC $<"
385 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakkerc7bb02b2013-09-15 14:54:56 +0200386
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200387test_suite_pk$(EXEXT): test_suite_pk.c $(DEP)
388 echo " CC $<"
389 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker32925622013-10-28 17:32:48 +0100390
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200391test_suite_rsa$(EXEXT): test_suite_rsa.c $(DEP)
392 echo " CC $<"
393 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000394
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200395test_suite_shax$(EXEXT): test_suite_shax.c $(DEP)
396 echo " CC $<"
397 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000398
Manuel Pégourié-Gonnardd901d172015-02-16 18:37:53 +0000399test_suite_ssl$(EXEXT): test_suite_ssl.c $(DEP)
400 echo " CC $<"
401 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Manuel Pégourié-Gonnard4956fd72014-09-24 11:13:44 +0200402
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200403test_suite_x509parse$(EXEXT): test_suite_x509parse.c $(DEP)
404 echo " CC $<"
405 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000406
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200407test_suite_x509write$(EXEXT): test_suite_x509write.c $(DEP)
408 echo " CC $<"
409 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker6d620502012-02-16 14:09:13 +0000410
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200411test_suite_xtea$(EXEXT): test_suite_xtea.c $(DEP)
412 echo " CC $<"
413 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker0049c2f2009-07-11 19:15:43 +0000414
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200415test_suite_debug$(EXEXT): test_suite_debug.c $(DEP)
416 echo " CC $<"
417 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker7d7f4f42010-02-18 18:26:04 +0000418
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +0200419test_suite_version$(EXEXT): test_suite_version.c $(DEP)
420 echo " CC $<"
421 $(CC) $(CFLAGS) $(OFLAGS) $< $(LDFLAGS) -o $@
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000422
Paul Bakker0049c2f2009-07-11 19:15:43 +0000423clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000424ifndef WINDOWS
Paul Bakker0049c2f2009-07-11 19:15:43 +0000425 rm -f $(APPS) *.c
Paul Bakker62f88dc2012-05-10 21:26:28 +0000426endif
427ifdef WINDOWS
428 del /Q /F *.c *.exe
429endif
Paul Bakker0049c2f2009-07-11 19:15:43 +0000430
Paul Bakker9794cb42009-07-28 18:55:00 +0000431check: $(APPS)
Paul Bakker62f88dc2012-05-10 21:26:28 +0000432ifndef WINDOWS
Paul Bakker674e0b02014-03-26 13:26:52 +0100433 echo "Running checks (Success if all tests PASSED)"
Paul Bakkerd14cd352012-05-08 15:39:50 +0000434 RETURN=0; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000435 for i in $(APPS); \
436 do \
437 echo " - $${i}"; \
Paul Bakker674e0b02014-03-26 13:26:52 +0100438 RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`; \
Rich Evansb1c846e2015-02-02 12:15:44 +0000439 PASSED=`echo $$RESULT |grep PASSED`; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000440 echo " $$RESULT"; \
Rich Evansb1c846e2015-02-02 12:15:44 +0000441 if [ "$$PASSED" == "" ]; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000442 then \
443 echo "**** Failed ***************"; \
444 RETURN=1; \
445 fi; \
Paul Bakkerd947d762009-07-28 20:16:47 +0000446 echo ""; \
Paul Bakkerd14cd352012-05-08 15:39:50 +0000447 done; \
448 if [ "$$RETURN" -eq 1 ]; then exit 1; fi
Paul Bakker62f88dc2012-05-10 21:26:28 +0000449endif