1MBEDTLS_TEST_PATH = ../tests
2include ../scripts/common.make
3
4ifeq ($(shell uname -s),Linux)
5DLOPEN_LDFLAGS ?= -ldl
6else
7DLOPEN_LDFLAGS ?=
8endif
9
10ifdef RECORD_PSA_STATUS_COVERAGE_LOG
11LOCAL_CFLAGS += -Werror -DRECORD_PSA_STATUS_COVERAGE_LOG
12endif
13DEP=${MBEDLIBS} ${MBEDTLS_TEST_OBJS}
14
15# Only build the dlopen test in shared library builds, and not when building
16# for Windows.
17ifdef BUILD_DLOPEN
18# Don't override the value
19else ifdef WINDOWS_BUILD
20BUILD_DLOPEN =
21else ifdef SHARED
22BUILD_DLOPEN = y
23else
24BUILD_DLOPEN =
25endif
26
27## The following assignment is the list of base names of applications that
28## will be built on Windows. Extra Linux/Unix/POSIX-only applications can
29## be declared by appending with `APPS += ...` afterwards.
30## See the get_app_list function in scripts/generate_visualc_files.pl and
31## make sure to check that it still works if you tweak the format here.
32APPS = \
33	aes/crypt_and_hash \
34	cipher/cipher_aead_demo \
35	hash/generic_sum \
36	hash/hello \
37	hash/md_hmac_demo \
38	pkey/dh_client \
39	pkey/dh_genprime \
40	pkey/dh_server \
41	pkey/ecdh_curve25519 \
42	pkey/ecdsa \
43	pkey/gen_key \
44	pkey/key_app \
45	pkey/key_app_writer \
46	pkey/mpi_demo \
47	pkey/pk_decrypt \
48	pkey/pk_encrypt \
49	pkey/pk_sign \
50	pkey/pk_verify \
51	pkey/rsa_decrypt \
52	pkey/rsa_encrypt \
53	pkey/rsa_genkey \
54	pkey/rsa_sign \
55	pkey/rsa_sign_pss \
56	pkey/rsa_verify \
57	pkey/rsa_verify_pss \
58	psa/aead_demo \
59	psa/crypto_examples \
60	psa/hmac_demo \
61	psa/key_ladder_demo \
62	psa/psa_constant_names \
63	psa/psa_hash \
64	random/gen_entropy \
65	random/gen_random_ctr_drbg \
66	ssl/dtls_client \
67	ssl/dtls_server \
68	ssl/mini_client \
69	ssl/ssl_client1 \
70	ssl/ssl_client2 \
71	ssl/ssl_context_info \
72	ssl/ssl_fork_server \
73	ssl/ssl_mail_client \
74	ssl/ssl_server \
75	ssl/ssl_server2 \
76	test/benchmark \
77	test/metatest \
78	test/query_compile_time_config \
79	test/query_included_headers \
80	test/selftest \
81	test/udp_proxy \
82	test/zeroize \
83	util/pem2der \
84	util/strerror \
85	x509/cert_app \
86	x509/cert_req \
87	x509/cert_write \
88	x509/crl_app \
89	x509/load_roots \
90	x509/req_app \
91# End of APPS
92
93ifeq ($(THREADING),pthread)
94APPS +=	ssl/ssl_pthread_server
95endif
96
97ifdef BUILD_DLOPEN
98APPS +=	test/dlopen
99endif
100
101ifdef TEST_CPP
102APPS += test/cpp_dummy_build
103endif
104
105EXES = $(patsubst %,%$(EXEXT),$(APPS))
106
107.SILENT:
108
109.PHONY: all clean list fuzz
110
111all: $(EXES)
112ifndef WINDOWS
113# APPS doesn't include the fuzzing programs, which aren't "normal"
114# sample or test programs, and don't build with MSVC which is
115# warning about fopen
116all: fuzz
117endif
118
119fuzz: ${MBEDTLS_TEST_OBJS}
120	$(MAKE) -C fuzz
121
122${MBEDTLS_TEST_OBJS}:
123	$(MAKE) -C ../tests mbedtls_test
124
125.PHONY: generated_files
126GENERATED_FILES = psa/psa_constant_names_generated.c test/query_config.c
127generated_files: $(GENERATED_FILES)
128
129psa/psa_constant_names_generated.c: $(gen_file_dep) ../scripts/generate_psa_constants.py
130psa/psa_constant_names_generated.c: $(gen_file_dep) ../include/psa/crypto_values.h
131psa/psa_constant_names_generated.c: $(gen_file_dep) ../include/psa/crypto_extra.h
132psa/psa_constant_names_generated.c: $(gen_file_dep) ../tests/suites/test_suite_psa_crypto_metadata.data
133psa/psa_constant_names_generated.c:
134	echo "  Gen   $@"
135	$(PYTHON) ../scripts/generate_psa_constants.py
136
137test/query_config.c: $(gen_file_dep) ../scripts/generate_query_config.pl
138## The generated file only depends on the options that are present in mbedtls_config.h,
139## not on which options are set. To avoid regenerating this file all the time
140## when switching between configurations, don't declare mbedtls_config.h as a
141## dependency. Remove this file from your working tree if you've just added or
142## removed an option in mbedtls_config.h.
143#test/query_config.c: $(gen_file_dep) ../include/mbedtls/mbedtls_config.h
144test/query_config.c: $(gen_file_dep) ../scripts/data_files/query_config.fmt
145test/query_config.c:
146	echo "  Gen   $@"
147	$(PERL) ../scripts/generate_query_config.pl
148
149aes/crypt_and_hash$(EXEXT): aes/crypt_and_hash.c $(DEP)
150	echo "  CC    aes/crypt_and_hash.c"
151	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) aes/crypt_and_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
152
153cipher/cipher_aead_demo$(EXEXT): cipher/cipher_aead_demo.c $(DEP)
154	echo "  CC    cipher/cipher_aead_demo.c"
155	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) cipher/cipher_aead_demo.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
156
157hash/generic_sum$(EXEXT): hash/generic_sum.c $(DEP)
158	echo "  CC    hash/generic_sum.c"
159	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/generic_sum.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
160
161hash/hello$(EXEXT): hash/hello.c $(DEP)
162	echo "  CC    hash/hello.c"
163	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/hello.c       $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
164
165hash/md_hmac_demo$(EXEXT): hash/md_hmac_demo.c $(DEP)
166	echo "  CC    hash/md_hmac_demo.c"
167	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/md_hmac_demo.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
168
169pkey/dh_client$(EXEXT): pkey/dh_client.c $(DEP)
170	echo "  CC    pkey/dh_client.c"
171	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_client.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
172
173pkey/dh_genprime$(EXEXT): pkey/dh_genprime.c $(DEP)
174	echo "  CC    pkey/dh_genprime.c"
175	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_genprime.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
176
177pkey/dh_server$(EXEXT): pkey/dh_server.c $(DEP)
178	echo "  CC    pkey/dh_server.c"
179	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_server.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
180
181pkey/ecdh_curve25519$(EXEXT): pkey/ecdh_curve25519.c $(DEP)
182	echo "  CC    pkey/ecdh_curve25519.c"
183	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/ecdh_curve25519.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
184
185pkey/ecdsa$(EXEXT): pkey/ecdsa.c $(DEP)
186	echo "  CC    pkey/ecdsa.c"
187	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/ecdsa.c       $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
188
189pkey/gen_key$(EXEXT): pkey/gen_key.c $(DEP)
190	echo "  CC    pkey/gen_key.c"
191	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/gen_key.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
192
193pkey/key_app$(EXEXT): pkey/key_app.c $(DEP)
194	echo "  CC    pkey/key_app.c"
195	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/key_app.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
196
197pkey/key_app_writer$(EXEXT): pkey/key_app_writer.c $(DEP)
198	echo "  CC    pkey/key_app_writer.c"
199	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/key_app_writer.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
200
201pkey/mpi_demo$(EXEXT): pkey/mpi_demo.c $(DEP)
202	echo "  CC    pkey/mpi_demo.c"
203	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/mpi_demo.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
204
205pkey/pk_decrypt$(EXEXT): pkey/pk_decrypt.c $(DEP)
206	echo "  CC    pkey/pk_decrypt.c"
207	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_decrypt.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
208
209pkey/pk_encrypt$(EXEXT): pkey/pk_encrypt.c $(DEP)
210	echo "  CC    pkey/pk_encrypt.c"
211	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_encrypt.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
212
213pkey/pk_sign$(EXEXT): pkey/pk_sign.c $(DEP)
214	echo "  CC    pkey/pk_sign.c"
215	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_sign.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
216
217pkey/pk_verify$(EXEXT): pkey/pk_verify.c $(DEP)
218	echo "  CC    pkey/pk_verify.c"
219	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_verify.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
220
221pkey/rsa_genkey$(EXEXT): pkey/rsa_genkey.c $(DEP)
222	echo "  CC    pkey/rsa_genkey.c"
223	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_genkey.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
224
225pkey/rsa_sign$(EXEXT): pkey/rsa_sign.c $(DEP)
226	echo "  CC    pkey/rsa_sign.c"
227	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_sign.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
228
229pkey/rsa_verify$(EXEXT): pkey/rsa_verify.c $(DEP)
230	echo "  CC    pkey/rsa_verify.c"
231	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_verify.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
232
233pkey/rsa_sign_pss$(EXEXT): pkey/rsa_sign_pss.c $(DEP)
234	echo "  CC    pkey/rsa_sign_pss.c"
235	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_sign_pss.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
236
237pkey/rsa_verify_pss$(EXEXT): pkey/rsa_verify_pss.c $(DEP)
238	echo "  CC    pkey/rsa_verify_pss.c"
239	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_verify_pss.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
240
241pkey/rsa_decrypt$(EXEXT): pkey/rsa_decrypt.c $(DEP)
242	echo "  CC    pkey/rsa_decrypt.c"
243	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_decrypt.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
244
245pkey/rsa_encrypt$(EXEXT): pkey/rsa_encrypt.c $(DEP)
246	echo "  CC    pkey/rsa_encrypt.c"
247	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_encrypt.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
248
249psa/aead_demo$(EXEXT): psa/aead_demo.c $(DEP)
250	echo "  CC    psa/aead_demo.c"
251	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/aead_demo.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
252
253psa/crypto_examples$(EXEXT): psa/crypto_examples.c $(DEP)
254	echo "  CC    psa/crypto_examples.c"
255	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/crypto_examples.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
256
257psa/hmac_demo$(EXEXT): psa/hmac_demo.c $(DEP)
258	echo "  CC    psa/hmac_demo.c"
259	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/hmac_demo.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
260
261psa/key_ladder_demo$(EXEXT): psa/key_ladder_demo.c $(DEP)
262	echo "  CC    psa/key_ladder_demo.c"
263	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/key_ladder_demo.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
264
265psa/psa_constant_names$(EXEXT): psa/psa_constant_names.c psa/psa_constant_names_generated.c $(DEP)
266	echo "  CC    psa/psa_constant_names.c"
267	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/psa_constant_names.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
268
269psa/psa_hash$(EXEXT): psa/psa_hash.c $(DEP)
270	echo "  CC    psa/psa_hash.c"
271	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/psa_hash.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
272
273random/gen_entropy$(EXEXT): random/gen_entropy.c $(DEP)
274	echo "  CC    random/gen_entropy.c"
275	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_entropy.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
276
277random/gen_random_ctr_drbg$(EXEXT): random/gen_random_ctr_drbg.c $(DEP)
278	echo "  CC    random/gen_random_ctr_drbg.c"
279	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_random_ctr_drbg.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
280
281ssl/dtls_client$(EXEXT): ssl/dtls_client.c $(DEP)
282	echo "  CC    ssl/dtls_client.c"
283	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_client.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
284
285ssl/dtls_server$(EXEXT): ssl/dtls_server.c $(DEP)
286	echo "  CC    ssl/dtls_server.c"
287	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_server.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
288
289ssl/ssl_client1$(EXEXT): ssl/ssl_client1.c $(DEP)
290	echo "  CC    ssl/ssl_client1.c"
291	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client1.c  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
292
293SSL_TEST_OBJECTS = test/query_config.o ssl/ssl_test_lib.o
294SSL_TEST_DEPS = $(SSL_TEST_OBJECTS) \
295		test/query_config.h \
296		ssl/ssl_test_lib.h \
297		ssl/ssl_test_common_source.c \
298		$(DEP)
299
300ssl/ssl_test_lib.o: ssl/ssl_test_lib.c ssl/ssl_test_lib.h $(DEP)
301	echo "  CC    ssl/ssl_test_lib.c"
302	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c ssl/ssl_test_lib.c -o $@
303
304ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c $(SSL_TEST_DEPS)
305	echo "  CC    ssl/ssl_client2.c"
306	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
307
308ssl/ssl_server$(EXEXT): ssl/ssl_server.c $(DEP)
309	echo "  CC    ssl/ssl_server.c"
310	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
311
312ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c $(SSL_TEST_DEPS)
313	echo "  CC    ssl/ssl_server2.c"
314	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
315
316ssl/ssl_context_info$(EXEXT): ssl/ssl_context_info.c test/query_config.o test/query_config.h $(DEP)
317	echo "  CC    ssl/ssl_context_info.c"
318	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_context_info.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
319
320ssl/ssl_fork_server$(EXEXT): ssl/ssl_fork_server.c $(DEP)
321	echo "  CC    ssl/ssl_fork_server.c"
322	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_fork_server.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
323
324ssl/ssl_pthread_server$(EXEXT): ssl/ssl_pthread_server.c $(DEP)
325	echo "  CC    ssl/ssl_pthread_server.c"
326	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_pthread_server.c   $(LOCAL_LDFLAGS) -lpthread  $(LDFLAGS) -o $@
327
328ssl/ssl_mail_client$(EXEXT): ssl/ssl_mail_client.c $(DEP)
329	echo "  CC    ssl/ssl_mail_client.c"
330	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_mail_client.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
331
332ssl/mini_client$(EXEXT): ssl/mini_client.c $(DEP)
333	echo "  CC    ssl/mini_client.c"
334	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/mini_client.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
335
336test/benchmark$(EXEXT): test/benchmark.c $(DEP)
337	echo "  CC    test/benchmark.c"
338	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/benchmark.c   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
339
340test/cpp_dummy_build.cpp: test/generate_cpp_dummy_build.sh
341	echo "  Gen   test/cpp_dummy_build.cpp"
342	test/generate_cpp_dummy_build.sh
343
344test/cpp_dummy_build$(EXEXT): test/cpp_dummy_build.cpp $(DEP)
345	echo "  CXX   test/cpp_dummy_build.cpp"
346	$(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) test/cpp_dummy_build.cpp   $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
347
348ifdef BUILD_DLOPEN
349test/dlopen$(EXEXT): test/dlopen.c $(DEP)
350	echo "  CC    test/dlopen.c"
351# Do not link any test objects (that would bring in a static dependency on
352# libmbedcrypto at least). Do not link with libmbed* (that would defeat the
353# purpose of testing dynamic loading).
354	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/dlopen.c $(LDFLAGS) $(DLOPEN_LDFLAGS) -o $@
355endif
356
357test/metatest$(EXEXT): test/metatest.c $(DEP)
358	echo "  CC    test/metatest.c"
359	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I ../library test/metatest.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
360
361test/query_config.o: test/query_config.c test/query_config.h $(DEP)
362	echo "  CC    test/query_config.c"
363	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c test/query_config.c -o $@
364
365test/query_included_headers$(EXEXT): test/query_included_headers.c $(DEP)
366	echo "  CC    test/query_included_headers.c"
367	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_included_headers.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
368
369test/selftest$(EXEXT): test/selftest.c $(DEP)
370	echo "  CC    test/selftest.c"
371	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/selftest.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
372
373test/udp_proxy$(EXEXT): test/udp_proxy.c $(DEP)
374	echo "  CC    test/udp_proxy.c"
375	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/udp_proxy.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
376
377test/zeroize$(EXEXT): test/zeroize.c $(DEP)
378	echo "  CC    test/zeroize.c"
379	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/zeroize.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
380
381test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c test/query_config.o test/query_config.h $(DEP)
382	echo "  CC    test/query_compile_time_config.c"
383	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
384
385util/pem2der$(EXEXT): util/pem2der.c $(DEP)
386	echo "  CC    util/pem2der.c"
387	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/pem2der.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
388
389util/strerror$(EXEXT): util/strerror.c $(DEP)
390	echo "  CC    util/strerror.c"
391	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/strerror.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
392
393x509/cert_app$(EXEXT): x509/cert_app.c $(DEP)
394	echo "  CC    x509/cert_app.c"
395	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_app.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
396
397x509/cert_write$(EXEXT): x509/cert_write.c $(DEP)
398	echo "  CC    x509/cert_write.c"
399	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_write.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
400
401x509/crl_app$(EXEXT): x509/crl_app.c $(DEP)
402	echo "  CC    x509/crl_app.c"
403	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/crl_app.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
404
405x509/cert_req$(EXEXT): x509/cert_req.c $(DEP)
406	echo "  CC    x509/cert_req.c"
407	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_req.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
408
409x509/load_roots$(EXEXT): x509/load_roots.c $(DEP)
410	echo "  CC    x509/load_roots.c"
411	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/load_roots.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
412
413x509/req_app$(EXEXT): x509/req_app.c $(DEP)
414	echo "  CC    x509/req_app.c"
415	$(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/req_app.c    $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
416
417clean:
418ifndef WINDOWS
419	rm -f $(EXES)
420	-rm -f ssl/ssl_pthread_server$(EXEXT)
421	-rm -f test/cpp_dummy_build.cpp test/cpp_dummy_build$(EXEXT)
422	-rm -f test/dlopen$(EXEXT)
423else
424	if exist *.o del /Q /F *.o
425	if exist *.exe del /Q /F *.exe
426	if exist test\cpp_dummy_build.cpp del /Q /F test\cpp_dummy_build.cpp
427endif
428	$(MAKE) -C fuzz clean
429
430list:
431	echo $(EXES)
432