component.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. #
  2. # Copyright (C) 2006-2024 wolfSSL Inc.
  3. #
  4. # This file is part of wolfSSL.
  5. #
  6. # wolfSSL is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # wolfSSL is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  19. #
  20. $(info *********** wolfssl component ************)
  21. #
  22. # Component Makefile
  23. #
  24. #
  25. # The Espressif Managed Components are only for newer versions of the ESP-IDF
  26. # Typically only for ESP32[-x] targets and only for ESP-IDF v4.3 or later:
  27. # See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html
  28. # https://components.espressif.com/
  29. #
  30. # Usage:
  31. #
  32. # make flash
  33. #
  34. # make flash ESPPORT=/dev/ttyS55
  35. #
  36. # make flash ESPBAUD=9600
  37. #
  38. # make monitor ESPPORT=COM1
  39. #
  40. # make monitor ESPPORT=/dev/ttyS55 MONITORBAUD=115200
  41. #
  42. # export ESPPORT=/dev/ttyS55
  43. #
  44. # https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/index.html
  45. #
  46. # Although the project should define WOLFSSL_USER_SETTINGS, we'll also
  47. # define it here:
  48. CFLAGS +=-DWOLFSSL_USER_SETTINGS
  49. # Note that 4 source files created by autogen are excluded here.
  50. #
  51. # See these files commented out, below. Adjust as needed for your application:
  52. #
  53. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o
  54. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/selftest.o
  55. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_first.o
  56. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_last.o
  57. # NOTICE: the WOLFSSL_ROOT setting MUST be relative!
  58. # See https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/api-guides/build-system.html?highlight=must+relative#optional-component-specific-variables
  59. # In the wolfSSL GitHub examples for Espressif:
  60. # https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples
  61. # When this wolfssl component.mk makefile is in [project]/components/wolfssl
  62. # The root is 7 directories up from here (the location of of this component.mk):
  63. WOLFSSL_ROOT := ../../../../../../..
  64. # To set the location of a different location, it is best to use relative paths.
  65. #
  66. # Set WOLFSSL_ROOT to a relative path from the current component directory.
  67. # For example, if the wolfssl_client is copied from the examples to test:
  68. #
  69. # cp -r /IDE/Espressif/ESP-IDF/examples/wolfssl_client/* /mnt/c/test/demo
  70. #
  71. # we run make in /mnt/c/test/demo
  72. # component is in /mnt/c/test/demo/components/wolfssl
  73. # wolfssl is in /mnt/c/workspace/wolfssl-master
  74. #
  75. # "/mnt/c" is 4 directories up:
  76. # 2 for `./test/demo` from where we run `make`, plus
  77. # 2 more from the location of `component.mk` located
  78. # in `[current directory]/components/wolfssl`.
  79. #
  80. # Thus we need 4 parent reference to find the relative path to wolfSSL:
  81. # WOLFSSL_ROOT := ../../../../workspace/wolfssl-master
  82. # Optional CFLAGS (make works without these; for reference only)
  83. # CFLAGS += -I$(WOLFSSL_ROOT)/wolfssl
  84. # CFLAGS += -I$(WOLFSSL_ROOT)/wolfssl/wolfcrypt
  85. # CFLAGS += -I$(WOLFSSL_ROOT)/wolfssl/wolfcrypt/port/Espressif
  86. abs_WOLFSSL_ROOT := $(shell realpath $(WOLFSSL_ROOT))
  87. # print-wolfssl-path-value:
  88. # @echo "WOLFSSL_ROOT defined: $(WOLFSSL_ROOT)"
  89. # @echo "WOLFSSL_ROOT actual: $(abs_WOLFSSL_ROOT)"
  90. $(info WOLFSSL_ROOT defined: $(WOLFSSL_ROOT))
  91. $(info WOLFSSL_ROOT actual: $(abs_WOLFSSL_ROOT))
  92. # NOTE: The wolfSSL include directory (e.g. user_settings.h) is
  93. # located HERE in THIS project, and *not* in the wolfSSL root.
  94. COMPONENT_ADD_INCLUDEDIRS := .
  95. COMPONENT_ADD_INCLUDEDIRS += include
  96. COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/.
  97. COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl
  98. COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt
  99. COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt/port/Espressif
  100. # COMPONENT_ADD_INCLUDEDIRS += $ENV(IDF_PATH)/components/freertos/include/freertos
  101. # COMPONENT_ADD_INCLUDEDIRS += "$ENV(IDF_PATH)/soc/esp32s3/include/soc"
  102. # wolfSSL
  103. COMPONENT_SRCDIRS := $(WOLFSSL_ROOT)/src
  104. # wolfcrypt
  105. COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src
  106. # Espressif
  107. COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif
  108. COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/atmel
  109. COMPONENT_OBJEXCLUDE := $(WOLFSSL_ROOT)/wolfcrypt/src/aes_asm.o
  110. COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/evp.o
  111. COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/misc.o
  112. COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/sha512_asm.o
  113. COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_x25519_asm.o
  114. COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/wolfcrypt/src/aes_gcm_x86_asm.o
  115. COMPONENT_OBJEXCLUDE += $(WOLFSSL_ROOT)/src/bio.o
  116. ##
  117. ## wolfSSL
  118. ##
  119. COMPONENT_OBJS := $(WOLFSSL_ROOT)/src/bio.o
  120. # COMPONENT_OBJS += src/conf.o
  121. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/crl.o
  122. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/dtls.o
  123. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/dtls13.o
  124. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/internal.o
  125. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/keys.o
  126. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/ocsp.o
  127. # COMPONENT_OBJS += src/pk.o
  128. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/quic.o
  129. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/sniffer.o
  130. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/ssl.o
  131. # COMPONENT_OBJS += src/ssl_asn1.o
  132. # COMPONENT_OBJS += src/ssl_bn.o
  133. # COMPONENT_OBJS += src/ssl_certman.o
  134. # COMPONENT_OBJS += src/ssl_crypto.o
  135. # COMPONENT_OBJS += src/ssl_misc.o
  136. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/tls.o
  137. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/tls13.o
  138. COMPONENT_OBJS += $(WOLFSSL_ROOT)/src/wolfio.o
  139. # COMPONENT_OBJS += src/x509.o
  140. # COMPONENT_OBJS += src/x509_str.o
  141. ##
  142. ## wolfcrypt
  143. ##
  144. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
  145. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
  146. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
  147. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
  148. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
  149. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2b.o
  150. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2s.o
  151. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/camellia.o
  152. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/chacha.o
  153. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/chacha20_poly1305.o
  154. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/cmac.o
  155. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/coding.o
  156. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/compress.o
  157. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/cpuid.o
  158. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/cryptocb.o
  159. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/curve25519.o
  160. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/curve448.o
  161. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/des3.o
  162. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/dh.o
  163. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/dilithium.o
  164. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/dsa.o
  165. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ecc.o
  166. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/eccsi.o
  167. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ecc_fp.o
  168. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed25519.o
  169. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed448.o
  170. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/error.o
  171. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/evp.o
  172. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_kyber.o
  173. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_lms.o
  174. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_xmss.o
  175. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/falcon.o
  176. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_448.o
  177. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_low_mem.o
  178. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fe_operations.o
  179. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fips.o
  180. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/fips_test.o
  181. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ge_448.o
  182. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ge_low_mem.o
  183. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ge_operations.o
  184. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/hash.o
  185. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/hmac.o
  186. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/hpke.o
  187. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/integer.o
  188. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/kdf.o
  189. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/logging.o
  190. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/md2.o
  191. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/md4.o
  192. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/md5.o
  193. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/memory.o
  194. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/misc.o
  195. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/pkcs12.o
  196. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/pkcs7.o
  197. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/poly1305.o
  198. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/pwdbased.o
  199. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/random.o
  200. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rc2.o
  201. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ripemd.o
  202. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rsa.o
  203. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sakke.o
  204. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/selftest.o # autogen exclusion
  205. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha.o
  206. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha256.o
  207. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha3.o
  208. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha512.o
  209. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/signature.o
  210. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/siphash.o
  211. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sm2.o
  212. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sm3.o
  213. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sm4.o
  214. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sphincs.o
  215. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_arm32.o
  216. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_arm64.o
  217. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_armthumb.o
  218. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_c32.o
  219. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_c64.o
  220. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_cortexm.o
  221. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_dsp32.o
  222. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_int.o
  223. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_arm32.o
  224. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_arm64.o
  225. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_armthumb.o
  226. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_c32.o
  227. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_c64.o
  228. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_cortexm.o
  229. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_sm2_x86_64.o
  230. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sp_x86_64.o
  231. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/srp.o
  232. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/tfm.o
  233. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_dsp.o
  234. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_encrypt.o
  235. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_kyber.o
  236. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_kyber_poly.o
  237. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_lms.o
  238. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_pkcs11.o
  239. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_port.o
  240. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_xmss.o
  241. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_first.o # autogen exclusion
  242. # COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_last.o # autogen exclusion
  243. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfevent.o
  244. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfmath.o
  245. ##
  246. ## Espressif
  247. ##
  248. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_aes.o
  249. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_mp.o
  250. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_sha.o
  251. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp32_util.o
  252. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_mem_lib.o
  253. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_time_lib.o
  254. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_wifi_lib.o
  255. ##
  256. ## wolfcrypt benchmark (optional)
  257. ##
  258. ## COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/benchmark/benchmark.o
  259. ## COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/benchmark
  260. ## COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfcrypt/benchmark
  261. ##
  262. ## wolfcrypt test (optional)
  263. ##
  264. COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/test/test.o
  265. COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/test
  266. ##
  267. ## wolfcrypt
  268. ##
  269. # COMPONENT_PRIV_INCLUDEDIRS += $(PROJECT_PATH)/components/wolfssl/include
  270. COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/src
  271. $(info ********** end wolfssl component **********)