summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 09456e090a..7802a0fec8 100644
--- a/Makefile
+++ b/Makefile
@@ -92,6 +92,24 @@ BUILD_DIR := $(O)
endif
endif
+# Call a source code checker (by default, "sparse") as part of the
+# C compilation.
+#
+# Use 'make C=1' to enable checking of re-compiled files.
+#
+# See the linux kernel file "Documentation/sparse.txt" for more details,
+# including where to get the "sparse" utility.
+
+ifdef C
+ifeq ("$(origin C)", "command line")
+CHECKSRC := $(C)
+endif
+endif
+ifndef CHECKSRC
+ CHECKSRC = 0
+endif
+export CHECKSRC
+
ifneq ($(BUILD_DIR),)
saved-output := $(BUILD_DIR)
OpenPOWER on IntegriCloud