[stgt] [PATCH] add sparse support

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Wed Apr 28 00:38:39 CEST 2010


This is stolen from a different project.

`make check` runs Sparse tool.

=
From: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
Subject: [PATCH] add sparse support

$ make check

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 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 at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list