From 97cd6a594b32ffe8a4f86ab61b45f173a3b2d0a7 Mon Sep 17 00:00:00 2001 From: dongheng Date: Mon, 26 Aug 2019 16:09:26 +0800 Subject: [PATCH] fix(make): fix compiling warning 1. add "-MP" prevents make-level errors when switching IDF versions, as headers may be removed 2. add macro "IS_BOOTLOADER_BUILD" to disable link file generation when compiling bootloader 3. add "<:" to avoid makefile to search it undefined variable --- components/esp8266/Makefile.projbuild | 2 ++ components/esp_common/component.mk | 3 +++ tools/kconfig/Makefile | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esp8266/Makefile.projbuild b/components/esp8266/Makefile.projbuild index 246a3625..5da44ca3 100644 --- a/components/esp8266/Makefile.projbuild +++ b/components/esp8266/Makefile.projbuild @@ -64,12 +64,14 @@ endif # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION endif +ifndef IS_BOOTLOADER_BUILD LINKER_SCRIPT_TEMPLATE := $(COMPONENT_PATH)/ld/esp8266.project.ld.in LINKER_SCRIPT_OUTPUT_DIR := $(abspath $(BUILD_DIR_BASE)/esp8266) # Target to generate linker script generator from fragments presented by each of # the components $(eval $(call ldgen_process_template,$(LINKER_SCRIPT_TEMPLATE),$(LINKER_SCRIPT_OUTPUT_DIR)/esp8266.project.ld)) +endif # global CFLAGS for ESP8266 CFLAGS += -DICACHE_FLASH diff --git a/components/esp_common/component.mk b/components/esp_common/component.mk index 64c67abc..962d9867 100644 --- a/components/esp_common/component.mk +++ b/components/esp_common/component.mk @@ -5,5 +5,8 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_SRCDIRS := src +# just to remove make compiling warning +src/stack_check.o: <:= + # disable stack protection in files which are involved in initialization of that feature src/stack_check.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS)) diff --git a/tools/kconfig/Makefile b/tools/kconfig/Makefile index b91cbc28..9fc367b4 100644 --- a/tools/kconfig/Makefile +++ b/tools/kconfig/Makefile @@ -165,7 +165,7 @@ check-lxdialog := $(SRCDIR)/lxdialog/check-lxdialog.sh # Use recursively expanded variables so we do not call gcc unless # we really need to do so. (Do not call gcc as part of make mrproper) CFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ - -DLOCALE -MMD + -DLOCALE -MMD -MP CFLAGS += -I "." -I "${SRCDIR}"