diff --git a/components/app_trace/component.mk b/components/app_trace/component.mk index 7a1f39759d..235f19831d 100644 --- a/components/app_trace/component.mk +++ b/components/app_trace/component.mk @@ -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 += \ diff --git a/components/aws_iot/component.mk b/components/aws_iot/component.mk index aab25a71f3..cd1b15eeea 100644 --- a/components/aws_iot/component.mk +++ b/components/aws_iot/component.mk @@ -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 diff --git a/components/bootloader/subproject/main/component.mk b/components/bootloader/subproject/main/component.mk index 633051cb63..a54fe30a90 100644 --- a/components/bootloader/subproject/main/component.mk +++ b/components/bootloader/subproject/main/component.mk @@ -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 diff --git a/components/bootloader_support/component.mk b/components/bootloader_support/component.mk index 8ad21d3b9b..6db815afff 100755 --- a/components/bootloader_support/component.mk +++ b/components/bootloader_support/component.mk @@ -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 $< $@ diff --git a/components/bt/component.mk b/components/bt/component.mk index 86fddc8c11..8f6ce29d51 100644 --- a/components/bt/component.mk +++ b/components/bt/component.mk @@ -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 \ diff --git a/components/esp32/component.mk b/components/esp32/component.mk index a151f81291..2ed8980522 100644 --- a/components/esp32/component.mk +++ b/components/esp32/component.mk @@ -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 diff --git a/components/freertos/component.mk b/components/freertos/component.mk index 88be5b8f6d..7841d8f694 100644 --- a/components/freertos/component.mk +++ b/components/freertos/component.mk @@ -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 diff --git a/components/lwip/component.mk b/components/lwip/component.mk index 921cc59166..f85759bedb 100644 --- a/components/lwip/component.mk +++ b/components/lwip/component.mk @@ -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 diff --git a/components/newlib/component.mk b/components/newlib/component.mk index ce5799dfb0..05ef6bee8d 100644 --- a/components/newlib/component.mk +++ b/components/newlib/component.mk @@ -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 diff --git a/examples/protocols/aws_iot/subscribe_publish/main/component.mk b/examples/protocols/aws_iot/subscribe_publish/main/component.mk index 1ed56547cb..bc11b63933 100644 --- a/examples/protocols/aws_iot/subscribe_publish/main/component.mk +++ b/examples/protocols/aws_iot/subscribe_publish/main/component.mk @@ -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 diff --git a/examples/protocols/aws_iot/thing_shadow/main/component.mk b/examples/protocols/aws_iot/thing_shadow/main/component.mk index 1ed56547cb..bc11b63933 100644 --- a/examples/protocols/aws_iot/thing_shadow/main/component.mk +++ b/examples/protocols/aws_iot/thing_shadow/main/component.mk @@ -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 diff --git a/make/project.mk b/make/project.mk index 31635d41d0..9846872a28 100644 --- a/make/project.mk +++ b/make/project.mk @@ -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