From 932d0f7b8a69bdcac5d945de600ce6be807aeff7 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 25 Aug 2018 20:07:05 +0200 Subject: Add a Kconfig.env_vars attribute that lists env. variables Kconfig.env_vars is a set() with the names of all environment variables referenced in the configuration. Can be used e.g. for custom incremental build implementations, though sync_deps() already indirectly catches any relevant changes to environment variables. --- tests/Kpreprocess | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/Kpreprocess') diff --git a/tests/Kpreprocess b/tests/Kpreprocess index 73053fe..2ebf6e6 100644 --- a/tests/Kpreprocess +++ b/tests/Kpreprocess @@ -69,7 +69,7 @@ qaz = QAZ echo = $(1) config PRINT_ME - string "$(ENV_VAR)" if ($(echo,FOO) && $(echo,BAR)) || !$(echo,BAZ) || !(($(qaz))) + string "$(ENV_1)" if ($(echo,FOO) && $(echo,BAR)) || !$(echo,BAZ) || !(($(qaz))) default "$(echo,"foo")" if "foo $(echo,"bar") baz" = "$(undefined)" @@ -128,3 +128,14 @@ error-n-res := $(error-if,n,oops) # Causes an error when expanded error-y-res = $(error-if,y,oops) + + +# Environment variables (for testing Kconfig.env_vars). ENV_1 is already +# referenced above. +env_ref_1 := xxx $(ENV_2) xxx +env_ref_2 := $(shell,echo $(ENV_3)) +env_ref_3 := +env_ref_3 += $(ENV_4) +$(warning-if,$(ENV_5),$(ENV_UNDEFINED)) +source "$(ENV_6)" +env_ref_4 = $(ENV_7) # Never evaluated -- cgit v1.2.3