component.mk 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # Component Makefile
  3. #
  4. # This Makefile should, at the very least, just include $(IDF_PATH)/make/component_common.mk. By default,
  5. # this will take the sources in this directory, compile them and link them into
  6. # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
  7. # please read the esp-idf build system document if you need to do this.
  8. #
  9. -include $(PROJECT_PATH)/build/include/config/auto.conf
  10. COMPONENT_SRCDIRS := . hwcrypto
  11. LIBS := crypto core net80211 phy rtc pp wpa wps
  12. ifeq ($(CONFIG_MEMMAP_BT),y)
  13. ifeq ($(CONFIG_MEMMAP_TRACEMEM),y)
  14. LINKER_SCRIPTS = -T esp32.bt.trace.ld
  15. else
  16. LINKER_SCRIPTS = -T esp32.bt.ld
  17. endif
  18. else
  19. ifeq ($(CONFIG_MEMMAP_TRACEMEM),y)
  20. LINKER_SCRIPTS = -T esp32.trace.ld
  21. else
  22. LINKER_SCRIPTS = -T esp32.ld
  23. endif
  24. endif
  25. LINKER_SCRIPTS += -T esp32.common.ld -T esp32.rom.ld
  26. COMPONENT_ADD_LDFLAGS := -lesp32 \
  27. $(abspath libhal.a) \
  28. -L$(abspath lib) \
  29. $(addprefix -l,$(LIBS)) \
  30. -L $(abspath ld) \
  31. $(LINKER_SCRIPTS)
  32. include $(IDF_PATH)/make/component_common.mk
  33. ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
  34. # automatically trigger a git submodule update
  35. # if any libraries are missing
  36. $(eval $(call SubmoduleRequiredForFiles,$(ALL_LIB_FILES)))
  37. # this is a hack to make sure the app is re-linked if the binary
  38. # libraries change or are updated. If they change, the main esp32
  39. # library will be rebuild by AR andthis will trigger a re-linking of
  40. # the entire app.
  41. #
  42. # It would be better for components to be able to expose any of these
  43. # non-standard dependencies via get_variable, but this will do for now.
  44. $(COMPONENT_LIBRARY): $(ALL_LIB_FILES)