1
0
Fork 0
mirror of https://github.com/zephyrproject-rtos/esp-idf.git synced 2024-07-13 12:16:12 +02:00

build system: Restore ifdef/ifndef in Makefiles, clean up examples build

This commit is contained in:
Angus Gratton 2017-09-05 15:50:31 +10:00 committed by Angus Gratton
parent 9903ea1c11
commit 8670844acf
12 changed files with 24 additions and 27 deletions

View file

@ -8,7 +8,7 @@ COMPONENT_ADD_INCLUDEDIRS := include
COMPONENT_ADD_LDFLAGS := -lapp_trace
ifeq ("$(CONFIG_SYSVIEW_ENABLE)","y")
ifdef CONFIG_SYSVIEW_ENABLE
#COMPONENT_EXTRA_INCLUDES := freertos
COMPONENT_ADD_INCLUDEDIRS += \

View file

@ -2,7 +2,7 @@
# Component Makefile
#
ifeq ("$(CONFIG_AWS_IOT_SDK)","y")
ifdef CONFIG_AWS_IOT_SDK
COMPONENT_ADD_INCLUDEDIRS := include aws-iot-device-sdk-embedded-C/include

View file

@ -12,7 +12,7 @@ LINKER_SCRIPTS := \
$(IDF_PATH)/components/esp32/ld/esp32.peripherals.ld \
esp32.bootloader.rom.ld
ifneq ("$(CONFIG_SPI_FLASH_ROM_DRIVER_PATCH)","y")
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
LINKER_SCRIPTS += $(IDF_PATH)/components/esp32/ld/esp32.rom.spiflash.ld
endif

View file

@ -12,12 +12,12 @@ COMPONENT_SRCDIRS := src
#
# Secure boot signing key support
#
ifneq ("$(CONFIG_SECURE_BOOT_ENABLED)","")
ifdef CONFIG_SECURE_BOOT_ENABLED
# this path is created relative to the component build directory
SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
ifneq ("$(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)","")
ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
# verification key derived from signing key.
$(SECURE_BOOT_VERIFICATION_KEY): $(SECURE_BOOT_SIGNING_KEY) $(SDKCONFIG_MAKEFILE)
$(ESPSECUREPY) extract_public_key --keyfile $< $@

View file

@ -1,7 +1,7 @@
#
# Component Makefile
#
ifneq ("$(CONFIG_BT_ENABLED)","")
ifdef CONFIG_BT_ENABLED
COMPONENT_SRCDIRS := .
@ -20,7 +20,7 @@ COMPONENT_SUBMODULES += lib
endif
ifeq ("$(CONFIG_BLUEDROID_ENABLED)","y")
ifdef CONFIG_BLUEDROID_ENABLED
COMPONENT_ADD_INCLUDEDIRS += bluedroid/bta/include \
bluedroid/bta/sys/include \

View file

@ -4,7 +4,7 @@
COMPONENT_SRCDIRS := . hwcrypto
LIBS ?=
ifneq ("$(CONFIG_NO_BLOBS)","y")
ifndef CONFIG_NO_BLOBS
LIBS += core rtc net80211 pp wpa smartconfig coexist wps wpa2 phy
endif
@ -19,11 +19,11 @@ ifndef CONFIG_SPIRAM_CACHE_WORKAROUND
LINKER_SCRIPTS += esp32.rom.spiram_incompatible_fns.ld
endif
ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
ifdef CONFIG_NEWLIB_NANO_FORMAT
LINKER_SCRIPTS += esp32.rom.nanofmt.ld
endif
ifneq ("$(CONFIG_SPI_FLASH_ROM_DRIVER_PATCH)","y")
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
LINKER_SCRIPTS += esp32.rom.spiflash.ld
endif

View file

@ -5,7 +5,3 @@
COMPONENT_ADD_LDFLAGS += -Wl,--undefined=uxTopUsedPriority
COMPONENT_ADD_INCLUDEDIRS := include
COMPONENT_PRIV_INCLUDEDIRS := include/freertos
#ifeq ("$(CONFIG_SYSVIEW_ENABLE)","y")
#COMPONENT_ADD_INCLUDEDIRS += app_trace
#endif

View file

@ -8,8 +8,8 @@ COMPONENT_ADD_INCLUDEDIRS := \
include/lwip/posix \
apps/ping
ifeq ("$(CONFIG_PPP_SUPPORT)","y")
LWIP_PPP_DIRS := netif/ppp/polarssl netif/ppp
ifdef CONFIG_PPP_SUPPORT
LWIP_PPP_DIRS := netif/ppp/polarssl netif/ppp
else
LWIP_PPP_DIRS :=
endif

View file

@ -1,15 +1,15 @@
ifeq ("$(CONFIG_SPIRAM_CACHE_WORKAROUND)","y")
ifdef CONFIG_SPIRAM_CACHE_WORKAROUND
LIBC_PATH := $(COMPONENT_PATH)/lib/libc-psram-workaround.a
LIBM_PATH := $(COMPONENT_PATH)/lib/libm-psram-workaround.a
else
ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
ifdef CONFIG_NEWLIB_NANO_FORMAT
LIBC_PATH := $(COMPONENT_PATH)/lib/libc_nano.a
else
LIBC_PATH := $(COMPONENT_PATH)/lib/libc.a
endif
endif # CONFIG_NEWLIB_NANO_FORMAT
LIBM_PATH := $(COMPONENT_PATH)/lib/libm.a

View file

@ -2,7 +2,7 @@
# Main Makefile. This is basically the same as a component makefile.
#
ifeq ("$(CONFIG_EXAMPLE_EMBEDDED_CERTS)","y")
ifdef CONFIG_EXAMPLE_EMBEDDED_CERTS
# Certificate files. certificate.pem.crt & private.pem.key must be downloaded
# from AWS, see README for details.
COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key

View file

@ -2,7 +2,7 @@
# Main Makefile. This is basically the same as a component makefile.
#
ifeq ("$(CONFIG_EXAMPLE_EMBEDDED_CERTS)","y")
ifdef CONFIG_EXAMPLE_EMBEDDED_CERTS
# Certificate files. certificate.pem.crt & private.pem.key must be downloaded
# from AWS, see README for details.
COMPONENT_EMBED_TXTFILES := certs/aws-root-ca.pem certs/certificate.pem.crt certs/private.pem.key

View file

@ -151,11 +151,11 @@ COMPONENT_PATHS := $(foreach comp,$(COMPONENTS),$(firstword $(foreach cd,$(COMPO
ifdef TESTS_ALL
ifeq ($(TESTS_ALL),1)
TEST_COMPONENTS_LIST := $(COMPONENTS)
else
else # TESTS_ALL not empty and not 1
# otherwise, use TEST_COMPONENTS
TEST_COMPONENTS_LIST := $(TEST_COMPONENTS)
endif
else
else # TESTS_ALL unset
TEST_COMPONENTS_LIST :=
endif
TEST_COMPONENT_PATHS := $(foreach comp,$(TEST_COMPONENTS_LIST),$(firstword $(foreach dir,$(COMPONENT_DIRS),$(wildcard $(dir)/$(comp)/test))))
@ -171,6 +171,7 @@ TEST_COMPONENT_NAMES := $(foreach comp,$(TEST_COMPONENT_PATHS),$(lastword $(subs
COMPONENT_INCLUDES :=
COMPONENT_LDFLAGS :=
COMPONENT_SUBMODULES :=
COMPONENT_LIBRARIES :=
# COMPONENT_PROJECT_VARS is the list of component_project_vars.mk generated makefiles
# for each component.
@ -194,9 +195,9 @@ export COMPONENT_INCLUDES
include $(IDF_PATH)/make/common.mk
all:
ifneq ("$(CONFIG_SECURE_BOOT_ENABLED)","")
ifdef CONFIG_SECURE_BOOT_ENABLED
@echo "(Secure boot enabled, so bootloader not flashed automatically. See 'make bootloader' output)"
ifeq ("$(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)","")
ifndef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
@echo "App built but not signed. Sign app & partition data before flashing, via espsecure.py:"
@echo "espsecure.py sign_data --keyfile KEYFILE $(APP_BIN)"
@echo "espsecure.py sign_data --keyfile KEYFILE $(PARTITION_TABLE_BIN)"
@ -255,13 +256,13 @@ COMMON_FLAGS = \
-nostdlib
# Optimization flags are set based on menuconfig choice
ifneq ("$(CONFIG_OPTIMIZATION_LEVEL_RELEASE)","")
ifdef CONFIG_OPTIMIZATION_LEVEL_RELEASE
OPTIMIZATION_FLAGS = -Os
else
OPTIMIZATION_FLAGS = -Og
endif
ifeq ("$(CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED)", "y")
ifdef CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED
CPPFLAGS += -DNDEBUG
endif