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.
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