Browse Source

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

Closes #3841.
Closes #3842.
v0.8.7-release
Nathan Rajlich 13 years ago
parent
commit
64ac54a64d
  1. 18
      Makefile
  2. 11
      tools/getnodeisrelease.py

18
Makefile

@ -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 ; \

11
tools/getnodeisrelease.py

@ -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
Loading…
Cancel
Save