summaryrefslogtreecommitdiff
path: root/Cmds
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-08-15 10:23:32 +0200
committerTobias Klauser <tklauser@distanz.ch>2014-08-15 10:26:49 +0200
commitea471349bfe6f6a95877947db18f72c4cf693630 (patch)
treef9ebbb17b997bbcb57a4509da56ba7feff23565b /Cmds
parent62bdf888459a6d2ae50d2d2d00447307e0190a97 (diff)
build: Add build flag to enable sparse checking of C source files
Similar to the 'make C=1' for the Linux kernel, wire up the sparse command for our build system in a similar fashion. Use 'make C=1 [tool]' to check the source files using sparse. Of course, the sparse tool needs to be installed and available in your $PATH for this to work. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'Cmds')
-rw-r--r--Cmds7
1 files changed, 7 insertions, 0 deletions
diff --git a/Cmds b/Cmds
index 9d2675f..247a972 100644
--- a/Cmds
+++ b/Cmds
@@ -14,6 +14,13 @@ else
STRIP = $(Q)echo -e " STRIP\t$@" && $(CROSS_COMPILE)strip
endif
+# sparse related
+ifeq ($(C), 1)
+ CHECK = $(Q)echo -e " CHECK\t$<" && sparse
+else
+ CHECK = $(Q)true
+endif
+
# Flex/bison related
LEX = $(Q)echo -e " LEX\t$<" && flex
YAAC = $(Q)echo -e " YAAC\t$<" && bison