bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"make dist" fails if I delete the dummy ChangeLog


From: Stefano Lattarini
Subject: "make dist" fails if I delete the dummy ChangeLog
Date: Mon, 10 Oct 2011 19:10:02 +0200
User-agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; )

On my Debian GNU/Linux system:

  $ cd ~/src/grep
  $ rm -f ChangeLog
  $ make dist
  make: *** No rule to make target `ChangeLog', needed by `distdir'.  Stop.
  $ make 
    GEN    gen-ChangeLog
  /bin/sh: line 2: grep-2.9.63-88b2-dirty/cl-t: No such file or directory
  mv: cannot stat `grep-2.9.63-88b2-dirty/cl-t': No such file or directory
  make: *** [gen-ChangeLog] Error 1

This could all be solved by re-creating the dummy `ChangeLog' file (a simple
"touch ChangeLog" is enough), but I dislike the idea that we have to create
an empty, dummy file in order to allow the real file to be created at "make
dist" time (and only then).  The attached patch tries to improve the
situation.  Of course, I understand that you might prefer the current setup
over the one my patch implements, so feel free to just reject the patch; I'm
sending it over anyway, in the hope you might share my preferences on this
matter.

Regards,
  Stefano



  
From a633a041a75ffc3398c8dcc73e5b67db65a7f1f6 Mon Sep 17 00:00:00 2001
Message-Id: <address@hidden>
From: Stefano Lattarini <address@hidden>
Date: Mon, 10 Oct 2011 17:03:09 +0200
Subject: [PATCH] dist: better automatic generation of ChangeLog

* Makefile.am (gen-ChangeLog): Removed, superseded by ...
(ChangeLog): ... this new .PHONY target, that takes care of
creating the ChangeLog in the builddir rather than in the
distdir.
(dist-hook): Don't depend on `gen-ChangeLog' anymore.
* bootstrap.conf: Don't generate a dummy ChangeLog file
anymore, it's no more needed.
---
 Makefile.am    |   29 ++++++++++++++++++++---------
 bootstrap.conf |    3 ---
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a13f262..24624f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,15 +35,26 @@ run-syntax-check:
 
 # Arrange so that .tarball-version appears only in the distribution
 # tarball, and never in a checked-out repository.
-dist-hook: gen-ChangeLog run-syntax-check
+dist-hook: run-syntax-check
        $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
 
 gen_start_date = 2009-11-27
-.PHONY: gen-ChangeLog
-gen-ChangeLog:
-       $(AM_V_GEN)if test -d .git; then                                \
-         $(top_srcdir)/build-aux/gitlog-to-changelog                   \
-           --since=$(gen_start_date) > $(distdir)/cl-t;                \
-         rm -f $(distdir)/ChangeLog;                                   \
-         mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
-       fi
+.PHONY: ChangeLog
+ChangeLog:
+       $(AM_V_GEN)rm -f address@hidden || exit 1; \
+       if test -d $(srcdir)/.git; then \
+         $(top_srcdir)/build-aux/gitlog-to-changelog \
+           --since=$(gen_start_date) > address@hidden; \
+## We want to support "make dist" also from distribution tarballs.  In
+## case of a VPATH build, prefer any ChangeLog in the build dir to the
+## one in the source dir (in the spirit of VPATH).
+       elif test -f $@; then \
+         cp -f $@ address@hidden; \
+       elif test -f $(srcdir)/'$@'; then \
+         cp -f $(srcdir)/'$@' address@hidden; \
+       else \
+         echo "Source tree is not a git checkout, and no" \
+              "pre-existent ChangeLog file has been found" >&2; \
+         exit 1; \
+       fi; \
+       chmod a-w address@hidden && mv -f address@hidden $@
diff --git a/bootstrap.conf b/bootstrap.conf
index c3b7158..9bfd16c 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -98,9 +98,6 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
  --flag=error:3:c-format --flag=error_at_line:5:c-format\\\
 '
 
-# Automake requires that ChangeLog exist.
-test -f ChangeLog || touch ChangeLog || exit 1
-
 gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests"
 
 # Build prerequisites
-- 
1.7.2.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]