Commit 01f146c28e3c0d4dd9844c7b454b37aa4d12f45b

Guillem Jover 2013-05-27T04:41:58

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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