X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=Makefile.am;fp=Makefile.am;h=2a0825d35295e8d1cb6fcb5998fb16b422af1031;hb=37829c15b5ddbe6f01c6b9373cf026fac9e4fcab;hp=cd21a6884afa6731df1485cabe45577c77b15af7;hpb=e5ef649be3167dbb9f6403e2c1d0e2e1b09d3a0c;p=libsigrok.git 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