component.mk 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. COMPONENT_ADD_INCLUDEDIRS := include
  2. ifdef IS_BOOTLOADER_BUILD
  3. # share "include_bootloader" headers with bootloader main component
  4. COMPONENT_ADD_INCLUDEDIRS += include_bootloader
  5. else
  6. COMPONENT_PRIV_INCLUDEDIRS := include_bootloader
  7. endif
  8. COMPONENT_SRCDIRS := src
  9. ifndef IS_BOOTLOADER_BUILD
  10. COMPONENT_SRCDIRS += src/idf # idf sub-directory contains platform agnostic IDF versions
  11. else
  12. COMPONENT_SRCDIRS += src/$(IDF_TARGET) # one sub-dir per chip
  13. endif
  14. ifndef IS_BOOTLOADER_BUILD
  15. COMPONENT_OBJEXCLUDE := src/bootloader_init.o \
  16. src/bootloader_panic.o \
  17. src/bootloader_clock_loader.o \
  18. src/bootloader_console.o \
  19. src/bootloader_console_loader.o
  20. endif
  21. COMPONENT_OBJEXCLUDE += src/bootloader_flash_config_esp32s2.o \
  22. src/bootloader_flash_config_esp32s3.o \
  23. src/bootloader_efuse_esp32s2.o \
  24. src/bootloader_efuse_esp32s3.o \
  25. src/bootloader_random_esp32s2.o \
  26. src/bootloader_random_esp32s3.o
  27. ifndef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
  28. ifndef CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME
  29. COMPONENT_OBJEXCLUDE += src/$(IDF_TARGET)/secure_boot_signatures.o \
  30. src/idf/secure_boot_signatures.o
  31. endif
  32. endif
  33. ifndef CONFIG_SECURE_BOOT
  34. COMPONENT_OBJEXCLUDE += src/$(IDF_TARGET)/secure_boot.o
  35. endif
  36. #
  37. # Secure boot signing key support
  38. #
  39. ifdef CONFIG_SECURE_SIGNED_APPS
  40. ifdef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
  41. # this path is created relative to the component build directory
  42. SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
  43. ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  44. # verification key derived from signing key.
  45. $(SECURE_BOOT_VERIFICATION_KEY): $(SECURE_BOOT_SIGNING_KEY) $(SDKCONFIG_MAKEFILE)
  46. $(ESPSECUREPY) extract_public_key --keyfile $< $@
  47. else
  48. # find the configured public key file
  49. ORIG_SECURE_BOOT_VERIFICATION_KEY := $(call resolvepath,$(call dequote,$(CONFIG_SECURE_BOOT_VERIFICATION_KEY)),$(PROJECT_PATH))
  50. $(ORIG_SECURE_BOOT_VERIFICATION_KEY):
  51. @echo "Secure boot verification public key '$@' missing."
  52. @echo "This can be extracted from the private signing key, see"
  53. @echo "docs/security/secure-boot-v1.rst for details."
  54. exit 1
  55. # copy it into the build dir, so the secure boot verification key has
  56. # a predictable file name
  57. $(SECURE_BOOT_VERIFICATION_KEY): $(ORIG_SECURE_BOOT_VERIFICATION_KEY) $(SDKCONFIG_MAKEFILE)
  58. $(summary) CP $< $@
  59. cp $< $@
  60. endif #CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  61. COMPONENT_EXTRA_CLEAN += $(SECURE_BOOT_VERIFICATION_KEY)
  62. COMPONENT_EMBED_FILES := $(SECURE_BOOT_VERIFICATION_KEY)
  63. endif #CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
  64. endif #CONFIG_SECURE_SIGNED_APPS