Avoid "make distcheck" failure: newly-created man/*.1 files not removed
authorJim Meyering <meyering@redhat.com>
Mon, 28 Jan 2008 14:16:17 +0000 (15:16 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 29 Jan 2008 08:40:31 +0000 (09:40 +0100)
* Makefile.am (EXTRA_DIST): Add .version.
(.version): New rule.
(dist-hook): Don't create $(distdir)/.version here, now that it's
being distributed.
* man/Makefile.am (common_dep): Use ../.version, not ../VERSION.
(../VERSION): Remove rule.
* GNUmakefile (dummy): Create .version, not VERSION.
Add an extra "...:= $(shell..." statement to ensure that
.version exists even when the preceding code is not run.
* .gitignore: Remove both .version and VERSION.

Signed-off-by: Jim Meyering <meyering@redhat.com>
.gitignore
ChangeLog
GNUmakefile
Makefile.am
man/Makefile.am

index f5ba5fd..5983d4c 100644 (file)
@@ -5,13 +5,11 @@
 */.deps
 *~
 .gdb-history
-.version
 ABOUT-NLS
 INSTALL
 Makefile
 Makefile.in
 THANKS-to-translators
-VERSION
 aclocal.m4
 autom4te.cache
 config.cache
index ff9070d..148b7d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2008-01-29  Jim Meyering  <meyering@redhat.com>
 
+       Avoid "make distcheck" failure: newly-created man/*.1 files not removed
+       * Makefile.am (EXTRA_DIST): Add .version.
+       (.version): New rule.
+       (dist-hook): Don't create $(distdir)/.version here, now that it's
+       being distributed.
+       * man/Makefile.am (common_dep): Use ../.version, not ../VERSION.
+       (../VERSION): Remove rule.
+       * GNUmakefile (dummy): Create .version, not VERSION.
+       Add an extra "...:= $(shell..." statement to ensure that
+       .version exists even when the preceding code is not run.
+       * .gitignore: Remove both .version and VERSION.
+
        ls: don't segfault on files in /proc with an old libselinux
        * src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15
        whereby getfilecon returns 0 yet sets the context to NULL.
index 9502203..af73b7e 100644 (file)
@@ -49,11 +49,16 @@ ifeq (0,$(MAKELEVEL))
     ifneq ($(_curr-ver),$(VERSION))
       $(info INFO: running autoreconf for new version string: $(_curr-ver))
       dummy := $(shell rm -rf autom4te.cache; autoreconf)
-      dummy := $(shell echo $(_curr-ver) > VERSION)
+      dummy := $(shell echo $(_curr-ver) > .version)
+      _created_version_file = 1
     endif
   endif
 endif
 
+ifneq ($(_created_version_file),1)
+  dummy := $(shell test -f .version || echo $(VERSION) > .version)
+endif
+
 include $(srcdir)/Makefile.cfg
 include $(srcdir)/Makefile.maint
 
index 56f7b85..9965f39 100644 (file)
@@ -18,6 +18,7 @@
 SUBDIRS = lib src doc man po tests gnulib-tests
 EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
   .prev-version THANKS-to-translators THANKStt.in \
+  .version \
   .vg-suppressions \
   .x-po-check \
   .x-sc_GPL_version \
@@ -65,12 +66,12 @@ check-root:
 rm_subst = \
   s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
 
-# Arrange so that .version appears only in distribution tarballs,
-# never in a checked-out repository.
+.version:
+       echo $(VERSION) > $@-t && mv $@-t $@
+
 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
 # See the rm_subst comment for details.
 dist-hook:
-       echo $(VERSION) > $(distdir)/.version
        perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
 
 distcheck-hook:
index 6cad1a4..a4351d6 100644 (file)
@@ -22,8 +22,8 @@ man_aux = $(dist_man_MANS:.1=.x)
 EXTRA_DIST = $(man_aux) $(NO_INSTALL_PROGS_DEFAULT:%=%.x) help2man
 MAINTAINERCLEANFILES = $(dist_man_MANS)
 
-# Depend on ../VERSION to get version number changes.
-common_dep = ../VERSION
+# Depend on ../.version to get version number changes.
+common_dep = ../.version
 
 # Note that arch depends on uname.c
 arch.1:                $(common_dep)   $(srcdir)/arch.x        ../src/uname.c
@@ -198,6 +198,3 @@ check-programs-vs-x:
            || { echo missing $$p.x 1>&2; status=1; };  \
        done;                                           \
        exit $$status
-
-../VERSION:
-       echo $(VERSION) > $@-t && mv $@-t $@