component.mk 1.5 KB

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