component.mk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  2. # Component Makefile
  3. #
  4. COMPONENT_SRCDIRS := . hwcrypto
  5. ifndef CONFIG_NO_BLOBS
  6. LIBS := core rtc net80211 pp wpa smartconfig coexist wps wpa2 phy
  7. endif
  8. LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
  9. ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
  10. LINKER_SCRIPTS += esp32.rom.nanofmt.ld
  11. endif
  12. ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
  13. LINKER_SCRIPTS += esp32.rom.spiflash.ld
  14. endif
  15. #ld_include_panic_highint_hdl is added as an undefined symbol because otherwise the
  16. #linker will ignore panic_highint_hdl.S as it has no other files depending on any
  17. #symbols in it.
  18. COMPONENT_ADD_LDFLAGS += $(COMPONENT_PATH)/libhal.a \
  19. -L$(COMPONENT_PATH)/lib \
  20. $(addprefix -l,$(LIBS)) \
  21. -L $(COMPONENT_PATH)/ld \
  22. -T esp32_out.ld \
  23. -u ld_include_panic_highint_hdl \
  24. $(addprefix -T ,$(LINKER_SCRIPTS))
  25. ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
  26. COMPONENT_SUBMODULES += lib
  27. # final linking of project ELF depends on all binary libraries, and
  28. # all linker scripts (except esp32_out.ld, as this is code generated here.)
  29. COMPONENT_ADD_LINKER_DEPS := $(ALL_LIB_FILES) $(addprefix ld/,$(LINKER_SCRIPTS))
  30. # Preprocess esp32.ld linker script into esp32_out.ld
  31. #
  32. # The library doesn't really depend on esp32_out.ld, but it
  33. # saves us from having to add the target to a Makefile.projbuild
  34. $(COMPONENT_LIBRARY): esp32_out.ld
  35. esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
  36. $(CC) -I ../include -C -P -x c -E $< -o $@
  37. COMPONENT_EXTRA_CLEAN := esp32_out.ld