summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-03-30 18:01:08 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2011-03-30 18:06:31 +0100
commit9d6988fcd59c49f8925b671bf1d66f066c683be9 (patch)
treeb53ecd54b69ceb220a49dec694ad9415acd9c33e /Makefile
parent25d0bd3b5739d7cea6c41080bddf2a25d56793db (diff)
Makefile: clarify check and dist rules
Currently large swathes of 'check' and 'dist' are a series of shell commands chained together into one command for make's purposes, with set -e to make the first error fatal. This makes it hard to see what's wrong when they fail. For instance, the case I hit today was that I'd forgotten to sign the tarball; I had no way of knowing that it was the `test -f telepathy-spec-$$version.tar.gz.asc` command that had failed. In some realities the right solution would be to import maintainer-make-release from tp-glib, but I don't really fancy disentangling the Automakey bits from that right now. So this patch basically just breaks the über-commands into individual commands. (This syntax: FOO := bar is a GNU Make-ism which means “evaluate bar once, and then assign its result to FOO”. If we instead used: VERSION = `sed ...` then the sed invocation would be evaluated once for each use of $(VERSION). Since we already depend on GNU Make for things like $(filter-out) I see no reason not to use the eminently-sensible := syntax.)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 24 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index 162ac530..8c9398fa 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,9 @@ DOC_RSYNC_FLAGS=-rvzPp --chmod=Dg+s,ug+rwX,o=rX --delete
XMLS = $(wildcard spec/*.xml)
TEMPLATES = $(wildcard doc/templates/*)
+VERSION := $(shell sed -ne s'!<tp:version>\(.*\)</tp:version>!\1!p' spec/all.xml)
+DISTNAME := telepathy-spec-$(VERSION)
+
GENERATED_FILES = \
doc/spec/index.html \
FIXME.out \
@@ -31,10 +34,10 @@ CHECK_FOR_UNRELEASED = NEWS $(filter-out spec/template.xml,$(XMLS))
check: all FIXME.out
$(PYTHON) test/test-specparser.py
- @version="`sed -ne s'!<tp:version>\(.*\)</tp:version>!\1!p' spec/all.xml`";\
- case "$$version" in \
+ @case "$(VERSION)" in \
*.*.*.*) ;; \
*) \
+ echo "Grepping spec for UNRELEASED..."; \
if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \
then \
echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \
@@ -62,36 +65,30 @@ maintainer-upload-snapshot: doc/spec/index.html
maintainer-upload-release: doc/spec/index.html check
@install -d tmp
- set -e ; \
- version="`sed -ne s'!<tp:version>\(.*\)</tp:version>!\1!p' spec/all.xml`";\
- if ! echo $$version | egrep '[0-9]+\.[0-9]+\.[0-9]+'; then \
- echo 'This does not look like a spec release'; \
+ @if ! echo $(VERSION) | egrep '[0-9]+\.[0-9]+\.[0-9]+'; then \
+ echo $(VERSION) 'does not look like a spec release'; \
exit 1; \
- fi; \
- test -f telepathy-spec-$$version.tar.gz; \
- test -f telepathy-spec-$$version.tar.gz.asc; \
- gpg --verify telepathy-spec-$$version.tar.gz.asc; \
- rsync -vzP telepathy-spec-$$version.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/telepathy-spec/ ; \
- rsync -vzP telepathy-spec-$$version.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/telepathy-spec/ ; \
- rsync $(DOC_RSYNC_FLAGS) doc/spec/ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/spec/ ; \
+ fi
+ test -f telepathy-spec-$(VERSION).tar.gz
+ test -f telepathy-spec-$(VERSION).tar.gz.asc
+ gpg --verify telepathy-spec-$(VERSION).tar.gz.asc
+ rsync -vzP telepathy-spec-$(VERSION).tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/telepathy-spec/
+ rsync -vzP telepathy-spec-$(VERSION).tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/telepathy-spec/
+ rsync $(DOC_RSYNC_FLAGS) doc/spec/ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/spec/
rsync $(DOC_RSYNC_FLAGS) doc/spec/ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/spec-snapshot/
dist: check
@install -d tmp
- set -e ;\
- version="`sed -ne s'!<tp:version>\(.*\)</tp:version>!\1!p' spec/all.xml`";\
- distname="telepathy-spec-$$version";\
- rm -f tmp/ChangeLog "$$distname".tar "$$distname".tar.gz; \
- $(GIT) archive --format=tar --prefix="$$distname"/ "HEAD^{tree}" \
- > "$$distname".tar;\
- rm -rf tmp/"$$distname";\
- mkdir tmp/"$$distname";\
- $(GIT) log telepathy-spec-0.16.0.. > tmp/"$$distname"/ChangeLog; \
- $(TAR) -rf "$$distname".tar -C tmp --owner 0 --group 0 --mode 0664 \
- "$$distname"/ChangeLog;\
- $(GZIP) -9 "$$distname".tar;\
- $(TAR) -ztvf "$$distname".tar.gz;\
- rm -rf tmp/"$$distname"
+ rm -f tmp/ChangeLog "$(DISTNAME)".tar "$(DISTNAME)".tar.gz
+ $(GIT) archive --format=tar --prefix="$(DISTNAME)"/ "HEAD^{tree}" \
+ > "$(DISTNAME)".tar
+ rm -rf tmp/"$(DISTNAME)"
+ mkdir tmp/"$(DISTNAME)"
+ $(GIT) log telepathy-spec-0.16.0.. > tmp/"$(DISTNAME)"/ChangeLog
+ $(TAR) -rf "$(DISTNAME)".tar -C tmp --owner 0 --group 0 --mode 0664 \
+ "$(DISTNAME)"/ChangeLog
+ $(GZIP) -9 "$(DISTNAME)".tar
+ rm -rf tmp/"$(DISTNAME)"
BRANCH = $(shell sh tools/git-which-branch.sh misc | tr -d '\n' | tr -C "[:alnum:]" _)
UPLOAD_BRANCH_TO = people.freedesktop.org:public_html/telepathy-spec