Add --warn-undefined-variables to MAKEFLAGS

Fix warnings where undefined vars are used.

Make Kconfig emit "FOO=" for unset bool options
To ensure make variables are always defined, even if empty.

When writing auto.conf, include symbols disabled by dependency to make sure all make variables are always defined.

Fixes espressif/esp-idf#137

Cherry-picked from https://github.com/espressif/esp-idf/pull/138
This commit is contained in:
Deomid Ryabkov
2016-12-03 22:11:22 +00:00
committed by Angus Gratton
parent 11a87ca811
commit 9903ea1c11
21 changed files with 89 additions and 49 deletions

View File

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

View File

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

View File

@@ -13,6 +13,7 @@ BOOTLOADER_BUILD_DIR=$(abspath $(BUILD_DIR_BASE)/bootloader)
BOOTLOADER_BIN=$(BOOTLOADER_BUILD_DIR)/bootloader.bin
# signing key path is resolved relative to the project directory
CONFIG_SECURE_BOOT_SIGNING_KEY ?=
SECURE_BOOT_SIGNING_KEY=$(abspath $(call dequote,$(CONFIG_SECURE_BOOT_SIGNING_KEY)))
export SECURE_BOOT_SIGNING_KEY # used by bootloader_support component
@@ -107,7 +108,7 @@ $(BOOTLOADER_DIGEST_BIN): $(BOOTLOADER_BIN) $(SECURE_BOOTLOADER_KEY)
@echo "DIGEST $(notdir $@)"
$(Q) $(ESPSECUREPY) digest_secure_bootloader -k $(SECURE_BOOTLOADER_KEY) -o $@ $<
else
else # CONFIG_SECURE_BOOT_ENABLED && !CONFIG_SECURE_BOOTLOADER_REFLASHABLE && !CONFIG_SECURE_BOOTLOADER_ONE_TIME_FLASH
bootloader:
@echo "Invalid bootloader target: bad sdkconfig?"
@exit 1

View File

@@ -12,7 +12,7 @@ LINKER_SCRIPTS := \
$(IDF_PATH)/components/esp32/ld/esp32.peripherals.ld \
esp32.bootloader.rom.ld
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
ifneq ("$(CONFIG_SPI_FLASH_ROM_DRIVER_PATCH)","y")
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
#
ifdef CONFIG_SECURE_BOOT_ENABLED
ifneq ("$(CONFIG_SECURE_BOOT_ENABLED)","")
# this path is created relative to the component build directory
SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
ifneq ("$(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
#
ifdef CONFIG_BT_ENABLED
ifneq ("$(CONFIG_BT_ENABLED)","")
COMPONENT_SRCDIRS := .
@@ -20,7 +20,7 @@ COMPONENT_SUBMODULES += lib
endif
ifdef CONFIG_BLUEDROID_ENABLED
ifeq ("$(CONFIG_BLUEDROID_ENABLED)","y")
COMPONENT_ADD_INCLUDEDIRS += bluedroid/bta/include \
bluedroid/bta/sys/include \

View File

@@ -846,7 +846,7 @@ config ESP32_WIFI_NVS_ENABLED
endmenu # Wi-Fi
menu Phy
menu PHY
config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
bool "Do phy calibration and store calibration data in NVS"

View File

@@ -3,8 +3,9 @@
#
COMPONENT_SRCDIRS := . hwcrypto
ifndef CONFIG_NO_BLOBS
LIBS := core rtc net80211 pp wpa smartconfig coexist wps wpa2 phy
LIBS ?=
ifneq ("$(CONFIG_NO_BLOBS)","y")
LIBS += core rtc net80211 pp wpa smartconfig coexist wps wpa2 phy
endif
#Linker scripts used to link the final application.
@@ -22,7 +23,7 @@ ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
LINKER_SCRIPTS += esp32.rom.nanofmt.ld
endif
ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
ifneq ("$(CONFIG_SPI_FLASH_ROM_DRIVER_PATCH)","y")
LINKER_SCRIPTS += esp32.rom.spiflash.ld
endif

View File

@@ -6,6 +6,8 @@ ESPFLASHMODE ?= $(CONFIG_ESPTOOLPY_FLASHMODE)
ESPFLASHFREQ ?= $(CONFIG_ESPTOOLPY_FLASHFREQ)
ESPFLASHSIZE ?= $(CONFIG_ESPTOOLPY_FLASHSIZE)
CONFIG_ESPTOOLPY_COMPRESSED ?=
PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
# two commands that can be used from other components

View File

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

View File

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

View File

@@ -1,5 +1,4 @@
ifeq ("$(CONFIG_SPIRAM_CACHE_WORKAROUND)","y")
LIBC_PATH := $(COMPONENT_PATH)/lib/libc-psram-workaround.a
LIBM_PATH := $(COMPONENT_PATH)/lib/libm-psram-workaround.a
@@ -14,7 +13,7 @@ endif
LIBM_PATH := $(COMPONENT_PATH)/lib/libm.a
endif
endif # CONFIG_SPIRAM_CACHE_WORKAROUND
COMPONENT_ADD_LDFLAGS := $(LIBC_PATH) $(LIBM_PATH) -lnewlib