Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. # To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
  2. # To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
  3. CFLAGS ?= -O2
  4. WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
  5. WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
  6. LDFLAGS ?=
  7. MBEDTLS_TEST_PATH:=../tests/src
  8. MBEDTLS_TEST_OBJS:=$(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/*.c ${MBEDTLS_TEST_PATH}/drivers/*.c))
  9. LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../tests/include -I../include -D_FILE_OFFSET_BITS=64
  10. LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -D_FILE_OFFSET_BITS=64
  11. LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \
  12. -L../library \
  13. -lmbedtls$(SHARED_SUFFIX) \
  14. -lmbedx509$(SHARED_SUFFIX) \
  15. -lmbedcrypto$(SHARED_SUFFIX)
  16. ifeq ($(shell uname -s),Linux)
  17. DLOPEN_LDFLAGS ?= -ldl
  18. else
  19. DLOPEN_LDFLAGS ?=
  20. endif
  21. include ../3rdparty/Makefile.inc
  22. LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES)
  23. ifndef SHARED
  24. MBEDLIBS=../library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a
  25. else
  26. MBEDLIBS=../library/libmbedcrypto.$(DLEXT) ../library/libmbedx509.$(DLEXT) ../library/libmbedtls.$(DLEXT)
  27. endif
  28. DEP=${MBEDLIBS} ${MBEDTLS_TEST_OBJS}
  29. ifdef DEBUG
  30. LOCAL_CFLAGS += -g3
  31. endif
  32. # if we're running on Windows, build for Windows
  33. ifdef WINDOWS
  34. WINDOWS_BUILD=1
  35. endif
  36. ifdef WINDOWS_BUILD
  37. DLEXT=dll
  38. EXEXT=.exe
  39. LOCAL_LDFLAGS += -lws2_32
  40. ifdef SHARED
  41. SHARED_SUFFIX=.$(DLEXT)
  42. endif
  43. else
  44. DLEXT ?= so
  45. EXEXT=
  46. SHARED_SUFFIX=
  47. endif
  48. # Zlib shared library extensions:
  49. ifdef ZLIB
  50. LOCAL_LDFLAGS += -lz
  51. endif
  52. # Only build the dlopen test in shared library builds, and not when building
  53. # for Windows.
  54. ifdef BUILD_DLOPEN
  55. # Don't override the value
  56. else ifdef WINDOWS_BUILD
  57. BUILD_DLOPEN =
  58. else ifdef SHARED
  59. BUILD_DLOPEN = y
  60. else
  61. BUILD_DLOPEN =
  62. endif
  63. APPS = \
  64. aes/crypt_and_hash$(EXEXT) \
  65. hash/generic_sum$(EXEXT) \
  66. hash/hello$(EXEXT) \
  67. pkey/dh_client$(EXEXT) \
  68. pkey/dh_genprime$(EXEXT) \
  69. pkey/dh_server$(EXEXT) \
  70. pkey/ecdh_curve25519$(EXEXT) \
  71. pkey/ecdsa$(EXEXT) \
  72. pkey/gen_key$(EXEXT) \
  73. pkey/key_app$(EXEXT) \
  74. pkey/key_app_writer$(EXEXT) \
  75. pkey/mpi_demo$(EXEXT) \
  76. pkey/pk_decrypt$(EXEXT) \
  77. pkey/pk_encrypt$(EXEXT) \
  78. pkey/pk_sign$(EXEXT) \
  79. pkey/pk_verify$(EXEXT) \
  80. pkey/rsa_decrypt$(EXEXT) \
  81. pkey/rsa_encrypt$(EXEXT) \
  82. pkey/rsa_genkey$(EXEXT) \
  83. pkey/rsa_sign$(EXEXT) \
  84. pkey/rsa_sign_pss$(EXEXT) \
  85. pkey/rsa_verify$(EXEXT) \
  86. pkey/rsa_verify_pss$(EXEXT) \
  87. psa/crypto_examples$(EXEXT) \
  88. psa/key_ladder_demo$(EXEXT) \
  89. psa/psa_constant_names$(EXEXT) \
  90. random/gen_entropy$(EXEXT) \
  91. random/gen_random_ctr_drbg$(EXEXT) \
  92. random/gen_random_havege$(EXEXT) \
  93. ssl/dtls_client$(EXEXT) \
  94. ssl/dtls_server$(EXEXT) \
  95. ssl/mini_client$(EXEXT) \
  96. ssl/ssl_client1$(EXEXT) \
  97. ssl/ssl_client2$(EXEXT) \
  98. ssl/ssl_context_info$(EXEXT) \
  99. ssl/ssl_fork_server$(EXEXT) \
  100. ssl/ssl_mail_client$(EXEXT) \
  101. ssl/ssl_server$(EXEXT) \
  102. ssl/ssl_server2$(EXEXT) \
  103. test/benchmark$(EXEXT) \
  104. test/query_compile_time_config$(EXEXT) \
  105. test/selftest$(EXEXT) \
  106. test/udp_proxy$(EXEXT) \
  107. test/zeroize$(EXEXT) \
  108. util/pem2der$(EXEXT) \
  109. util/strerror$(EXEXT) \
  110. x509/cert_app$(EXEXT) \
  111. x509/cert_req$(EXEXT) \
  112. x509/cert_write$(EXEXT) \
  113. x509/crl_app$(EXEXT) \
  114. x509/load_roots$(EXEXT) \
  115. x509/req_app$(EXEXT) \
  116. # End of APPS
  117. ifdef PTHREAD
  118. APPS += ssl/ssl_pthread_server$(EXEXT)
  119. endif
  120. ifdef BUILD_DLOPEN
  121. APPS += test/dlopen
  122. endif
  123. ifdef TEST_CPP
  124. APPS += test/cpp_dummy_build$(EXEXT)
  125. endif
  126. .SILENT:
  127. .PHONY: all clean list fuzz
  128. all: $(APPS)
  129. ifndef WINDOWS
  130. # APPS doesn't include the fuzzing programs, which aren't "normal"
  131. # sample or test programs, and don't build with MSVC which is
  132. # warning about fopen
  133. all: fuzz
  134. endif
  135. fuzz: ${MBEDTLS_TEST_OBJS}
  136. $(MAKE) -C fuzz THIRDPARTY_INCLUDES=$(THIRDPARTY_INCLUDES)
  137. $(MBEDLIBS):
  138. $(MAKE) -C ../library
  139. ${MBEDTLS_TEST_OBJS}:
  140. $(MAKE) -C ../tests mbedtls_test
  141. aes/crypt_and_hash$(EXEXT): aes/crypt_and_hash.c $(DEP)
  142. echo " CC aes/crypt_and_hash.c"
  143. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) aes/crypt_and_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  144. hash/hello$(EXEXT): hash/hello.c $(DEP)
  145. echo " CC hash/hello.c"
  146. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/hello.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  147. hash/generic_sum$(EXEXT): hash/generic_sum.c $(DEP)
  148. echo " CC hash/generic_sum.c"
  149. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/generic_sum.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  150. pkey/dh_client$(EXEXT): pkey/dh_client.c $(DEP)
  151. echo " CC pkey/dh_client.c"
  152. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  153. pkey/dh_genprime$(EXEXT): pkey/dh_genprime.c $(DEP)
  154. echo " CC pkey/dh_genprime.c"
  155. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_genprime.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  156. pkey/dh_server$(EXEXT): pkey/dh_server.c $(DEP)
  157. echo " CC pkey/dh_server.c"
  158. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/dh_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  159. pkey/ecdh_curve25519$(EXEXT): pkey/ecdh_curve25519.c $(DEP)
  160. echo " CC pkey/ecdh_curve25519.c"
  161. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/ecdh_curve25519.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  162. pkey/ecdsa$(EXEXT): pkey/ecdsa.c $(DEP)
  163. echo " CC pkey/ecdsa.c"
  164. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/ecdsa.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  165. pkey/gen_key$(EXEXT): pkey/gen_key.c $(DEP)
  166. echo " CC pkey/gen_key.c"
  167. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/gen_key.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  168. pkey/key_app$(EXEXT): pkey/key_app.c $(DEP)
  169. echo " CC pkey/key_app.c"
  170. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/key_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  171. pkey/key_app_writer$(EXEXT): pkey/key_app_writer.c $(DEP)
  172. echo " CC pkey/key_app_writer.c"
  173. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/key_app_writer.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  174. pkey/mpi_demo$(EXEXT): pkey/mpi_demo.c $(DEP)
  175. echo " CC pkey/mpi_demo.c"
  176. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/mpi_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  177. pkey/pk_decrypt$(EXEXT): pkey/pk_decrypt.c $(DEP)
  178. echo " CC pkey/pk_decrypt.c"
  179. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_decrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  180. pkey/pk_encrypt$(EXEXT): pkey/pk_encrypt.c $(DEP)
  181. echo " CC pkey/pk_encrypt.c"
  182. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  183. pkey/pk_sign$(EXEXT): pkey/pk_sign.c $(DEP)
  184. echo " CC pkey/pk_sign.c"
  185. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_sign.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  186. pkey/pk_verify$(EXEXT): pkey/pk_verify.c $(DEP)
  187. echo " CC pkey/pk_verify.c"
  188. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/pk_verify.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  189. pkey/rsa_genkey$(EXEXT): pkey/rsa_genkey.c $(DEP)
  190. echo " CC pkey/rsa_genkey.c"
  191. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_genkey.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  192. pkey/rsa_sign$(EXEXT): pkey/rsa_sign.c $(DEP)
  193. echo " CC pkey/rsa_sign.c"
  194. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_sign.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  195. pkey/rsa_verify$(EXEXT): pkey/rsa_verify.c $(DEP)
  196. echo " CC pkey/rsa_verify.c"
  197. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_verify.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  198. pkey/rsa_sign_pss$(EXEXT): pkey/rsa_sign_pss.c $(DEP)
  199. echo " CC pkey/rsa_sign_pss.c"
  200. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_sign_pss.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  201. pkey/rsa_verify_pss$(EXEXT): pkey/rsa_verify_pss.c $(DEP)
  202. echo " CC pkey/rsa_verify_pss.c"
  203. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_verify_pss.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  204. pkey/rsa_decrypt$(EXEXT): pkey/rsa_decrypt.c $(DEP)
  205. echo " CC pkey/rsa_decrypt.c"
  206. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_decrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  207. pkey/rsa_encrypt$(EXEXT): pkey/rsa_encrypt.c $(DEP)
  208. echo " CC pkey/rsa_encrypt.c"
  209. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) pkey/rsa_encrypt.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  210. psa/key_ladder_demo$(EXEXT): psa/key_ladder_demo.c $(DEP)
  211. echo " CC psa/key_ladder_demo.c"
  212. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/key_ladder_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  213. psa/psa_constant_names$(EXEXT): psa/psa_constant_names.c psa/psa_constant_names_generated.c $(DEP)
  214. echo " CC psa/psa_constant_names.c"
  215. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/psa_constant_names.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  216. random/gen_entropy$(EXEXT): random/gen_entropy.c $(DEP)
  217. echo " CC random/gen_entropy.c"
  218. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_entropy.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  219. random/gen_random_havege$(EXEXT): random/gen_random_havege.c $(DEP)
  220. echo " CC random/gen_random_havege.c"
  221. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_random_havege.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  222. random/gen_random_ctr_drbg$(EXEXT): random/gen_random_ctr_drbg.c $(DEP)
  223. echo " CC random/gen_random_ctr_drbg.c"
  224. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) random/gen_random_ctr_drbg.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  225. ssl/dtls_client$(EXEXT): ssl/dtls_client.c $(DEP)
  226. echo " CC ssl/dtls_client.c"
  227. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  228. ssl/dtls_server$(EXEXT): ssl/dtls_server.c $(DEP)
  229. echo " CC ssl/dtls_server.c"
  230. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/dtls_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  231. ssl/ssl_client1$(EXEXT): ssl/ssl_client1.c $(DEP)
  232. echo " CC ssl/ssl_client1.c"
  233. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client1.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  234. SSL_TEST_OBJECTS = test/query_config.o ssl/ssl_test_lib.o
  235. SSL_TEST_DEPS = $(SSL_TEST_OBJECTS) \
  236. test/query_config.h \
  237. ssl/ssl_test_lib.h \
  238. ssl/ssl_test_common_source.c \
  239. $(DEP)
  240. ssl/ssl_test_lib.o: ssl/ssl_test_lib.c ssl/ssl_test_lib.h $(DEP)
  241. echo " CC ssl/ssl_test_lib.c"
  242. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c ssl/ssl_test_lib.c -o $@
  243. ssl/ssl_client2$(EXEXT): ssl/ssl_client2.c $(SSL_TEST_DEPS)
  244. echo " CC ssl/ssl_client2.c"
  245. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_client2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  246. ssl/ssl_server$(EXEXT): ssl/ssl_server.c $(DEP)
  247. echo " CC ssl/ssl_server.c"
  248. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  249. ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c $(SSL_TEST_DEPS)
  250. echo " CC ssl/ssl_server2.c"
  251. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  252. ssl/ssl_context_info$(EXEXT): ssl/ssl_context_info.c test/query_config.o test/query_config.h $(DEP)
  253. echo " CC ssl/ssl_context_info.c"
  254. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_context_info.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  255. ssl/ssl_fork_server$(EXEXT): ssl/ssl_fork_server.c $(DEP)
  256. echo " CC ssl/ssl_fork_server.c"
  257. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_fork_server.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  258. ssl/ssl_pthread_server$(EXEXT): ssl/ssl_pthread_server.c $(DEP)
  259. echo " CC ssl/ssl_pthread_server.c"
  260. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_pthread_server.c $(LOCAL_LDFLAGS) -lpthread $(LDFLAGS) -o $@
  261. ssl/ssl_mail_client$(EXEXT): ssl/ssl_mail_client.c $(DEP)
  262. echo " CC ssl/ssl_mail_client.c"
  263. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_mail_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  264. ssl/mini_client$(EXEXT): ssl/mini_client.c $(DEP)
  265. echo " CC ssl/mini_client.c"
  266. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/mini_client.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  267. test/benchmark$(EXEXT): test/benchmark.c $(DEP)
  268. echo " CC test/benchmark.c"
  269. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/benchmark.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  270. test/cpp_dummy_build.cpp: test/generate_cpp_dummy_build.sh
  271. echo " Gen test/cpp_dummy_build.cpp"
  272. test/generate_cpp_dummy_build.sh
  273. test/cpp_dummy_build$(EXEXT): test/cpp_dummy_build.cpp $(DEP)
  274. echo " CXX test/cpp_dummy_build.cpp"
  275. $(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) test/cpp_dummy_build.cpp $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  276. ifdef BUILD_DLOPEN
  277. test/dlopen$(EXEXT): test/dlopen.c $(DEP)
  278. echo " CC test/dlopen.c"
  279. # Do not link any test objects (that would bring in a static dependency on
  280. # libmbedcrypto at least). Do not link with libmbed* (that would defeat the
  281. # purpose of testing dynamic loading).
  282. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/dlopen.c $(LDFLAGS) $(DLOPEN_LDFLAGS) -o $@
  283. endif
  284. test/query_config.o: test/query_config.c test/query_config.h $(DEP)
  285. echo " CC test/query_config.c"
  286. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c test/query_config.c -o $@
  287. test/selftest$(EXEXT): test/selftest.c $(DEP)
  288. echo " CC test/selftest.c"
  289. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/selftest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  290. test/udp_proxy$(EXEXT): test/udp_proxy.c $(DEP)
  291. echo " CC test/udp_proxy.c"
  292. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/udp_proxy.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  293. test/zeroize$(EXEXT): test/zeroize.c $(DEP)
  294. echo " CC test/zeroize.c"
  295. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/zeroize.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  296. test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c test/query_config.o test/query_config.h $(DEP)
  297. echo " CC test/query_compile_time_config.c"
  298. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  299. util/pem2der$(EXEXT): util/pem2der.c $(DEP)
  300. echo " CC util/pem2der.c"
  301. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/pem2der.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  302. util/strerror$(EXEXT): util/strerror.c $(DEP)
  303. echo " CC util/strerror.c"
  304. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) util/strerror.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  305. x509/cert_app$(EXEXT): x509/cert_app.c $(DEP)
  306. echo " CC x509/cert_app.c"
  307. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  308. x509/cert_write$(EXEXT): x509/cert_write.c $(DEP)
  309. echo " CC x509/cert_write.c"
  310. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_write.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  311. x509/crl_app$(EXEXT): x509/crl_app.c $(DEP)
  312. echo " CC x509/crl_app.c"
  313. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/crl_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  314. x509/cert_req$(EXEXT): x509/cert_req.c $(DEP)
  315. echo " CC x509/cert_req.c"
  316. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/cert_req.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  317. x509/load_roots$(EXEXT): x509/load_roots.c $(DEP)
  318. echo " CC x509/load_roots.c"
  319. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/load_roots.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  320. x509/req_app$(EXEXT): x509/req_app.c $(DEP)
  321. echo " CC x509/req_app.c"
  322. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) x509/req_app.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  323. psa/crypto_examples$(EXEXT): psa/crypto_examples.c $(DEP)
  324. echo " CC psa/crypto_examples.c"
  325. $(CC) $(LOCAL_CFLAGS) $(CFLAGS) psa/crypto_examples.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
  326. clean:
  327. ifndef WINDOWS
  328. rm -f $(APPS)
  329. -rm -f ssl/ssl_pthread_server$(EXEXT)
  330. -rm -f test/cpp_dummy_build.cpp test/cpp_dummy_build$(EXEXT)
  331. -rm -f test/dlopen$(EXEXT)
  332. else
  333. if exist *.o del /Q /F *.o
  334. if exist *.exe del /Q /F *.exe
  335. if exist test\cpp_dummy_build.cpp del /Q /F test\cpp_dummy_build.cpp
  336. endif
  337. $(MAKE) -C fuzz clean
  338. list:
  339. echo $(APPS)