From 93c18bb2b450adf9bb1ae32345994d47c9ce6985 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Fri, 20 Oct 2017 12:14:41 +0800 Subject: [PATCH] build system: Fix undefined variables make/project.mk:315: warning: undefined variable `CC' make/project.mk:316: warning: undefined variable `LD' make/project.mk:317: warning: undefined variable `AR' make/project.mk:62: warning: undefined variable `MAKECMDGOALS' components/partition_table/Makefile.projbuild:24: warning: undefined variable `quote' components/bootloader/Makefile.projbuild:123: warning: undefined variable 'BOOTLOADER_DIGEST_BIN' components/bootloader/Makefile.projbuild:123: warning: undefined variable 'SECURE_BOOTLOADER_KEY' --- components/bootloader/Makefile.projbuild | 2 ++ components/partition_table/Makefile.projbuild | 3 +-- make/project.mk | 17 +++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/components/bootloader/Makefile.projbuild b/components/bootloader/Makefile.projbuild index db7f4f0a24..7876635cc9 100644 --- a/components/bootloader/Makefile.projbuild +++ b/components/bootloader/Makefile.projbuild @@ -121,4 +121,6 @@ endif bootloader-clean: $(SDKCONFIG_MAKEFILE) $(BOOTLOADER_MAKE) app-clean +ifdef CONFIG_SECURE_BOOTLOADER_REFLASHABLE rm -f $(SECURE_BOOTLOADER_KEY) $(BOOTLOADER_DIGEST_BIN) +endif diff --git a/components/partition_table/Makefile.projbuild b/components/partition_table/Makefile.projbuild index ddcd8471bd..a7d4f2ecde 100644 --- a/components/partition_table/Makefile.projbuild +++ b/components/partition_table/Makefile.projbuild @@ -21,8 +21,7 @@ ifndef PARTITION_TABLE_CSV_PATH # Path to partition CSV file is relative to project path for custom # partition CSV files, but relative to component dir otherwise. PARTITION_TABLE_ROOT := $(call dequote,$(if $(CONFIG_PARTITION_TABLE_CUSTOM),$(PROJECT_PATH),$(COMPONENT_PATH))) -quote := " -PARTITION_TABLE_CSV_PATH := $(call dequote,$(abspath $(PARTITION_TABLE_ROOT)/$(subst $(quote),,$(CONFIG_PARTITION_TABLE_FILENAME)))) +PARTITION_TABLE_CSV_PATH := $(call dequote,$(abspath $(PARTITION_TABLE_ROOT)/$(call dequote,$(CONFIG_PARTITION_TABLE_FILENAME)))) endif PARTITION_TABLE_CSV_NAME := $(notdir $(PARTITION_TABLE_CSV_PATH)) diff --git a/make/project.mk b/make/project.mk index 4093b4ebbe..31f72bc5fa 100644 --- a/make/project.mk +++ b/make/project.mk @@ -11,6 +11,8 @@ # .PHONY: build-components menuconfig defconfig all build clean all_binaries check-submodules size size-components size-files list-components + +MAKECMDGOALS ?= all all: all_binaries # see below for recipe of 'all' target # @@ -326,20 +328,19 @@ endif export CFLAGS CPPFLAGS CXXFLAGS +# Set default values that were not previously defined +CC ?= gcc +LD ?= ld +AR ?= ar +OBJCOPY ?= objcopy +SIZE ?= size + # Set host compiler and binutils HOSTCC := $(CC) HOSTLD := $(LD) HOSTAR := $(AR) -ifdef OBJCOPY HOSTOBJCOPY := $(OBJCOPY) -else -HOSTOBJCOPY := objcopy -endif -ifdef SIZE HOSTSIZE := $(SIZE) -else -HOSTSIZE := size -endif export HOSTCC HOSTLD HOSTAR HOSTOBJCOPY SIZE # Set target compiler. Defaults to whatever the user has