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