component.mk 1.7 KB

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