1 # Creating ChangeLog files from git log:
3 # We always create a ChangeLog that contains the most recent changes, and
4 # multiple others for changes between major releases (other than the last such
5 # segment that we put in 'ChangeLog'. The old ones are named
6 # ChangeLog.pre-X.Y where X.Y is the version number of the major release.
8 CURR_CHANGELOG_VERSION=$(CAIRO_VERSION_MAJOR).$$(echo "($(CAIRO_VERSION_MINOR)+1)/2*2" | bc)
10 PREV_CHANGELOG_VERSION=$$(if test "x$$(echo "($$version-0.1)*2/2"|bc)" = "x$$(echo "$$version*2/2"|bc)"; \
11 then echo "$$version-$$(echo "$$version" | sed 's/[0-9]/0/g;s/[0-9]$$/2/')"; \
12 else echo "$$version-1.0"; \
13 fi | bc | sed 's/[.]0*/./;s/^0[.]\?$$/initial/;s/[.]$$/.0/')
15 CHANGELOGS = ChangeLog \
16 `version=$(CURR_CHANGELOG_VERSION); \
17 version=$(PREV_CHANGELOG_VERSION); \
18 while test "x$$version" != xinitial; do \
19 echo ChangeLog.pre-$$version; \
20 version=$(PREV_CHANGELOG_VERSION); \
23 MAINTAINERCLEANFILES += $(srcdir)/ChangeLog $(srcdir)/ChangeLog.pre-*
24 DISTCLEANFILES += $(srcdir)/ChangeLog.cache-*
27 @$(MAKE) $(AM_MAKEFLAGS) $(CHANGELOGS)
30 changelogs="$(CHANGELOGS)"; \
31 for changelog in $$changelogs; do \
32 cp $(srcdir)/$$changelog $(distdir)/ 2>/dev/null || \
33 cp $$changelog $(distdir)/; \
37 @if test -d "$(srcdir)/.git"; then \
38 version=$(CURR_CHANGELOG_VERSION); \
39 prev=$(PREV_CHANGELOG_VERSION).0; \
40 nearest_tag=`git-describe | sed 's/-.*//'`; \
41 before=$(srcdir)/ChangeLog.cache-$$prev..$$nearest_tag; \
42 after=$(srcdir)/ChangeLog.cache-$$nearest_tag..; \
43 $(MAKE) $(AM_MAKEFLAGS) $$before $$after && \
45 { echo '# Generated by configure. Do not edit.'; echo; \
46 cat $$after; echo; cat $$before; } > $@; \
49 (echo A git checkout is required to generate $@ >&2 && \
50 echo A git checkout is required to generate this file >> $@); \
53 DISTCLEANFILES += ChangeLog.cache-*
55 ChangeLog.cache-*..: .git
57 ChangeLog%: $(srcdir)/ChangeLog%
59 $(srcdir)/ChangeLog.cache-% $(srcdir)/ChangeLog.pre-%:
61 @if test -d "$(srcdir)/.git"; then \
63 version=$$(echo "$@" | sed 's/.*ChangeLog\([.].*-\)\?//'); \
64 if echo "$@" | grep -q '^ChangeLog[.]cache'; then \
68 test "x$$version" = x && version=$(CURR_CHANGELOG_VERSION); \
69 from=$(PREV_CHANGELOG_VERSION); \
70 test "x$$to" = x || to=$$to.0; \
71 test "x$$from" = xinitial || from=$$from.0; \
74 $(srcdir)/build/missing --run git-log --stat "$$spec") > $@.tmp \
77 echo Failed to generate $@, your $@ may be outdated >&2); \
79 echo A git checkout is required to generate $@ >&2; \
82 .PHONY: changelogs ChangeLog $(srcdir)/ChangeLog