]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Delete a dummy ChangeLog in ‘make distclean’.
authorZack Weinberg <zackw@panix.com>
Tue, 18 Aug 2020 19:01:10 +0000 (15:01 -0400)
committerZack Weinberg <zackw@panix.com>
Tue, 18 Aug 2020 19:09:49 +0000 (15:09 -0400)
‘make distcheck’ from git may create a dummy ChangeLog file in the
build directory.  Delete this on ‘make distclean’, but don’t delete
a real ChangeLog (generated by the gen-ChangeLog rule).

* Makefile.am (distclean-local): Delete ChangeLog if it is the dummy
  created to pacify automake.

Makefile.am

index 4369a3acf43e380dac394258539043208d6c4aa3..8c7ce7b617c993a8da5937f8d09b324a1b77a530 100644 (file)
@@ -125,8 +125,14 @@ dist-hook: gen-ChangeLog
 
 # Arrange to remove the symlink to GNUmakefile in VPATH builds.
 # TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed.
+# Delete ChangeLog if it is the dummy created by the rule above.
+# The sed construct below distinguishes between a file whose sole
+# contents are "dummy", and a file whose first line is "dummy" but then
+# has other stuff, without reading the whole thing.
 distclean-local:
        if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
+       if test "x`sed -ne 'l;2q' ChangeLog 2> /dev/null`" = 'xdummy$$'; \
+       then rm -f ChangeLog; fi
 
 include $(srcdir)/bin/local.mk
 include $(srcdir)/doc/local.mk