Makefile: Use cgcc rather than sparse in the check target
cgcc is the recommended way to run sparse, since it provides many -Defines suitable for the given gcc platform. Using an "cgcc -no-compile" command runs sparse, with all the platform specific definitions provided by cgcc, without also invoking gcc. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Apr 7, 2011 at 19:22 UTC
f228d1f006241e4085a432799356ebd7b1e86108
1 file changed
+6
-5
Makefile
+6
-5
@@ -323,9 +323,7 @@ GCOV = gcov
323
324
export TCL_PATH TCLTK_PATH
325
326
-# sparse is architecture-neutral, which means that we need to tell it
327
-# explicitly what architecture to check for. Fix this up for yours..
328
-SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
326
+SPARSE_FLAGS =
327
328
329
@@ -924,6 +922,7 @@ ifeq ($(uname_O),Cygwin)
922
X = .exe
923
COMPAT_OBJS += compat/cygwin.o
924
UNRELIABLE_FSTAT = UnfortunatelyYes
925
+ SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
926
endif
927
ifeq ($(uname_S),FreeBSD)
928
NEEDS_LIBICONV = YesPlease
@@ -1177,6 +1176,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
1176
EXTLIBS += -lws2_32
1177
PTHREAD_LIBS =
1178
X = .exe
1179
+ SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
1180
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
1181
htmldir=doc/git/html/
1182
prefix =
@@ -2161,11 +2161,12 @@ check-sha1:: test-sha1$X
2161
./test-sha1.sh
2162
2163
check: common-cmds.h
2164
- if sparse; \
2164
+ @if sparse; \
2165
then \
2166
for i in $(patsubst %.o, %.c, $(GIT_OBJS)); \
2167
do \
2168
- sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
2168
+ echo ' ' SP $$i; \
2169
+ cgcc -no-compile $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
2170
done; \
2171
else \
2172
echo 2>&1 "Did you mean 'make test'?"; \