[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] maintainer-makefile: make syntax-check a no-op from tarballs
From: |
Eric Blake |
Subject: |
[PATCH] maintainer-makefile: make syntax-check a no-op from tarballs |
Date: |
Wed, 16 Feb 2011 14:20:53 -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 <address@hidden>
---
I mistakenly tried 'make syntax-check' in a tarball that was not
version controlled; it spat out lots of warnings about not finding
any version-controlled files, and worse, it hung in places where
sed ended up being invoked on $(VC_LIST) that evaluated to empty
and was waiting for input on stdin.
This is the least-invasive way I could think of to make the problem
disappear, by side-stepping the issue (make syntax-check is for
developers, who are assumed to be running it from their version
control system; so it's okay if tarball end users get a no-op).
ChangeLog | 8 ++++++++
top/maint.mk | 8 +++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ac57458..237dffc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-16 Eric Blake <address@hidden>
+
+ 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 <address@hidden>
longlong: tune, particularly for common case of c99
diff --git a/top/maint.mk b/top/maint.mk
index 606d42e..4d28f81 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -126,8 +126,14 @@ 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 = \
+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.
--
1.7.4
- [PATCH] maintainer-makefile: make syntax-check a no-op from tarballs,
Eric Blake <=