maint.mk: avoid warnings about missing files
authorJim Meyering <meyering@redhat.com>
Sat, 25 Jul 2009 13:43:11 +0000 (15:43 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 25 Jul 2009 19:37:19 +0000 (21:37 +0200)
* top/maint.mk (PREV_VERSION): Suppress stderr, to hide a
diagnostic when .prev-version does not exist.
(_cfg_mk): Define, so it can be empty when cfg.mk does not exist.
(syntax-check-rules): Use $(_cfg_mk) to avoid a diagnostic about
nonexistent cfg.mk.
Suggestions from Simon Josefsson.

ChangeLog
top/maint.mk

index bab6c18..5369ce3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-25  Jim Meyering  <meyering@redhat.com>
+
+       maint.mk: avoid warnings about missing files
+       * top/maint.mk (PREV_VERSION): Suppress stderr, to hide a
+       diagnostic when .prev-version does not exist.
+       (_cfg_mk): Define, so it can be empty when cfg.mk does not exist.
+       (syntax-check-rules): Use $(_cfg_mk) to avoid a diagnostic about
+       nonexistent cfg.mk.
+       Suggestions from Simon Josefsson.
+
 2009-07-25  Bruno Haible  <bruno@clisp.org>
 
        * lib/math.in.h (cosl, logl, sinl): Don't declare if they are already
index c49fea3..228b414 100644 (file)
@@ -44,7 +44,7 @@ ifeq ($(origin prev_version_file), undefined)
   prev_version_file = $(srcdir)/.prev-version
 endif
 
-PREV_VERSION := $(shell cat $(prev_version_file))
+PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null)
 VERSION_REGEXP = $(subst .,\.,$(VERSION))
 PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
 
@@ -70,9 +70,11 @@ export LC_ALL = C
 ## Sanity checks.  ##
 ## --------------- ##
 
+_cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk')
+
 # Collect the names of rules starting with `sc_'.
 syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
-                       $(srcdir)/$(ME) $(srcdir)/cfg.mk)
+                       $(srcdir)/$(ME) $(_cfg_mk))
 .PHONY: $(syntax-check-rules)
 
 local-checks-available = \