component.mk 1.5 KB

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