Makefile 18.3 KB
Newer Older
Paul Bakker's avatar
Paul Bakker committed
1 2

# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
3
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
Paul Bakker's avatar
Paul Bakker committed
4

Alon Bar-Lev's avatar
Alon Bar-Lev committed
5 6
CFLAGS	?= -O2
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value
7
LDFLAGS ?=
Alon Bar-Lev's avatar
Alon Bar-Lev committed
8 9

LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64
10
LOCAL_LDFLAGS = -L../library -lmbedtls$(SHARED_SUFFIX)
11
DLEXT=so
Paul Bakker's avatar
Paul Bakker committed
12

13
ifndef SHARED
14
DEP=../library/libmbedtls.a
15 16
CHECK_PRELOAD=
else
17 18
DEP=../library/libmbedtls.$(DLEXT)
CHECK_PRELOAD= LD_PRELOAD=../library/libmbedtls.$(DLEXT)
19 20
endif

21
ifdef DEBUG
Alon Bar-Lev's avatar
Alon Bar-Lev committed
22
LOCAL_CFLAGS += -g3
23 24
endif

25 26 27 28
#
# if we running on Windows build
# for Windows
#
29
ifdef WINDOWS
30 31 32 33 34 35
WINDOWS_BUILD=1
endif

ifdef WINDOWS_BUILD
DLEXT=dll
EXEXT=.exe
36
LOCAL_LDFLAGS += -lws2_32
37 38 39
ifdef SHARED
SHARED_SUFFIX=.$(DLEXT)
endif
40 41
endif

42 43
# Zlib shared library extensions:
ifdef ZLIB
44
LOCAL_LDFLAGS += -lz
45 46
endif

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
APPS =	test_suite_aes.ecb$(EXEXT)	test_suite_aes.cbc$(EXEXT)	\
	test_suite_aes.cfb$(EXEXT)	test_suite_aes.rest$(EXEXT)	\
	test_suite_arc4$(EXEXT)		test_suite_asn1write$(EXEXT)	\
	test_suite_base64$(EXEXT)	test_suite_blowfish$(EXEXT)	\
	test_suite_camellia$(EXEXT)	test_suite_ccm$(EXEXT)		\
	test_suite_cipher.aes$(EXEXT)					\
	test_suite_cipher.arc4$(EXEXT)	test_suite_cipher.ccm$(EXEXT)	\
	test_suite_cipher.gcm$(EXEXT)					\
	test_suite_cipher.blowfish$(EXEXT)				\
	test_suite_cipher.camellia$(EXEXT)				\
	test_suite_cipher.des$(EXEXT)	test_suite_cipher.null$(EXEXT)	\
	test_suite_cipher.padding$(EXEXT)				\
	test_suite_ctr_drbg$(EXEXT)	test_suite_debug$(EXEXT)	\
	test_suite_des$(EXEXT)		test_suite_dhm$(EXEXT)		\
	test_suite_ecdh$(EXEXT)		test_suite_ecdsa$(EXEXT)	\
	test_suite_ecp$(EXEXT)						\
	test_suite_error$(EXEXT)	test_suite_entropy$(EXEXT)	\
	test_suite_gcm.aes128_de$(EXEXT)				\
	test_suite_gcm.aes192_de$(EXEXT)				\
	test_suite_gcm.aes256_de$(EXEXT)				\
	test_suite_gcm.aes128_en$(EXEXT)				\
	test_suite_gcm.aes192_en$(EXEXT)				\
	test_suite_gcm.aes256_en$(EXEXT)				\
	test_suite_gcm.camellia$(EXEXT)	test_suite_hmac_shax$(EXEXT)	\
	test_suite_hmac_drbg.misc$(EXEXT)				\
	test_suite_hmac_drbg.no_reseed$(EXEXT)				\
	test_suite_hmac_drbg.nopr$(EXEXT)				\
	test_suite_hmac_drbg.pr$(EXEXT)					\
	test_suite_md$(EXEXT)		test_suite_mdx$(EXEXT)		\
	test_suite_memory_buffer_alloc$(EXEXT)				\
	test_suite_mpi$(EXEXT)		test_suite_pbkdf2$(EXEXT)	\
	test_suite_pem$(EXEXT)						\
	test_suite_pkcs1_v21$(EXEXT)	test_suite_pkcs5$(EXEXT)	\
	test_suite_pkparse$(EXEXT)	test_suite_pkwrite$(EXEXT)	\
	test_suite_pk$(EXEXT)						\
	test_suite_rsa$(EXEXT)		test_suite_shax$(EXEXT)		\
	test_suite_x509parse$(EXEXT)	test_suite_x509write$(EXEXT)	\
	test_suite_xtea$(EXEXT)		test_suite_version$(EXEXT)
Paul Bakker's avatar
Paul Bakker committed
85 86 87 88 89

.SILENT:

all: $(APPS)

90
test_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
91 92 93
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb

94
test_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
95 96 97
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc

98
test_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
99 100 101
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb

102
test_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
103 104 105
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest

106
test_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
107 108 109
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes

110 111 112 113
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.arc4

114 115 116 117
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.ccm

118 119 120 121
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.gcm

122
test_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
123 124 125
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish

126
test_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
127 128 129
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia

130
test_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
131 132 133
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des

134
test_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
135 136 137
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null

138
test_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
139 140 141
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding

142
test_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
143
	echo   "  Generate	$@"
144
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_de
145

146
test_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
147
	echo   "  Generate	$@"
148
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_de
149

150
test_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
151
	echo   "  Generate	$@"
152
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_de
153

154
test_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
155
	echo   "  Generate	$@"
156
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes128_en
157

158
test_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
159
	echo   "  Generate	$@"
160
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes192_en
161

162
test_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
163
	echo   "  Generate	$@"
164
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.aes256_en
165

166 167 168
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.camellia
169

170 171 172 173
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.misc

174 175 176 177
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.no_reseed

178 179 180 181
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.nopr

182 183 184 185
test_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
	echo   "  Generate	$@"
	scripts/generate_code.pl suites test_suite_hmac_drbg test_suite_hmac_drbg.pr

186
%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function
Paul Bakker's avatar
Paul Bakker committed
187
	echo   "  Generate	$@"
188
	scripts/generate_code.pl suites $* $*
Paul Bakker's avatar
Paul Bakker committed
189

190 191
test_suite_aes.ecb$(EXEXT): test_suite_aes.ecb.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
192
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
193

194 195
test_suite_aes.cbc$(EXEXT): test_suite_aes.cbc.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
196
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
197

198 199
test_suite_aes.cfb$(EXEXT): test_suite_aes.cfb.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
200
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
201

202 203
test_suite_aes.rest$(EXEXT): test_suite_aes.rest.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
204
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
205

206 207
test_suite_arc4$(EXEXT): test_suite_arc4.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
208
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
209

210 211
test_suite_asn1write$(EXEXT): test_suite_asn1write.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
212
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
213

214 215
test_suite_base64$(EXEXT): test_suite_base64.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
216
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
217

218 219
test_suite_blowfish$(EXEXT): test_suite_blowfish.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
220
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
221

222 223
test_suite_camellia$(EXEXT): test_suite_camellia.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
224
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
225

226 227
test_suite_ccm$(EXEXT): test_suite_ccm.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
228
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
229

230 231
test_suite_cipher.aes$(EXEXT): test_suite_cipher.aes.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
232
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
233

234 235
test_suite_cipher.arc4$(EXEXT): test_suite_cipher.arc4.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
236
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
237

238 239
test_suite_cipher.ccm$(EXEXT): test_suite_cipher.ccm.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
240
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
241

242 243
test_suite_cipher.gcm$(EXEXT): test_suite_cipher.gcm.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
244
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
245

246 247
test_suite_cipher.blowfish$(EXEXT): test_suite_cipher.blowfish.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
248
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
249

250 251
test_suite_cipher.camellia$(EXEXT): test_suite_cipher.camellia.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
252
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
253

254 255
test_suite_cipher.des$(EXEXT): test_suite_cipher.des.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
256
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
257

258 259
test_suite_cipher.null$(EXEXT): test_suite_cipher.null.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
260
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
261

262 263
test_suite_cipher.padding$(EXEXT): test_suite_cipher.padding.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
264
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
265

266 267
test_suite_ctr_drbg$(EXEXT): test_suite_ctr_drbg.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
268
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
269

270 271
test_suite_des$(EXEXT): test_suite_des.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
272
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
273

274 275
test_suite_dhm$(EXEXT): test_suite_dhm.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
276
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
277

278 279
test_suite_ecdh$(EXEXT): test_suite_ecdh.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
280
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
281

282 283
test_suite_ecdsa$(EXEXT): test_suite_ecdsa.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
284
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
285

286 287
test_suite_ecp$(EXEXT): test_suite_ecp.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
288
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
289

290 291
test_suite_entropy$(EXEXT): test_suite_entropy.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
292
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
293

294 295
test_suite_error$(EXEXT): test_suite_error.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
296
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
297

298 299
test_suite_gcm.aes128_de$(EXEXT): test_suite_gcm.aes128_de.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
300
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
301

302 303
test_suite_gcm.aes192_de$(EXEXT): test_suite_gcm.aes192_de.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
304
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
305

306 307
test_suite_gcm.aes256_de$(EXEXT): test_suite_gcm.aes256_de.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
308
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
309

310 311
test_suite_gcm.aes128_en$(EXEXT): test_suite_gcm.aes128_en.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
312
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
313

314 315
test_suite_gcm.aes192_en$(EXEXT): test_suite_gcm.aes192_en.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
316
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
317

318 319
test_suite_gcm.aes256_en$(EXEXT): test_suite_gcm.aes256_en.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
320
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
321

322 323
test_suite_gcm.camellia$(EXEXT): test_suite_gcm.camellia.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
324
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
325

326 327
test_suite_hmac_drbg.misc$(EXEXT): test_suite_hmac_drbg.misc.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
328
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
329

330 331
test_suite_hmac_drbg.no_reseed$(EXEXT): test_suite_hmac_drbg.no_reseed.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
332
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
333

334 335
test_suite_hmac_drbg.nopr$(EXEXT): test_suite_hmac_drbg.nopr.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
336
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
337

338 339
test_suite_hmac_drbg.pr$(EXEXT): test_suite_hmac_drbg.pr.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
340
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
341

342 343
test_suite_hmac_shax$(EXEXT): test_suite_hmac_shax.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
344
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
345

346 347
test_suite_md$(EXEXT): test_suite_md.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
348
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
349

350 351
test_suite_mdx$(EXEXT): test_suite_mdx.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
352
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
353

354 355
test_suite_memory_buffer_alloc$(EXEXT): test_suite_memory_buffer_alloc.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
356
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
357

358 359
test_suite_mpi$(EXEXT): test_suite_mpi.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
360
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
361

362 363
test_suite_pbkdf2$(EXEXT): test_suite_pbkdf2.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
364
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
365

366 367
test_suite_pem$(EXEXT): test_suite_pem.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
368
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
369

370 371
test_suite_pkcs1_v21$(EXEXT): test_suite_pkcs1_v21.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
372
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
373

374 375
test_suite_pkcs5$(EXEXT): test_suite_pkcs5.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
376
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
377

378 379
test_suite_pkparse$(EXEXT): test_suite_pkparse.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
380
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
381

382 383
test_suite_pkwrite$(EXEXT): test_suite_pkwrite.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
384
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
385

386 387
test_suite_pk$(EXEXT): test_suite_pk.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
388
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
389

390 391
test_suite_rsa$(EXEXT): test_suite_rsa.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
392
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
393

394 395
test_suite_shax$(EXEXT): test_suite_shax.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
396
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
397

398 399
test_suite_x509parse$(EXEXT): test_suite_x509parse.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
400
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
401

402 403
test_suite_x509write$(EXEXT): test_suite_x509write.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
404
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
405

406 407
test_suite_xtea$(EXEXT): test_suite_xtea.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
408
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker's avatar
Paul Bakker committed
409

410 411
test_suite_debug$(EXEXT): test_suite_debug.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
412
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
413

414 415
test_suite_version$(EXEXT): test_suite_version.c $(DEP)
	echo   "  CC    	$<"
Alon Bar-Lev's avatar
Alon Bar-Lev committed
416
	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $<	$(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
417

Paul Bakker's avatar
Paul Bakker committed
418
clean:
419
ifndef WINDOWS
Paul Bakker's avatar
Paul Bakker committed
420
	rm -f $(APPS) *.c
421 422 423 424
endif
ifdef WINDOWS
	del /Q /F *.c *.exe
endif
Paul Bakker's avatar
Paul Bakker committed
425

426
check: $(APPS)
427
ifndef WINDOWS
428
	echo "Running checks (Success if all tests PASSED)"
429
	RETURN=0;																\
430 431 432
	for i in $(APPS);														\
	do																		\
		echo " - $${i}";													\
433
		RESULT=`$(CHECK_PRELOAD) ./$${i} | grep -v 'PASS$$' | grep -v -- '----' | grep -v '^$$'`;	\
434
		PASSED=`echo $$RESULT |grep PASSED`; 								\
435
		echo "   $$RESULT";													\
436
		if [ "x$$PASSED" = "x" ];											\
437 438 439 440
		then																\
			echo "**** Failed ***************";								\
			RETURN=1;														\
		fi; 																\
441
		echo "";															\
442 443
	done;																	\
	if [ "$$RETURN" -eq 1 ]; then exit 1; fi
444
endif