greybus: make: check kernel configuration options
authorRui Miguel Silva <rui.silva@linaro.org>
Wed, 13 May 2015 17:59:00 +0000 (18:59 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 14 May 2015 16:42:51 +0000 (09:42 -0700)
Add checks for options that shall be enabled in the kernel config
and for options that shall be disable.

To add options to list append them to CONFIG_OPTIONS_ENABLE or
CONFIG_OPTIONS_DISABLE respectively.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Makefile

index f366da6..130758f 100644 (file)
@@ -44,6 +44,22 @@ KERNELDIR            ?= /lib/modules/$(KERNELVER)/build
 INSTALL_MOD_PATH       ?= /..
 PWD                    := $(shell pwd)
 
+# kernel config option that shall be enable
+CONFIG_OPTIONS_ENABLE := SYSFS SPI USB SND_SOC
+
+# kernel config option that shall be disable
+CONFIG_OPTIONS_DISABLE :=
+
+# this only run in kbuild part of the makefile
+ifneq ($(KERNELRELEASE),)
+$(foreach opt,$(CONFIG_OPTIONS_ENABLE),$(if $(CONFIG_$(opt)),, \
+     $(error CONFIG_$(opt) is disabled in the kernel configuration and must be enable \
+     to continue compilation)))
+$(foreach opt,$(CONFIG_OPTIONS_DISABLE),$(if $(filter m y, $(CONFIG_$(opt))), \
+     $(error CONFIG_$(opt) is enabled in the kernel configuration and must be disable \
+     to continue compilation),))
+endif
+
 # add -Wall to try to catch everything we can.
 ccFlags-y := -Wall