NINJA ?= ninja
DESTDIR ?=
SIGN ?=
+PREFIX ?= /usr/local
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)
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.py -f ninja
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
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
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