summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-08-10 20:36:16 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-08-10 20:36:16 -0400
commit91a59251806c3836cbc58b009aae8b016feab5a4 (patch)
tree36e7a212660032cea01dd7427083b2743fca97b0 /Makefile.am
parentee885c76af0c715ffd316d4c7cc1b61db46af1ae (diff)
Create multiple ChangeLog files segmented around major releases
For an imaginary cairo-3.6.4 version, we now will generate the following ChangeLog files: ChangeLog ChangeLog.pre-3.4 ChangeLog.pre-3.2 ChangeLog.pre-3.0 ChangeLog.pre-2.0 ChangeLog.pre-1.0
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am64
1 files changed, 50 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 8ce2bc4c..f65b6d68 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,36 +41,72 @@ check-valgrind: all
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
-# Creating ChangeLog from git log:
-
-MAINTAINERCLEANFILES += ChangeLog
-
-EXTRA_DIST += ChangeLog
-
-ChangeLog: $(srcdir)/ChangeLog
-
-$(srcdir)/ChangeLog:
+# Creating ChangeLog files from git log:
+
+# We always create a ChangeLog that contains the most recent changes, and
+# multiple others for changes between major releases (other than the last such
+# segment that we put in 'ChangeLog'. The old ones are named
+# ChangeLog.pre-X.Y where X.Y is the version number of the major release.
+
+CURR_CHANGELOG_VERSION=$(CAIRO_VERSION_MAJOR).$$(echo "($(CAIRO_VERSION_MINOR)+1)/2*2" | bc)
+# examines $version
+PREV_CHANGELOG_VERSION=$$(if test "x$$(echo "($$version-0.1)*2/2"|bc)" = "x$$(echo "$$version*2/2"|bc)"; \
+ then echo "$$version-$$(echo "$$version" | sed 's/[0-9]/0/g;s/[0-9]$$/2/')"; \
+ else echo "$$version-1.0"; \
+ fi | bc | sed 's/[.]0*/./;s/^0[.]\?$$/initial/;s/[.]$$/.0/')
+
+CHANGELOGS = ChangeLog \
+ `version=$(CURR_CHANGELOG_VERSION); \
+ version=$(PREV_CHANGELOG_VERSION); \
+ while test "x$$version" != xinitial; do \
+ echo ChangeLog.pre-$$version; \
+ version=$(PREV_CHANGELOG_VERSION); \
+ done`
+
+MAINTAINERCLEANFILES += $(srcdir)/ChangeLog $(srcdir)/ChangeLog.pre-*
+DISTCLEANFILES += $(srcdir)/ChangeLog.cache-*
+
+changelogs:
+ @$(MAKE) $(CHANGELOGS)
+
+dist-hook: changelogs
+ changelogs="$(CHANGELOGS)"; \
+ for changelog in $$changelogs; do \
+ cp $(srcdir)/$$changelog $(distdir)/ 2>/dev/null || \
+ cp $$changelog $(distdir)/; \
+ done
+
+ChangeLog%: $(srcdir)/ChangeLog%
+
+$(srcdir)/ChangeLog $(srcdir)/ChangeLog.pre-%:
+ @echo Creating $@
@if test -d "$(srcdir)/.git"; then \
(cd "$(srcdir)" && \
- ./missing --run git-log --stat) | fmt --split-only > $@.tmp \
+ version=$$(echo "$@" | sed 's/.*ChangeLog\([.].*-\)\?//'); \
+ to=$$version; \
+ test "x$$version" = x && version=$(CURR_CHANGELOG_VERSION); \
+ from=$(PREV_CHANGELOG_VERSION); \
+ test "x$$to" = x || version=$$version.0; \
+ test "x$$from" = xinitial || from=$$from.0; \
+ ./missing --run git-log --stat $$from..$$to) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ \
|| ($(RM) $@.tmp; \
- echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
+ echo Failed to generate $@, your $@ may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
- (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
+ (echo A git checkout and git-log is required to generate $@ >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
-.PHONY: ChangeLog $(srcdir)/ChangeLog
+.PHONY: changelogs ChangeLog $(srcdir)/ChangeLog
# Some custom targets to make it easier to release things.
# Use either:
# make release-check
# or make release-publish
-RELEASE_OR_SNAPSHOT = `if [ "$(CAIRO_VERSION_MINOR)" = $$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc) ]; then echo release; else echo snapshot; fi`
+RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ]; then echo release; else echo snapshot; fi)
RELEASE_UPLOAD_HOST = cairographics.org
RELEASE_UPLOAD_BASE = /srv/cairo.freedesktop.org/www
RELEASE_UPLOAD_DIR = $(RELEASE_UPLOAD_BASE)/$(RELEASE_OR_SNAPSHOT)s