From fc84c90f66f29300ed73b33483b3f24b4a0d8331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 9 Sep 2019 16:51:16 +0200 Subject: [PATCH] Makefile.include: allow directories that cannot be overridden Allow defining new directory variables that will not be overridden when set from command line. Command line is supposed to override from the value in make. Promoting another behavior is against `make`. --- Makefile.include | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.include b/Makefile.include index 4a1ecaec2b..12206d33bb 100644 --- a/Makefile.include +++ b/Makefile.include @@ -59,6 +59,12 @@ __DIRECTORY_VARIABLES := \ DLCACHE_DIR \ # +# In GNU make command line is supposed to override the value set in makefile +# These variables can be overridden even when set from command line +__OVERRIDE_DIRECTORY_VARIABLES := $(__DIRECTORY_VARIABLES) +# Use absolute paths in recursive "make" even if overridden on command line. +MAKEOVERRIDES += $(foreach v,$(__OVERRIDE_DIRECTORY_VARIABLES),$(v)=$($(v))) + # Make all paths absolute. override RIOTBASE := $(abspath $(RIOTBASE)) override RIOTCPU := $(abspath $(RIOTCPU)) @@ -82,9 +88,6 @@ ifneq (, $(filter-out 1, $(foreach v,$(__DIRECTORY_VARIABLES),$(words $($(v))))) $(error Make sure no path override is empty or contains spaces!) endif -# Use absolute paths in recusive "make" even if overriden on command line. -MAKEOVERRIDES += $(foreach v,$(__DIRECTORY_VARIABLES),$(v)=$($(v))) - # Path to the current directory relative to RIOTPROJECT # trailing '/' is important when RIOTPROJECT == CURDIR BUILDRELPATH ?= $(patsubst $(RIOTPROJECT)/%,%,$(CURDIR)/)