2016-08-17 11:08:22 -04:00
|
|
|
#
|
|
|
|
# Component Makefile
|
|
|
|
#
|
|
|
|
|
2016-09-08 05:41:43 -04:00
|
|
|
COMPONENT_SRCDIRS := . hwcrypto
|
2017-08-10 01:16:36 -04:00
|
|
|
ifndef CONFIG_NO_BLOBS
|
|
|
|
LIBS := core rtc net80211 pp wpa smartconfig coexist wps wpa2 phy
|
|
|
|
endif
|
2016-09-08 05:41:43 -04:00
|
|
|
|
2016-12-11 23:54:30 -05:00
|
|
|
LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
|
2016-08-19 06:45:49 -04:00
|
|
|
|
2016-11-07 05:43:29 -05:00
|
|
|
ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
|
2016-12-11 23:54:30 -05:00
|
|
|
LINKER_SCRIPTS += esp32.rom.nanofmt.ld
|
2016-11-07 05:43:29 -05:00
|
|
|
endif
|
|
|
|
|
2017-03-09 02:29:00 -05:00
|
|
|
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
|
|
|
LINKER_SCRIPTS += esp32.rom.spiflash.ld
|
|
|
|
endif
|
|
|
|
|
2017-04-18 05:14:32 -04:00
|
|
|
#ld_include_panic_highint_hdl is added as an undefined symbol because otherwise the
|
|
|
|
#linker will ignore panic_highint_hdl.S as it has no other files depending on any
|
|
|
|
#symbols in it.
|
2017-06-23 00:08:01 -04:00
|
|
|
COMPONENT_ADD_LDFLAGS += $(COMPONENT_PATH)/libhal.a \
|
2016-12-11 23:54:30 -05:00
|
|
|
-L$(COMPONENT_PATH)/lib \
|
|
|
|
$(addprefix -l,$(LIBS)) \
|
|
|
|
-L $(COMPONENT_PATH)/ld \
|
|
|
|
-T esp32_out.ld \
|
2017-04-18 05:14:32 -04:00
|
|
|
-u ld_include_panic_highint_hdl \
|
2016-12-11 23:54:30 -05:00
|
|
|
$(addprefix -T ,$(LINKER_SCRIPTS))
|
2016-08-17 11:08:22 -04:00
|
|
|
|
2016-08-19 02:20:28 -04:00
|
|
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
|
|
|
|
2016-11-15 19:12:48 -05:00
|
|
|
COMPONENT_SUBMODULES += lib
|
2016-08-19 02:20:28 -04:00
|
|
|
|
2016-12-11 23:54:30 -05: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-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
|