From: Daniel Elstner Date: Sat, 7 Nov 2015 20:51:40 +0000 (+0100) Subject: build: Make ChangeLog generation distcheck-safe X-Git-Tag: libsigrok-0.4.0~124 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=37829c15b5ddbe6f01c6b9373cf026fac9e4fcab;p=libsigrok.git build: Make ChangeLog generation distcheck-safe --- 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: ChangeLog -ChangeLog: - git --git-dir '$(top_srcdir)/.git' log >$@ || touch $@ - -dist-hook: ChangeLog +.PHONY: dist-changelog + +dist-hook: dist-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