component.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # Component Makefile
  3. #
  4. COMPONENT_SRCDIRS := . hwcrypto
  5. LIBS := core rtc rtc_clk
  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. COMPONENT_ADD_LDFLAGS := -lesp32 \
  17. $(COMPONENT_PATH)/libhal.a \
  18. -L$(COMPONENT_PATH)/lib \
  19. $(addprefix -l,$(LIBS)) \
  20. -L $(COMPONENT_PATH)/ld \
  21. -T esp32_out.ld \
  22. $(addprefix -T ,$(LINKER_SCRIPTS))
  23. ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
  24. COMPONENT_SUBMODULES += lib
  25. # final linking of project ELF depends on all binary libraries, and
  26. # all linker scripts (except esp32_out.ld, as this is code generated here.)
  27. COMPONENT_ADD_LINKER_DEPS := $(ALL_LIB_FILES) $(addprefix ld/,$(LINKER_SCRIPTS))
  28. # Preprocess esp32.ld linker script into esp32_out.ld
  29. #
  30. # The library doesn't really depend on esp32_out.ld, but it
  31. # saves us from having to add the target to a Makefile.projbuild
  32. $(COMPONENT_LIBRARY): esp32_out.ld
  33. esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
  34. $(CC) -I ../include -C -P -x c -E $< -o $@
  35. COMPONENT_EXTRA_CLEAN := esp32_out.ld