]> granicus.if.org Git - esp-idf/commitdiff
build system: Restore ifdef/ifndef in Makefiles, clean up examples build
authorAngus Gratton <angus@espressif.com>
Tue, 5 Sep 2017 05:50:31 +0000 (15:50 +1000)
committerAngus Gratton <gus@projectgus.com>
Tue, 5 Sep 2017 06:11:03 +0000 (16:11 +1000)
12 files changed:
components/app_trace/component.mk
components/aws_iot/component.mk
components/bootloader/subproject/main/component.mk
components/bootloader_support/component.mk
components/bt/component.mk
components/esp32/component.mk
components/freertos/component.mk
components/lwip/component.mk
components/newlib/component.mk
examples/protocols/aws_iot/subscribe_publish/main/component.mk
examples/protocols/aws_iot/thing_shadow/main/component.mk
make/project.mk

index 7a1f39759df31237733077ecd1d4d44337826a4e..235f19831d2fb7fc346c4dae43bd6e2bc49ea20f 100644 (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 += \
index aab25a71f3d89bca090696677151a6dd5cd01611..cd1b15eeead66819a7c7c4f747e8af740f9d74f4 100644 (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
 
index 633051cb6392a980d641b32b8a7a7364f47d81e7..a54fe30a9046d9249fc9d44fcb8ee723e37bf0ec 100644 (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
 
index 8ad21d3b9b704757919daf7933d86152335148b3..6db815afffd32b3d09c660a438027dadb6ca3951 100755 (executable)
@@ -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 $< $@
index 86fddc8c11ba5ef4c5a15d39295c0343ee1d30d8..8f6ce29d518b6a460d5afaff5bbc661362828475 100644 (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               \
index a151f81291c38139d3a575b8e2f72528cbe4c83c..2ed89805223affcdce49fbc24ae4d701aa32c06d 100644 (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
 
index 88be5b8f6ddd9182887ade0b356b64949ab47a10..7841d8f6947befb144182acc122ef9294af4f77d 100644 (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
index 921cc591665a1451cf1726036341f61d07ca7165..f85759bedbe267bfe96a93296279055d084a00a5 100644 (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
index ce5799dfb0e0ea34b6bc7011821f6f19ecba8358..05ef6bee8d7494ff047464a21e784c09ca01cf9b 100644 (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
 
index 1ed56547cb1afc8876669eb205ac743c35bd975a..bc11b6393322172f089b9bb9416089e02c48f743 100644 (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
index 1ed56547cb1afc8876669eb205ac743c35bd975a..bc11b6393322172f089b9bb9416089e02c48f743 100644 (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
index 31635d41d05acfea333a05b118091642473965c8..9846872a28626676418f55aa7d5df05f29f5b121 100644 (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