From dc818135a573fa35a502417322e811f20e488e4c Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sat, 4 Aug 2012 15:34:04 -0700 Subject: [PATCH] Makefile: move the release verification logic into a `make release-only` target --- Makefile | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index da07637813..31a2dde735 100644 --- a/Makefile +++ b/Makefile @@ -213,9 +213,31 @@ dist: doc $(TARBALL) $(PKG) PKGDIR=out/dist-osx +release-only: + @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \ + exit 0 ; \ + else \ + echo "" >&2 ; \ + echo "The git repository is not clean." >&2 ; \ + echo "Please commit changes before building release tarball." >&2 ; \ + echo "" >&2 ; \ + git status --porcelain | egrep -v '^\?\?' >&2 ; \ + echo "" >&2 ; \ + exit 1 ; \ + fi + @if [ $(shell ./node --version) = "$(VERSION)" ]; then \ + exit 0; \ + else \ + echo "" >&2 ; \ + echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \ + echo "Did you remember to update src/node_version.cc?" >&2 ; \ + echo "" >&2 ; \ + exit 1 ; \ + fi + pkg: $(PKG) -$(PKG): +$(PKG): release-only rm -rf $(PKGDIR) rm -rf out/deps out/Release ./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32 @@ -236,27 +258,7 @@ $(PKG): --out $(PKG) SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh -$(TARBALL): node doc - @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \ - exit 0 ; \ - else \ - echo "" >&2 ; \ - echo "The git repository is not clean." >&2 ; \ - echo "Please commit changes before building release tarball." >&2 ; \ - echo "" >&2 ; \ - git status --porcelain | egrep -v '^\?\?' >&2 ; \ - echo "" >&2 ; \ - exit 1 ; \ - fi - @if [ $(shell ./node --version) = "$(VERSION)" ]; then \ - exit 0; \ - else \ - echo "" >&2 ; \ - echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \ - echo "Did you remember to update src/node_version.cc?" >&2 ; \ - echo "" >&2 ; \ - exit 1 ; \ - fi +$(TARBALL): release-only node doc git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf - mkdir -p $(TARNAME)/doc/api cp doc/node.1 $(TARNAME)/doc/node.1 @@ -270,7 +272,7 @@ $(TARBALL): node doc tar: $(TARBALL) -$(BINARYTAR): +$(BINARYTAR): release-only rm -rf $(BINARYNAME) rm -rf out/deps out/Release ./configure --prefix=/ --without-snapshot --dest-cpu=$(DESTCPU) @@ -308,4 +310,4 @@ cpplint: lint: jslint cpplint -.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary +.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary release-only