# HG changeset patch # User Mike Miller # Date 1437703239 14400 # Node ID 107bb934dc199ac24ff1e1469367412f2c044980 # Parent 1625e6bd5ce7354ab70eb85d19d3d1d4927d0df2 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. diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -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