]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - Makefile
add check infrastructure, default sparse
[people/ms/u-boot.git] / Makefile
index 09456e090a20e64374fe9d43aea928f200dd113a..7802a0fec8cdaebeda43e43bbb710af359c05215 100644 (file)
--- 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)