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