changeset 20419:107bb934dc19

build: Always generate ChangeLog if missing, and write to build directory * Makefile.am (changelog-from-hg-log): Write generated ChangeLog to build directory. If no hg log available, write a dummy ChangeLog if file doesn't already exist.
author Mike Miller <mtmiller@octave.org>
date Thu, 23 Jul 2015 22:00:39 -0400
parents 1625e6bd5ce7
children 956119b6e6d1
files Makefile.am
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Thu Jul 23 21:13:13 2015 -0400
+++ b/Makefile.am	Thu Jul 23 22:00:39 2015 -0400
@@ -197,13 +197,16 @@
 
 define changelog-from-hg-log
   rm -f $@-t && \
-  cd $(srcdir) && \
-  if [ -d .hg ]; then \
-    ( hg log --style=build-aux/changelog.tmpl --prune=b0e60ad4ae26 --only-branch=`hg branch`; \
+  if [ -d $(srcdir)/.hg ]; then \
+    ( cd $(srcdir); \
+      hg log --style=build-aux/changelog.tmpl --prune=b0e60ad4ae26 --only-branch=`hg branch`; \
       echo ""; \
       echo "See the files in the directory etc/OLD-ChangeLogs for changes before 2011-04-19"; \
     ) > $@-t && \
     mv $@-t $@; \
+  elif [ ! -f $@ ] && [ ! -f $(srcdir)/$@ ]; then \
+    echo "Empty ChangeLog generated because no hg log available" > $@-t && \
+    mv $@-t $@; \
   fi
 endef