changeset 14357:e52d28567d4e

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. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 16 Feb 2011 14:15:51 -0700
parents 42153542d24a
children d1eef489f6fa
files ChangeLog top/maint.mk
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -126,8 +126,13 @@
 			$(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.