summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2016-02-26 23:51:21 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2016-02-26 23:51:21 +0000
commiteb924defd9b6f789d76882461683e8ec2b490c22 (patch)
tree3e4ec3402a43e8b4eb272b4deb1740bf18ae5ae5
parent2941bd0994a749e4b1ce8dd92f1f43d1cb13216b (diff)
downloadflashrom-eb924defd9b6f789d76882461683e8ec2b490c22.tar.gz
makefile: allow to disable all default-yes config variables with CONFIG_NOTHING=yes.
All credit for this should be given to Patrick Georgi (see r1869). Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1944 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 00819c6..1511eef 100644
--- a/Makefile
+++ b/Makefile
@@ -642,6 +642,16 @@ CONFIG_CH341A_SPI ?= yes
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
+# Disable all features if CONFIG_NOTHING=yes is given unless CONFIG_EVERYTHING was also set
+ifeq ($(CONFIG_NOTHING), yes)
+ ifeq ($(CONFIG_EVERYTHING), yes)
+ $(error Setting CONFIG_NOTHING=yes and CONFIG_EVERYTHING=yes does not make sense)
+ endif
+ $(foreach var, $(filter CONFIG_%, $(.VARIABLES)),\
+ $(if $(filter yes, $($(var))),\
+ $(eval $(var)=no)))
+endif
+
# Enable all features if CONFIG_EVERYTHING=yes is given
ifeq ($(CONFIG_EVERYTHING), yes)
$(foreach var, $(filter CONFIG_%, $(.VARIABLES)),\