Fix generate-changelog rule when building from outside of the source repository
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 9 Dec 2015 06:47:18 +0000 (07:47 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 9 Dec 2015 12:25:17 +0000 (13:25 +0100)
The "make dist" target depends upon a phony target "generate-changelog" which
generates the ChangeLog file.  Unfortunately, this was failing if the current
directory was not the source directory.  Worse, this failure was not detected,
but would erroneously generate an empty ChangeLog.

This change fixes both these problems.

Makefile.am

index c475469d0907852ca286595b54c2613e1c18fa1d..106c08fd0ecd60c194850f735b29365df3194511 100644 (file)
@@ -58,8 +58,8 @@ noinst_HEADERS = $(EXTRA_DIST)
 
 generate-changelog:
        if test -d $(top_srcdir)/.git; then                     \
-         $(top_srcdir)/build-aux/gitlog-to-changelog --since=2008-07-27        \
-           > $(distdir)/cl-t;                                  \
+         $(top_srcdir)/build-aux/gitlog-to-changelog --since=2008-07-27  --srcdir=$(top_srcdir) \
+           > $(distdir)/cl-t || exit 1;                                        \
          rm -f $(distdir)/ChangeLog;                           \
          mv $(distdir)/cl-t $(distdir)/ChangeLog;              \
        fi