Merge remote-tracking branch 'upstream/v0.10'
[platform/upstream/nodejs.git] / Makefile
index 01c689d..fbd8b2b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ PYTHON ?= python
 NINJA ?= ninja
 DESTDIR ?=
 SIGN ?=
+PREFIX ?= /usr/local
 
 NODE ?= ./node
 
@@ -13,6 +14,12 @@ NODE ?= ./node
 # or set the V environment variable to an empty string.
 V ?= 1
 
+ifeq ($(USE_NINJA),1)
+ifneq ($(V),)
+NINJA := $(NINJA) -v
+endif
+endif
+
 # BUILDTYPE=Debug builds both release and debug builds. If you want to compile
 # just the debug build, run `make -C out BUILDTYPE=Debug` instead.
 ifeq ($(BUILDTYPE),Release)
@@ -43,22 +50,26 @@ node_g: config.gypi out/Makefile
        ln -fs out/Debug/node $@
 endif
 
-out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
+out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
 ifeq ($(USE_NINJA),1)
        touch out/Makefile
-       $(PYTHON) tools/gyp_node -f ninja
+       $(PYTHON) tools/gyp_node.py -f ninja
 else
-       $(PYTHON) tools/gyp_node -f make
+       $(PYTHON) tools/gyp_node.py -f make
 endif
 
 config.gypi: configure
-       $(PYTHON) ./configure
+       if [ -f $@ ]; then
+               $(error Stale $@, please re-run ./configure)
+       else
+               $(error No $@, please run ./configure first)
+       fi
 
 install: all
-       $(PYTHON) tools/install.py $@ $(DESTDIR)
+       $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
 
 uninstall:
-       $(PYTHON) tools/install.py $@ $(DESTDIR)
+       $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
 
 clean:
        -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md
@@ -75,6 +86,7 @@ distclean:
 test: all
        $(PYTHON) tools/test.py --mode=release simple message
        $(MAKE) jslint
+       $(MAKE) cpplint
 
 test-http1: all
        $(PYTHON) tools/test.py --mode=release --use-http1 simple message
@@ -82,16 +94,16 @@ test-http1: all
 test-valgrind: all
        $(PYTHON) tools/test.py --mode=release --valgrind simple message
 
-test/gc/node_modules/weak/build:
+test/gc/node_modules/weak/build/Release/weakref.node:
        @if [ ! -f node ]; then make all; fi
        ./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
                --directory="$(shell pwd)/test/gc/node_modules/weak" \
                --nodedir="$(shell pwd)"
 
-test-gc: all test/gc/node_modules/weak/build
+test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
        $(PYTHON) tools/test.py --mode=release gc
 
-test-all: all test/gc/node_modules/weak/build
+test-all: all test/gc/node_modules/weak/build/Release/weakref.node
        $(PYTHON) tools/test.py --mode=debug,release
        make test-npm
 
@@ -387,8 +399,19 @@ jslintfix:
 jslint:
        PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
 
+CPPLINT_EXCLUDE ?=
+CPPLINT_EXCLUDE += src/node_dtrace.cc
+CPPLINT_EXCLUDE += src/node_dtrace.cc
+CPPLINT_EXCLUDE += src/node_root_certs.h
+CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
+CPPLINT_EXCLUDE += src/queue.h
+CPPLINT_EXCLUDE += src/tree.h
+CPPLINT_EXCLUDE += src/v8abbr.h
+
+CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard src/*.cc src/*.h src/*.c))
+
 cpplint:
-       @$(PYTHON) tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
+       @$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
 
 lint: jslint cpplint