2016-08-17 15:08:22 +00:00
|
|
|
#
|
|
|
|
# Component Makefile
|
|
|
|
#
|
|
|
|
|
2016-09-08 09:41:43 +00:00
|
|
|
COMPONENT_SRCDIRS := . hwcrypto
|
2017-01-16 00:52:15 +00:00
|
|
|
LIBS := core rtc phy
|
|
|
|
ifdef CONFIG_BT_ENABLED
|
|
|
|
LIBS += coexist
|
|
|
|
endif
|
|
|
|
ifdef CONFIG_WIFI_ENABLED
|
|
|
|
LIBS += net80211 pp wpa smartconfig coexist wps wpa2
|
|
|
|
endif
|
2016-09-08 09:41:43 +00:00
|
|
|
|
2017-01-16 00:52:15 +00:00
|
|
|
LIBS := $(sort $(LIBS)) # de-duplicate, we can handle different orders here
|
2016-08-19 06:32:35 +00:00
|
|
|
|
2016-12-12 04:54:30 +00:00
|
|
|
LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
|
2016-08-19 10:45:49 +00:00
|
|
|
|
2016-11-07 10:43:29 +00:00
|
|
|
ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
|
2016-12-12 04:54:30 +00:00
|
|
|
LINKER_SCRIPTS += esp32.rom.nanofmt.ld
|
2016-11-07 10:43:29 +00:00
|
|
|
endif
|
|
|
|
|
2016-08-17 15:08:22 +00:00
|
|
|
COMPONENT_ADD_LDFLAGS := -lesp32 \
|
2016-12-12 04:54:30 +00:00
|
|
|
$(COMPONENT_PATH)/libhal.a \
|
|
|
|
-L$(COMPONENT_PATH)/lib \
|
|
|
|
$(addprefix -l,$(LIBS)) \
|
|
|
|
-L $(COMPONENT_PATH)/ld \
|
|
|
|
-T esp32_out.ld \
|
|
|
|
$(addprefix -T ,$(LINKER_SCRIPTS))
|
2016-08-17 15:08:22 +00:00
|
|
|
|
2016-08-19 06:20:28 +00:00
|
|
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
|
|
|
|
2016-11-16 00:12:48 +00:00
|
|
|
COMPONENT_SUBMODULES += lib
|
2016-08-19 06:20:28 +00:00
|
|
|
|
2016-12-12 04:54:30 +00:00
|
|
|
# final linking of project ELF depends on all binary libraries, and
|
|
|
|
# all linker scripts (except esp32_out.ld, as this is code generated here.)
|
|
|
|
COMPONENT_ADD_LINKER_DEPS := $(ALL_LIB_FILES) $(addprefix ld/,$(LINKER_SCRIPTS))
|
2016-09-21 01:04:16 +00: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
|