component.mk 1.8 KB

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