component.mk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. endif
  17. COMPONENT_OBJEXCLUDE += src/bootloader_flash_config_esp32s2beta.o \
  18. src/bootloader_efuse_esp32s2beta.o
  19. #
  20. # Secure boot signing key support
  21. #
  22. ifdef CONFIG_SECURE_SIGNED_APPS
  23. # this path is created relative to the component build directory
  24. SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
  25. ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  26. # verification key derived from signing key.
  27. $(SECURE_BOOT_VERIFICATION_KEY): $(SECURE_BOOT_SIGNING_KEY) $(SDKCONFIG_MAKEFILE)
  28. $(ESPSECUREPY) extract_public_key --keyfile $< $@
  29. else
  30. # find the configured public key file
  31. ORIG_SECURE_BOOT_VERIFICATION_KEY := $(call resolvepath,$(call dequote,$(CONFIG_SECURE_BOOT_VERIFICATION_KEY)),$(PROJECT_PATH))
  32. $(ORIG_SECURE_BOOT_VERIFICATION_KEY):
  33. @echo "Secure boot verification public key '$@' missing."
  34. @echo "This can be extracted from the private signing key, see"
  35. @echo "docs/security/secure-boot.rst for details."
  36. exit 1
  37. # copy it into the build dir, so the secure boot verification key has
  38. # a predictable file name
  39. $(SECURE_BOOT_VERIFICATION_KEY): $(ORIG_SECURE_BOOT_VERIFICATION_KEY) $(SDKCONFIG_MAKEFILE)
  40. $(summary) CP $< $@
  41. cp $< $@
  42. endif #CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  43. COMPONENT_EXTRA_CLEAN += $(SECURE_BOOT_VERIFICATION_KEY)
  44. COMPONENT_EMBED_FILES := $(SECURE_BOOT_VERIFICATION_KEY)
  45. endif #CONFIG_SECURE_SIGNED_APPS