build: Handle the ChangeLog as a distributed-only file The ChangeLog file is distributed, and cannot be regenerated outside of the git repository, so do not remove it in DISTCLEANFILES, and move the generation code into dist-hook, which also avoids unnecessary computation during normal builds.
diff --git a/Makefile.am b/Makefile.am
index ae7cd20..8e50b1d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,11 +9,8 @@ EXTRA_DIST = \
get-version \
$(nil)
-DISTCLEANFILES = ChangeLog
-.PHONY: ChangeLog
-
-ChangeLog:
- git log --stat -C >$@
-
dist-hook:
echo $(VERSION) >$(distdir)/.dist-version
+ if [ -d .git ]; then \
+ git log --stat -C >$(distdir)/ChangeLog; \
+ fi