maintainer-makefile: make syntax-check a no-op from tarballs
authorEric Blake <eblake@redhat.com>
Wed, 16 Feb 2011 21:15:51 +0000 (14:15 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 16 Feb 2011 21:26:04 +0000 (14:26 -0700)
* top/maint.mk (no-vc-detected): New rule.
(local-checks-available): Use it to avoid hanging if someone tries
'make syntax-check' from a tarball.  Also append to any non-syntax
checks already defined in cfg.mk.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
top/maint.mk

index ac57458f183b4cdfd064c202e99a4bd0503acdf2..237dffc4c48e5db338f0df9b1b28cec5bdb48952 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-16  Eric Blake  <eblake@redhat.com>
+
+       maintainer-makefile: make syntax-check a no-op from tarballs
+       * top/maint.mk (no-vc-detected): New rule.
+       (local-checks-available): Use it to avoid hanging if someone tries
+       'make syntax-check' from a tarball.  Also append to any non-syntax
+       checks already defined in cfg.mk.
+
 2011-02-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        longlong: tune, particularly for common case of c99
index 606d42ed18d503a18d6d228fbbf9a73974a6d82f..ff2fbbb382d755d58c1dcd5d8bd58d656aad9dcf 100644 (file)
@@ -126,8 +126,13 @@ syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
                        $(srcdir)/$(ME) $(_cfg_mk)))
 .PHONY: $(syntax-check-rules)
 
-local-checks-available = \
-  $(syntax-check-rules)
+ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
+local-checks-available += $(syntax-check-rules)
+else
+local-checks-available += no-vc-detected
+no-vc-detected:
+       @echo "No version control files detected; skipping syntax check"
+endif
 .PHONY: $(local-checks-available)
 
 # Arrange to print the name of each syntax-checking rule just before running it.