summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 70875ce540..b5e842a6d0 100644
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,15 @@ not_cfg = $(subst ro rw,y,$(filter-out $(1:y=ro rw),ro rw))
# The board makefile sets $CHIP and the chip makefile sets $CORE.
# Include those now, since they must be defined for _flag_cfg below.
include $(BDIR)/build.mk
+
+ifneq ($(ENV_VARS),)
+# Let's make sure $(out)/env_config.h changes if value any of the above
+# variables has changed since the prvious make invocation. This in turn will
+# make sure that relevant object files are re-built.
+current_set = $(foreach env_flag, $(ENV_VARS), $(env_flag)=$($(env_flag)))
+$(shell util/env_changed.sh "$(out)/env_config.h" "$(current_set)")
+endif
+
# Baseboard directory
ifneq (,$(BASEBOARD))
BASEDIR:=baseboard/$(BASEBOARD)
@@ -153,7 +162,10 @@ CPPFLAGS_RO+=$(foreach t,$(_tsk_cfg_ro),-D$(t)) \
CPPFLAGS_RW+=$(foreach t,$(_tsk_cfg_rw),-D$(t)) \
$(foreach t,$(_tsk_cfg_ro),-D$(t)_RO)
CPPFLAGS+=$(foreach t,$(_tsk_cfg),-D$(t))
-
+ifneq ($(ENV_VARS),)
+CPPFLAGS += -DINCLUDE_ENV_CONFIG
+CFLAGS += -I$(realpath $(out))
+endif
# Get the CONFIG_ and VARIANT_ options that are defined for this target and make
# them into variables available to this build script
_flag_cfg_ro:=$(shell $(CPP) $(CPPFLAGS) -P -dM -Ichip/$(CHIP) \