Makefile: help people who run 'make check' by mistake
The target to run self test is 'make test', but there are people who try 'make check' and worse yet do not have sparse installed. Suggest 'make test' target when they do not have 'sparse'. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Nov 11, 2008 at 13:12 UTC
912f9980d233961c48a225cce2657f165c98c8ae
1 file changed
+10
-1
Makefile
+10
-1
@@ -1329,7 +1329,16 @@ check-sha1:: test-sha1$X
1329
./test-sha1.sh
1330
1331
check: common-cmds.h
1332
- for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done
1332
+ if sparse; \
1333
+ then \
1334
+ for i in *.c; \
1335
+ do \
1336
+ sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
1337
+ done; \
1338
+ else \
1339
+ echo 2>&1 "Did you mean 'make test'?"; \
1340
+ exit 1; \
1341
+ fi
1342
1343
remove-dashes:
1344
./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)