2016-08-17 15:08:22 +00:00
#
# Component Makefile
#
2016-08-19 06:32:35 +00:00
# This Makefile should, at the very least, just include $(IDF_PATH)/make/component.mk. By default,
2016-08-17 15:08:22 +00: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 06:32:35 +00:00
# please read the esp-idf build system document if you need to do this.
2016-08-17 15:08:22 +00:00
#
2016-08-19 10:45:49 +00:00
- i n c l u d e $( PROJECT_PATH ) / b u i l d / i n c l u d e / c o n f i g / a u t o . c o n f
2016-08-17 15:08:22 +00:00
LIBS := crypto core net80211 phy rtc pp wpa wps
2016-08-19 06:32:35 +00:00
2016-08-19 10:45:49 +00:00
i f e q ( $( CONFIG_MEMMAP_BT ) , y )
ifeq ( $( CONFIG_MEMMAP_TRACEMEM) ,y)
LINKER_SCRIPTS = -T esp32.bt.trace.ld
else
LINKER_SCRIPTS = -T esp32.bt.ld
endif
e l s e
ifeq ( $( CONFIG_MEMMAP_TRACEMEM) ,y)
LINKER_SCRIPTS = -T esp32.trace.ld
else
LINKER_SCRIPTS = -T esp32.ld
endif
e n d i f
LINKER_SCRIPTS += -T esp32.common.ld -T esp32.rom.ld
2016-08-17 15:08:22 +00:00
COMPONENT_ADD_LDFLAGS := -lesp32 \
$( abspath libhal.a) \
-L$( abspath lib) \
$( addprefix -l,$( LIBS) ) \
-L $( abspath ld) \
2016-08-19 10:45:49 +00:00
$( LINKER_SCRIPTS)
2016-08-17 15:08:22 +00:00
2016-08-19 06:32:35 +00:00
i n c l u d e $( IDF_PATH ) / m a k e / c o m p o n e n t . m k
2016-08-19 06:20:28 +00:00
ALL_LIB_FILES := $( patsubst %,$( COMPONENT_PATH) /lib/lib%.a,$( LIBS) )
# The binary libraries are in a git submodule, so this target will
# be invoked if any modules are missing (probably because
# git submodule update --init needs to be run).
$(ALL_LIB_FILES) :
2016-08-19 06:32:35 +00:00
$( Q) [ -d ${ IDF_PATH } /.git ] || ( @echo "ERROR: Missing libraries in esp32 component. esp-idf must be cloned from git to work." ; exit 1 )
2016-08-19 06:20:28 +00:00
$( Q) [ -x $( which git) ] || ( @echo "ERROR: Missing libraries in esp32 component. Need to run 'git submodule update --init' in esp-idf root directory." ; exit 1 )
@echo "Warning: Missing libraries in components/esp32/lib/ submodule. Going to try running 'git submodule update --init' in esp-idf root directory..."
2016-08-19 06:32:35 +00:00
cd ${ IDF_PATH } && git submodule update --init
2016-08-19 06:20:28 +00:00
# adding $(ALL_LIB_FILES) as a build dependency here is a hack to make
# sure they get evaluated. Once TW6630 lands and we have library file
# dependencies available at the project level, we can probably lose
# this.
build : $( ALL_LIB_FILES )