component.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. # Match up all the module source files with their corresponding Kconfig
  2. # option in the form LUA_MODULE_<modname> and if enabled, add a
  3. # "-u <modname>_module_selected1" option to force the linker to include
  4. # the module. See components/core/include/module.h for further details on
  5. # how this works.
  6. -include $(PROJECT_PATH)/build/include/config/auto.conf
  7. include $(PROJECT_PATH)/components/modules/uppercase.mk
  8. ifneq (4.0, $(firstword $(sort $(MAKE_VERSION) 4.0)))
  9. # make versions below 4.0 will fail on the uppercase function used in
  10. # the exapnsion of MODULE_NAMES.
  11. $(error GNU make version 4.0 or above required)
  12. endif
  13. MODULE_NAMES:=$(call uppercase,$(patsubst $(COMPONENT_PATH)/%.c,%,$(wildcard $(COMPONENT_PATH)/*.c)))
  14. FORCE_LINK:=$(foreach mod,$(MODULE_NAMES),$(if $(CONFIG_LUA_MODULE_$(mod)), -u $(mod)_module_selected1))
  15. COMPONENT_ADD_LDFLAGS=$(FORCE_LINK) -lmodules $(if $(CONFIG_LUA_MODULE_BTHCI),-lbtdm_app)
  16. # These are disabled by default in the IDF, so switch them back on
  17. CFLAGS += \
  18. -Werror=unused-function \
  19. -Werror=unused-but-set-variable \
  20. -Werror=unused-variable \
  21. COMPONENT_EXTRA_CLEAN := u8g2_fonts.h u8g2_displays.h
  22. u8g2.o: u8g2_fonts.h u8g2_displays.h
  23. u8g2_fonts.h: $(BUILD_DIR_BASE)/include/sdkconfig.h
  24. perl -w $(PROJECT_PATH)/tools/u8g2_config_fonts.pl < $^ > $@
  25. u8g2_displays.h: $(BUILD_DIR_BASE)/include/sdkconfig.h
  26. perl -w $(PROJECT_PATH)/tools/u8g2_config_displays.pl < $^ > $@