From 37829c15b5ddbe6f01c6b9373cf026fac9e4fcab Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Sat, 7 Nov 2015 21:51:40 +0100 Subject: [PATCH] build: Make ChangeLog generation distcheck-safe --- .gitignore | 1 - ChangeLog | 2 ++ Makefile.am | 15 ++++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 ChangeLog diff --git a/.gitignore b/.gitignore index f49f1e6d..2d2fadbb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,6 @@ .deps/ .dirstamp .libs/ -/ChangeLog /Makefile /config.* /doxy/ diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..9fc0f8d4 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,2 @@ +The ChangeLog is auto-generated when releasing. If you +are seeing this, use 'git log' for a detailed list of changes. diff --git a/Makefile.am b/Makefile.am index cd21a688..2a0825d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -703,11 +703,16 @@ all-local: $(BUILD_EXTRA) install-exec-local: $(INSTALL_EXTRA) clean-local: $(CLEAN_EXTRA) -MAINTAINERCLEANFILES = ChangeLog +.PHONY: dist-changelog -.PHONY: ChangeLog -ChangeLog: - git --git-dir '$(top_srcdir)/.git' log >$@ || touch $@ +dist-hook: dist-changelog -dist-hook: ChangeLog +dist-changelog: + $(AM_V_at)if test ! -d '$(top_srcdir)/.git'; then \ + cp -f '$(top_srcdir)/ChangeLog' "$(top_distdir)/ChangeLog"; \ + elif git -C '$(top_srcdir)' log >.ChangeLog.tmp; then \ + mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \ + else \ + rm -f .ChangeLog.tmp; exit 1; \ + fi