blob: 0f1356e76a40f1881f5b5e72637d43b6eb209bea [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001
2# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
Paul Bakker5121ce52009-01-03 21:22:43 +00003
Alon Bar-Levf7a9f302015-02-18 17:55:05 +02004CFLAGS ?= -O2
Paul Elliott9e3256a2020-12-17 18:17:32 +00005WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
6WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
Alon Bar-Levada41052015-02-18 17:47:52 +02007LDFLAGS ?=
Alon Bar-Levf7a9f302015-02-18 17:55:05 +02008
Ronald Cron8dc0af22020-06-05 16:00:22 +02009MBEDTLS_TEST_PATH:=../tests/src
Steven Cooremana70d5882020-07-16 20:26:18 +020010MBEDTLS_TEST_OBJS:=$(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/*.c ${MBEDTLS_TEST_PATH}/drivers/*.c))
Ronald Cron8dc0af22020-06-05 16:00:22 +020011
12LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../tests/include -I../include -D_FILE_OFFSET_BITS=64
Mateusz Starzyk1aec6462021-02-08 15:34:42 +010013LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -I../tests/include -D_FILE_OFFSET_BITS=64
Ronald Cron8dc0af22020-06-05 16:00:22 +020014LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
15 -L../library \
Manuel Pégourié-Gonnard21e1ac22015-06-25 08:45:12 +020016 -lmbedtls$(SHARED_SUFFIX) \
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +020017 -lmbedx509$(SHARED_SUFFIX) \
Manuel Pégourié-Gonnard21e1ac22015-06-25 08:45:12 +020018 -lmbedcrypto$(SHARED_SUFFIX)
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +020019
Christoph M. Wintersteiger6ea2dea12019-01-21 17:26:19 +000020include ../3rdparty/Makefile.inc
21LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
Jaeden Amero30b340a2018-10-25 17:37:00 +010022
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +020023ifndef SHARED
Ronald Cron8dc0af22020-06-05 16:00:22 +020024MBEDLIBS=../library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +020025else
Ronald Cron8dc0af22020-06-05 16:00:22 +020026MBEDLIBS=../library/libmbedcrypto.$(DLEXT) ../library/libmbedx509.$(DLEXT) ../library/libmbedtls.$(DLEXT)
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +020027endif
Ronald Cron8dc0af22020-06-05 16:00:22 +020028DEP=${MBEDLIBS} ${MBEDTLS_TEST_OBJS}
Christoph M. Wintersteiger977d89a2018-10-25 12:47:03 +010029
Paul Bakkerc7ffd362012-04-05 12:08:29 +000030ifdef DEBUG
Alon Bar-Levf7a9f302015-02-18 17:55:05 +020031LOCAL_CFLAGS += -g3
Paul Bakkerc7ffd362012-04-05 12:08:29 +000032endif
33
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +020034# if we're running on Windows, build for Windows
Paul Bakkercd5b5292012-05-10 20:49:10 +000035ifdef WINDOWS
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020036WINDOWS_BUILD=1
37endif
38
39ifdef WINDOWS_BUILD
40DLEXT=dll
41EXEXT=.exe
Alon Bar-Levada41052015-02-18 17:47:52 +020042LOCAL_LDFLAGS += -lws2_32
Alon Bar-Lev18ba0cc2015-02-14 01:04:58 +020043ifdef SHARED
44SHARED_SUFFIX=.$(DLEXT)
45endif
Manuel Pégourié-Gonnard8d4a6132015-06-24 12:16:20 +020046else
Andres Amaya Garcia420f0cc2018-03-27 19:17:21 +010047DLEXT ?= so
Manuel Pégourié-Gonnard8d4a6132015-06-24 12:16:20 +020048EXEXT=
49SHARED_SUFFIX=
Paul Bakkercd5b5292012-05-10 20:49:10 +000050endif
51
Gilles Peskine8de196a2020-02-11 17:18:08 +010052APPS = \
Gilles Peskine8de196a2020-02-11 17:18:08 +010053 aes/crypt_and_hash$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010054 hash/generic_sum$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020055 hash/hello$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010056 pkey/dh_client$(EXEXT) \
57 pkey/dh_genprime$(EXEXT) \
58 pkey/dh_server$(EXEXT) \
59 pkey/ecdh_curve25519$(EXEXT) \
60 pkey/ecdsa$(EXEXT) \
61 pkey/gen_key$(EXEXT) \
62 pkey/key_app$(EXEXT) \
63 pkey/key_app_writer$(EXEXT) \
64 pkey/mpi_demo$(EXEXT) \
65 pkey/pk_decrypt$(EXEXT) \
66 pkey/pk_encrypt$(EXEXT) \
67 pkey/pk_sign$(EXEXT) \
68 pkey/pk_verify$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010069 pkey/rsa_decrypt$(EXEXT) \
70 pkey/rsa_encrypt$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020071 pkey/rsa_genkey$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010072 pkey/rsa_sign$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010073 pkey/rsa_sign_pss$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020074 pkey/rsa_verify$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010075 pkey/rsa_verify_pss$(EXEXT) \
Jaeden Amero30fae8e2018-12-20 17:44:21 +000076 psa/crypto_examples$(EXEXT) \
77 psa/key_ladder_demo$(EXEXT) \
78 psa/psa_constant_names$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020079 random/gen_entropy$(EXEXT) \
80 random/gen_random_ctr_drbg$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010081 ssl/dtls_client$(EXEXT) \
82 ssl/dtls_server$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020083 ssl/mini_client$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010084 ssl/ssl_client1$(EXEXT) \
85 ssl/ssl_client2$(EXEXT) \
Piotr Nowickibc876d42020-03-26 12:49:15 +010086 ssl/ssl_context_info$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010087 ssl/ssl_fork_server$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010088 ssl/ssl_mail_client$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020089 ssl/ssl_server$(EXEXT) \
90 ssl/ssl_server2$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010091 test/benchmark$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +020092 test/query_compile_time_config$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010093 test/selftest$(EXEXT) \
94 test/udp_proxy$(EXEXT) \
95 test/zeroize$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010096 util/pem2der$(EXEXT) \
97 util/strerror$(EXEXT) \
98 x509/cert_app$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +010099 x509/cert_req$(EXEXT) \
100 x509/cert_write$(EXEXT) \
Manuel Pégourié-Gonnard10a5b532020-04-03 11:50:59 +0200101 x509/crl_app$(EXEXT) \
Gilles Peskine8de196a2020-02-11 17:18:08 +0100102 x509/req_app$(EXEXT) \
103# End of APPS
Paul Bakker5121ce52009-01-03 21:22:43 +0000104
Paul Bakkerf9c49532013-12-19 15:40:58 +0100105ifdef PTHREAD
Manuel Pégourié-Gonnarda7c89032015-06-29 15:47:35 +0200106APPS += ssl/ssl_pthread_server$(EXEXT)
Paul Bakkerf9c49532013-12-19 15:40:58 +0100107endif
108
Andrzej Kurek0211c322018-03-15 05:16:24 -0400109ifdef TEST_CPP
Andrzej Kurek89c048c2018-03-16 07:37:44 -0400110APPS += test/cpp_dummy_build$(EXEXT)
Andrzej Kurek0211c322018-03-15 05:16:24 -0400111endif
112
Paul Bakker5121ce52009-01-03 21:22:43 +0000113.SILENT:
114
Philippe Antoine48f35f52019-06-27 08:46:45 +0200115.PHONY: all clean list fuzz
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200116
Paul Bakker5121ce52009-01-03 21:22:43 +0000117all: $(APPS)
Philippe Antoinea864db02019-07-10 20:37:57 +0200118ifndef WINDOWS
119# APPS doesn't include the fuzzing programs, which aren't "normal"
120# sample or test programs, and don't build with MSVC which is
121# warning about fopen
122all: fuzz
123endif
Philippe Antoine48f35f52019-06-27 08:46:45 +0200124
Ronald Cron8dc0af22020-06-05 16:00:22 +0200125fuzz: ${MBEDTLS_TEST_OBJS}
Janos Follath4f055f42019-08-20 15:12:54 +0100126 $(MAKE) -C fuzz THIRDPARTY_INCLUDES=$(THIRDPARTY_INCLUDES)
Paul Bakker5121ce52009-01-03 21:22:43 +0000127
Ronald Cron8dc0af22020-06-05 16:00:22 +0200128$(MBEDLIBS):
Manuel Pégourié-Gonnardfc367082015-06-26 16:50:24 +0200129 $(MAKE) -C ../library
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200130
Ronald Cron8dc0af22020-06-05 16:00:22 +0200131${MBEDTLS_TEST_OBJS}:
132 $(MAKE) -C ../tests mbedtls_test
133
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200134aes/crypt_and_hash$(EXEXT): aes/crypt_and_hash.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100135 echo " CC aes/crypt_and_hash.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200136 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) aes/crypt_and_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker20a78082011-01-21 09:32:12 +0000137
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200138hash/hello$(EXEXT): hash/hello.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100139 echo " CC hash/hello.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200140 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/hello.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000141
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200142hash/generic_sum$(EXEXT): hash/generic_sum.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100143 echo " CC hash/generic_sum.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200144 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/generic_sum.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkerfb6c7e22011-01-21 10:21:11 +0000145
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200146pkey/dh_client$(EXEXT): pkey/dh_client.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100147 echo " CC pkey/dh_client.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200148 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000149
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200150pkey/dh_genprime$(EXEXT): pkey/dh_genprime.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100151 echo " CC pkey/dh_genprime.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200152 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_genprime.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000153
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200154pkey/dh_server$(EXEXT): pkey/dh_server.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100155 echo " CC pkey/dh_server.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200156 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000157
Manuel Pégourié-Gonnard3eb8c342015-10-09 12:11:14 +0100158pkey/ecdh_curve25519$(EXEXT): pkey/ecdh_curve25519.c $(DEP)
159 echo " CC pkey/ecdh_curve25519.c"
160 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/ecdh_curve25519.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
161
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200162pkey/ecdsa$(EXEXT): pkey/ecdsa.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100163 echo " CC pkey/ecdsa.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200164 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/ecdsa.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Manuel Pégourié-Gonnardaa431612013-08-09 17:10:27 +0200165
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200166pkey/gen_key$(EXEXT): pkey/gen_key.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100167 echo " CC pkey/gen_key.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200168 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/gen_key.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker15b9b3a2013-09-23 12:05:44 +0200169
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200170pkey/key_app$(EXEXT): pkey/key_app.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100171 echo " CC pkey/key_app.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200172 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/key_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkered56b222011-07-13 11:26:43 +0000173
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200174pkey/key_app_writer$(EXEXT): pkey/key_app_writer.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100175 echo " CC pkey/key_app_writer.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200176 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/key_app_writer.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000177
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200178pkey/mpi_demo$(EXEXT): pkey/mpi_demo.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100179 echo " CC pkey/mpi_demo.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200180 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/mpi_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000181
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200182pkey/pk_decrypt$(EXEXT): pkey/pk_decrypt.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100183 echo " CC pkey/pk_decrypt.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200184 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_decrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker940f9ce2013-09-18 15:34:57 +0200185
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200186pkey/pk_encrypt$(EXEXT): pkey/pk_encrypt.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100187 echo " CC pkey/pk_encrypt.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200188 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker940f9ce2013-09-18 15:34:57 +0200189
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200190pkey/pk_sign$(EXEXT): pkey/pk_sign.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100191 echo " CC pkey/pk_sign.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200192 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_sign.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker940f9ce2013-09-18 15:34:57 +0200193
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200194pkey/pk_verify$(EXEXT): pkey/pk_verify.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100195 echo " CC pkey/pk_verify.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200196 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_verify.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker940f9ce2013-09-18 15:34:57 +0200197
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200198pkey/rsa_genkey$(EXEXT): pkey/rsa_genkey.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100199 echo " CC pkey/rsa_genkey.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200200 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_genkey.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000201
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200202pkey/rsa_sign$(EXEXT): pkey/rsa_sign.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100203 echo " CC pkey/rsa_sign.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200204 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_sign.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000205
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200206pkey/rsa_verify$(EXEXT): pkey/rsa_verify.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100207 echo " CC pkey/rsa_verify.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200208 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_verify.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000209
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200210pkey/rsa_sign_pss$(EXEXT): pkey/rsa_sign_pss.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100211 echo " CC pkey/rsa_sign_pss.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200212 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_sign_pss.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkere77db2e2011-03-25 14:01:32 +0000213
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200214pkey/rsa_verify_pss$(EXEXT): pkey/rsa_verify_pss.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100215 echo " CC pkey/rsa_verify_pss.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200216 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_verify_pss.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkere77db2e2011-03-25 14:01:32 +0000217
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200218pkey/rsa_decrypt$(EXEXT): pkey/rsa_decrypt.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100219 echo " CC pkey/rsa_decrypt.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200220 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_decrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker7bc05ff2011-08-09 10:30:36 +0000221
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200222pkey/rsa_encrypt$(EXEXT): pkey/rsa_encrypt.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100223 echo " CC pkey/rsa_encrypt.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200224 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker7bc05ff2011-08-09 10:30:36 +0000225
Gilles Peskinef0fa4362018-07-16 17:08:43 +0200226psa/key_ladder_demo$(EXEXT): psa/key_ladder_demo.c $(DEP)
227 echo " CC psa/key_ladder_demo.c"
228 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/key_ladder_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
229
Gilles Peskine4a707402021-02-24 21:45:38 +0100230psa/psa_constant_names$(EXEXT): psa/psa_constant_names.c psa/psa_constant_names_generated.c $(DEP)
Gilles Peskine029b5d62018-07-16 23:13:37 +0200231 echo " CC psa/psa_constant_names.c"
232 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/psa_constant_names.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
233
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200234random/gen_entropy$(EXEXT): random/gen_entropy.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100235 echo " CC random/gen_entropy.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200236 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_entropy.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker6083fd22011-12-03 21:45:14 +0000237
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200238random/gen_random_ctr_drbg$(EXEXT): random/gen_random_ctr_drbg.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100239 echo " CC random/gen_random_ctr_drbg.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200240 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_random_ctr_drbg.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkerfc36d162011-01-27 16:50:02 +0000241
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200242ssl/dtls_client$(EXEXT): ssl/dtls_client.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100243 echo " CC ssl/dtls_client.c"
Manuel Pégourié-Gonnard8d4a6132015-06-24 12:16:20 +0200244 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Manuel Pégourié-Gonnarde63582a2014-10-14 11:47:21 +0200245
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200246ssl/dtls_server$(EXEXT): ssl/dtls_server.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100247 echo " CC ssl/dtls_server.c"
Manuel Pégourié-Gonnard8d4a6132015-06-24 12:16:20 +0200248 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Manuel Pégourié-Gonnarde63582a2014-10-14 11:47:21 +0200249
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200250ssl/ssl_client1$(EXEXT): ssl/ssl_client1.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100251 echo " CC ssl/ssl_client1.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200252 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client1.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000253
Gilles Peskinea3ed34f2021-01-05 21:11:16 +0100254SSL_TEST_OBJECTS = test/query_config.o ssl/ssl_test_lib.o
Gilles Peskinec772b182021-01-12 15:55:10 +0100255SSL_TEST_DEPS = $(SSL_TEST_OBJECTS) \
256 test/query_config.h \
257 ssl/ssl_test_lib.h \
258 ssl/ssl_test_common_source.c \
259 $(DEP)
Gilles Peskinef06a54c2021-01-05 20:59:50 +0100260
Gilles Peskinea3ed34f2021-01-05 21:11:16 +0100261ssl/ssl_test_lib.o: ssl/ssl_test_lib.c ssl/ssl_test_lib.h $(DEP)
262 echo " CC ssl/ssl_test_lib.c"
263 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c ssl/ssl_test_lib.c -o $@
264
Gilles Peskine0d980b82021-01-05 23:34:27 +0100265ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c $(SSL_TEST_DEPS)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100266 echo " CC ssl/ssl_client2.c"
Gilles Peskinef06a54c2021-01-05 20:59:50 +0100267 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000268
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200269ssl/ssl_server$(EXEXT): ssl/ssl_server.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100270 echo " CC ssl/ssl_server.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200271 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000272
Gilles Peskine0d980b82021-01-05 23:34:27 +0100273ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c $(SSL_TEST_DEPS)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100274 echo " CC ssl/ssl_server2.c"
Gilles Peskinef06a54c2021-01-05 20:59:50 +0100275 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkerb60b95f2012-09-25 09:05:17 +0000276
Gilles Peskinec772b182021-01-12 15:55:10 +0100277ssl/ssl_context_info$(EXEXT): ssl/ssl_context_info.c test/query_config.o test/query_config.h $(DEP)
Piotr Nowickibc876d42020-03-26 12:49:15 +0100278 echo " CC ssl/ssl_context_info.c"
Gilles Peskinef06a54c2021-01-05 20:59:50 +0100279 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_context_info.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Piotr Nowicki9370f902020-03-13 14:43:22 +0100280
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200281ssl/ssl_fork_server$(EXEXT): ssl/ssl_fork_server.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100282 echo " CC ssl/ssl_fork_server.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200283 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_fork_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker896ac222011-05-20 12:33:05 +0000284
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200285ssl/ssl_pthread_server$(EXEXT): ssl/ssl_pthread_server.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100286 echo " CC ssl/ssl_pthread_server.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200287 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_pthread_server.c $(LOCAL_LDFLAGS) -lpthread $(LDFLAGS) -o $@
Paul Bakkerf9c49532013-12-19 15:40:58 +0100288
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200289ssl/ssl_mail_client$(EXEXT): ssl/ssl_mail_client.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100290 echo " CC ssl/ssl_mail_client.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200291 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_mail_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker1496d382011-05-23 12:07:29 +0000292
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200293ssl/mini_client$(EXEXT): ssl/mini_client.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100294 echo " CC ssl/mini_client.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200295 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/mini_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Manuel Pégourié-Gonnarda6fc5b22014-11-24 14:05:25 +0100296
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200297test/benchmark$(EXEXT): test/benchmark.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100298 echo " CC test/benchmark.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200299 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/benchmark.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000300
Andrzej Kurek89c048c2018-03-16 07:37:44 -0400301test/cpp_dummy_build$(EXEXT): test/cpp_dummy_build.cpp $(DEP)
302 echo " CXX test/cpp_dummy_build.cpp"
303 $(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) test/cpp_dummy_build.cpp $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Andrzej Kurek40741f82018-03-14 17:24:01 -0400304
Gilles Peskinec772b182021-01-12 15:55:10 +0100305test/query_config.o: test/query_config.c test/query_config.h $(DEP)
Gilles Peskinef06a54c2021-01-05 20:59:50 +0100306 echo " CC test/query_config.c"
307 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c test/query_config.c -o $@
308
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200309test/selftest$(EXEXT): test/selftest.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100310 echo " CC test/selftest.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200311 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/selftest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker5121ce52009-01-03 21:22:43 +0000312
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200313test/udp_proxy$(EXEXT): test/udp_proxy.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100314 echo " CC test/udp_proxy.c"
Manuel Pégourié-Gonnard8d4a6132015-06-24 12:16:20 +0200315 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/udp_proxy.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Manuel Pégourié-Gonnardcb4137b2014-09-04 14:55:28 +0200316
Andres Amaya Garcia5ab74a12017-10-24 21:10:45 +0100317test/zeroize$(EXEXT): test/zeroize.c $(DEP)
318 echo " CC test/zeroize.c"
319 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/zeroize.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
320
Gilles Peskinec772b182021-01-12 15:55:10 +0100321test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c test/query_config.o test/query_config.h $(DEP)
Andres AG509ba692018-10-26 18:41:08 +0100322 echo " CC test/query_compile_time_config.c"
Gilles Peskinef06a54c2021-01-05 20:59:50 +0100323 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Andres AG509ba692018-10-26 18:41:08 +0100324
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200325util/pem2der$(EXEXT): util/pem2der.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100326 echo " CC util/pem2der.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200327 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/pem2der.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker8adf13b2013-08-25 14:50:09 +0200328
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200329util/strerror$(EXEXT): util/strerror.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100330 echo " CC util/strerror.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200331 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/strerror.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker01cc3942012-05-08 08:36:15 +0000332
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200333x509/cert_app$(EXEXT): x509/cert_app.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100334 echo " CC x509/cert_app.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200335 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakker4fc45522010-03-18 20:11:58 +0000336
Manuel Pégourié-Gonnarda7c89032015-06-29 15:47:35 +0200337x509/cert_write$(EXEXT): x509/cert_write.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100338 echo " CC x509/cert_write.c"
Manuel Pégourié-Gonnarda7c89032015-06-29 15:47:35 +0200339 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_write.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
340
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200341x509/crl_app$(EXEXT): x509/crl_app.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100342 echo " CC x509/crl_app.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200343 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/crl_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkera9507c02011-02-12 15:27:28 +0000344
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200345x509/cert_req$(EXEXT): x509/cert_req.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100346 echo " CC x509/cert_req.c"
Alon Bar-Levf7a9f302015-02-18 17:55:05 +0200347 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_req.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
Paul Bakkerbdb912d2012-02-13 23:11:30 +0000348
Manuel Pégourié-Gonnarda7c89032015-06-29 15:47:35 +0200349x509/req_app$(EXEXT): x509/req_app.c $(DEP)
Manuel Pégourié-Gonnard78ec2b02015-07-08 22:12:06 +0100350 echo " CC x509/req_app.c"
Manuel Pégourié-Gonnarda7c89032015-06-29 15:47:35 +0200351 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/req_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
352
itayzafrira3ff8a62018-07-10 10:10:21 +0300353psa/crypto_examples$(EXEXT): psa/crypto_examples.c $(DEP)
354 echo " CC psa/crypto_examples.c"
355 $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/crypto_examples.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
356
Paul Bakker5121ce52009-01-03 21:22:43 +0000357clean:
Paul Bakker62f88dc2012-05-10 21:26:28 +0000358ifndef WINDOWS
Paul Bakker5121ce52009-01-03 21:22:43 +0000359 rm -f $(APPS)
Jaeden Amerobefe1e152019-06-03 09:14:14 +0100360 -rm -f ssl/ssl_pthread_server$(EXEXT)
361 -rm -f test/cpp_dummy_build$(EXEXT)
Manuel Pégourié-Gonnard5c59a4f2015-06-24 13:06:24 +0200362else
Darryl Green9b9a7902019-08-30 14:51:55 +0100363 if exist *.o del /Q /F *.o
364 if exist *.exe del /Q /F *.exe
Paul Bakker62f88dc2012-05-10 21:26:28 +0000365endif
Philippe Antoine48f35f52019-06-27 08:46:45 +0200366 $(MAKE) -C fuzz clean
Manuel Pégourié-Gonnard1b578782013-09-16 13:33:42 +0200367
368list:
369 echo $(APPS)