From 3e1d42b7d980e29595572e550d5ce58c0a34f15f Mon Sep 17 00:00:00 2001 From: Andreas Ericsson Date: Tue, 18 Nov 2008 22:17:40 +0100 Subject: [PATCH] Add a 'sparse' make target Given the confusion on git@vger, we'd better not name this target "check" or (worse) "test", but it's still useful to have. As "sparse", noone should have problems understanding what it does. Signed-off-by: Andreas Ericsson Signed-off-by: Shawn O. Pearce --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 49306beee..bbbf64b0d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ OS = unix BASIC_CFLAGS := -Isrc BASIC_CFLAGS += -fvisibility=hidden -OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) +SRC_C = $(wildcard src/*.c) +OBJS = $(patsubst %.c,%.o,$(SRC_C)) HDRS = $(wildcard src/*.h) PUBLIC_HEADERS = $(wildcard src/git/*.h) HDRS += $(PUBLIC_HEADERS) @@ -39,6 +40,9 @@ apidocs: test: $(TEST_RUN) +sparse: + @for i in $(SRC_C); do sparse $$i $(SPARSE_FLAGS) $(BASIC_CFLAGS) $(CFLAGS); done + install-headers: $(PUBLIC_HEADERS) @mkdir -p /tmp/gitinc/git @for i in $^; do cat .HEADER $$i > /tmp/gitinc/$${i##src/}; done @@ -91,3 +95,4 @@ $(TEST_RUN): tests/%.run: tests/%.exe .PHONY: test $(TEST_RUN) .PHONY: apidocs .PHONY: install-headers +.PHONY: sparse