2016-08-17 11:08:22 -04:00
|
|
|
#
|
|
|
|
# Component Makefile
|
|
|
|
#
|
2016-08-31 19:19:06 -04:00
|
|
|
# This Makefile should, at the very least, just include $(IDF_PATH)/make/component_common.mk. By default,
|
2016-08-17 11:08:22 -04:00
|
|
|
# this will take the sources in this directory, compile them and link them into
|
|
|
|
# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
|
2016-08-19 02:32:35 -04:00
|
|
|
# please read the esp-idf build system document if you need to do this.
|
2016-08-17 11:08:22 -04:00
|
|
|
#
|
2016-08-19 06:45:49 -04:00
|
|
|
-include $(PROJECT_PATH)/build/include/config/auto.conf
|
2016-08-17 11:08:22 -04:00
|
|
|
|
2016-09-08 05:41:43 -04:00
|
|
|
COMPONENT_SRCDIRS := . hwcrypto
|
|
|
|
|
2016-08-17 11:08:22 -04:00
|
|
|
LIBS := crypto core net80211 phy rtc pp wpa wps
|
2016-08-19 02:32:35 -04:00
|
|
|
|
2016-09-20 21:04:16 -04:00
|
|
|
LINKER_SCRIPTS += -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld
|
2016-08-19 06:45:49 -04:00
|
|
|
|
2016-08-17 11:08:22 -04:00
|
|
|
COMPONENT_ADD_LDFLAGS := -lesp32 \
|
|
|
|
$(abspath libhal.a) \
|
|
|
|
-L$(abspath lib) \
|
|
|
|
$(addprefix -l,$(LIBS)) \
|
|
|
|
-L $(abspath ld) \
|
2016-08-19 06:45:49 -04:00
|
|
|
$(LINKER_SCRIPTS)
|
2016-08-17 11:08:22 -04:00
|
|
|
|
2016-08-31 19:19:06 -04:00
|
|
|
include $(IDF_PATH)/make/component_common.mk
|
2016-08-19 02:20:28 -04:00
|
|
|
|
|
|
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
|
|
|
|
2016-09-12 03:48:40 -04:00
|
|
|
# automatically trigger a git submodule update
|
|
|
|
# if any libraries are missing
|
|
|
|
$(eval $(call SubmoduleRequiredForFiles,$(ALL_LIB_FILES)))
|
2016-08-19 02:20:28 -04:00
|
|
|
|
2016-09-04 20:49:12 -04:00
|
|
|
# this is a hack to make sure the app is re-linked if the binary
|
|
|
|
# libraries change or are updated. If they change, the main esp32
|
|
|
|
# library will be rebuild by AR andthis will trigger a re-linking of
|
|
|
|
# the entire app.
|
|
|
|
#
|
|
|
|
# It would be better for components to be able to expose any of these
|
|
|
|
# non-standard dependencies via get_variable, but this will do for now.
|
|
|
|
$(COMPONENT_LIBRARY): $(ALL_LIB_FILES)
|
2016-09-20 21:04:16 -04:00
|
|
|
|
|
|
|
# Preprocess esp32.ld linker script into esp32_out.ld
|
|
|
|
#
|
|
|
|
# The library doesn't really depend on esp32_out.ld, but it
|
|
|
|
# saves us from having to add the target to a Makefile.projbuild
|
|
|
|
$(COMPONENT_LIBRARY): esp32_out.ld
|
|
|
|
|
|
|
|
esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
|
|
|
|
$(CC) -I ../include -C -P -x c -E $< -o $@
|
|
|
|
|
|
|
|
COMPONENT_EXTRA_CLEAN := esp32_out.ld
|