Skip to content

Commit 912f998

Browse files
committed
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 <[email protected]>
1 parent 5bcce84 commit 912f998

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,16 @@ check-sha1:: test-sha1$X
13291329
./test-sha1.sh
13301330

13311331
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
13331342

13341343
remove-dashes:
13351344
./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)

0 commit comments

Comments
 (0)