This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Makefile: add a better check to ensure a node "release"

Closes #3841.
Closes #3842.
  • Loading branch information...
TooTallNate committed Aug 9, 2012
1 parent c82e288 commit 64ac54a64d68c1fffd352d0453d81b6c3c0455b0
Showing with 21 additions and 8 deletions.
  1. +10 −8 Makefile
  2. +11 −0 tools/getnodeisrelease.py
View
@@ -192,15 +192,17 @@ docclean:
-rm -rf out/doc
VERSION=v$(shell $(PYTHON) tools/getnodeversion.py)
+RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py)
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
-ifeq ($(DESTCPU),x64)
-ARCH=x86_64
-else
-ifeq ($(DESTCPU),ia32)
-ARCH=i386
+ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
+DESTCPU ?= x64
else
-ARCH=$(shell uname -m)
+DESTCPU ?= ia32
endif
+ifeq ($(DESTCPU),x64)
+ARCH=x64
+else
+ARCH=x86
endif
TARNAME=node-$(VERSION)
TARBALL=$(TARNAME).tar.gz
@@ -225,11 +227,11 @@ release-only:
echo "" >&2 ; \
exit 1 ; \
fi
- @if [ $(shell ./node --version) = "$(VERSION)" ]; then \
+ @if [ "$(RELEASE)" = "1" ]; then \
exit 0; \
else \
echo "" >&2 ; \
- echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \
+ echo "#NODE_VERSION_IS_RELEASE is set to $(RELEASE)." >&2 ; \
echo "Did you remember to update src/node_version.cc?" >&2 ; \
echo "" >&2 ; \
exit 1 ; \
View
@@ -0,0 +1,11 @@
+import sys,os,re
+
+node_version_h = os.path.join(os.path.dirname(__file__), '..', 'src',
+ 'node_version.h')
+
+f = open(node_version_h)
+
+for line in f:
+ if re.match('#define NODE_VERSION_IS_RELEASE', line):
+ release = int(line.split()[2])
+ print release

0 comments on commit 64ac54a

Please sign in to comment.