[flashrom] [PATCH] makefile: allow to disable all default-yes config variables with CONFIG_NOTHING=yes.

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Fri Feb 26 22:54:53 CET 2016


All credit for this should be given to Patrick Georgi (see r1869).

Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
 Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

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)),\
-- 
Kind regards, Stefan Tauner





More information about the flashrom mailing list