component.mk 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # Component Makefile
  3. #
  4. COMPONENT_SRCDIRS := . hwcrypto
  5. LIBS := core net80211 phy rtc pp wpa smartconfig coexist wps wpa2
  6. LINKER_SCRIPTS += -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld
  7. COMPONENT_ADD_LDFLAGS := -lesp32 \
  8. $(COMPONENT_PATH)/libhal.a \
  9. -L$(COMPONENT_PATH)/lib \
  10. $(addprefix -l,$(LIBS)) \
  11. -L $(COMPONENT_PATH)/ld \
  12. $(LINKER_SCRIPTS)
  13. ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
  14. COMPONENT_SUBMODULES += lib
  15. # this is a hack to make sure the app is re-linked if the binary
  16. # libraries change or are updated. If they change, the main esp32
  17. # library will be rebuild by AR andthis will trigger a re-linking of
  18. # the entire app.
  19. #
  20. # It would be better for components to be able to expose any of these
  21. # non-standard dependencies via get_variable, but this will do for now.
  22. $(COMPONENT_LIBRARY): $(ALL_LIB_FILES)
  23. # Preprocess esp32.ld linker script into esp32_out.ld
  24. #
  25. # The library doesn't really depend on esp32_out.ld, but it
  26. # saves us from having to add the target to a Makefile.projbuild
  27. $(COMPONENT_LIBRARY): esp32_out.ld
  28. esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
  29. $(CC) -I ../include -C -P -x c -E $< -o $@
  30. COMPONENT_EXTRA_CLEAN := esp32_out.ld