[PATCH] add sparse support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is stolen from a different project.

`make check` runs Sparse tool.

=
From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Subject: [PATCH] add sparse support

$ make check

Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 Makefile |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 61d46a5..3af12ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
 VERSION ?= 1.0.3
 
+CHECK_CC = cgcc
+CHECK_CC_FLAGS = '$(CHECK_CC) -Wbitwise -Wno-return-void -no-compile $(ARCH)'
+
 # Define a common prefix where binaries and docs install
 PREFIX ?= /usr
 
@@ -62,3 +65,18 @@ install: install-programs install-doc install-conf install-scripts
 
 .PHONY: clean
 clean: clean-programs clean-doc clean-conf clean-scripts
+
+.PHONY:check
+check: ARCH=$(shell sh script/checkarch.sh)
+check:
+	CC=$(CHECK_CC_FLAGS) $(MAKE) all
+
+.PHONY:check32
+check32: override ARCH=-m32
+check32:
+	CC=$(CHECK_CC_FLAGS) $(MAKE) all
+
+.PHONY:check64
+check64: override ARCH=-m64
+check64:
+	CC=$(CHECK_CC_FLAGS) $(MAKE) all
-- 
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux