src: enable v8 deprecation warnings and fix them
[platform/upstream/nodejs.git] / Makefile
1 -include config.mk
2
3 BUILDTYPE ?= Release
4 PYTHON ?= python
5 DESTDIR ?=
6 SIGN ?=
7 PREFIX ?= /usr/local
8 FLAKY_TESTS ?= run
9 TEST_CI_ARGS ?=
10 STAGINGSERVER ?= node-www
11
12 OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]')
13
14 # Determine EXEEXT
15 EXEEXT := $(shell $(PYTHON) -c \
16                 "import sys; print('.exe' if sys.platform == 'win32' else '')")
17
18 NODE ?= ./node$(EXEEXT)
19 NODE_EXE = node$(EXEEXT)
20 NODE_G_EXE = node_g$(EXEEXT)
21
22 # Flags for packaging.
23 BUILD_DOWNLOAD_FLAGS ?= --download=all
24 BUILD_INTL_FLAGS ?= --with-intl=small-icu
25 BUILD_RELEASE_FLAGS ?= $(BUILD_DOWNLOAD_FLAGS) $(BUILD_INTL_FLAGS)
26
27 # Default to verbose builds.
28 # To do quiet/pretty builds, run `make V=` to set V to an empty string,
29 # or set the V environment variable to an empty string.
30 V ?= 1
31
32 # BUILDTYPE=Debug builds both release and debug builds. If you want to compile
33 # just the debug build, run `make -C out BUILDTYPE=Debug` instead.
34 ifeq ($(BUILDTYPE),Release)
35 all: out/Makefile $(NODE_EXE)
36 else
37 all: out/Makefile $(NODE_EXE) $(NODE_G_EXE)
38 endif
39
40 # The .PHONY is needed to ensure that we recursively use the out/Makefile
41 # to check for changes.
42 .PHONY: $(NODE_EXE) $(NODE_G_EXE)
43
44 $(NODE_EXE): config.gypi out/Makefile
45         $(MAKE) -C out BUILDTYPE=Release V=$(V)
46         ln -fs out/Release/$(NODE_EXE) $@
47
48 $(NODE_G_EXE): config.gypi out/Makefile
49         $(MAKE) -C out BUILDTYPE=Debug V=$(V)
50         ln -fs out/Debug/$(NODE_EXE) $@
51
52 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
53         $(PYTHON) tools/gyp_node.py -f make
54
55 config.gypi: configure
56         if [ -f $@ ]; then
57                 $(error Stale $@, please re-run ./configure)
58         else
59                 $(error No $@, please run ./configure first)
60         fi
61
62 install: all
63         $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
64
65 uninstall:
66         $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
67
68 clean:
69         -rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE)
70         @if [ -d out ]; then find out/ -name '*.o' -o -name '*.a' | xargs rm -rf; fi
71         -rm -rf node_modules
72
73 distclean:
74         -rm -rf out
75         -rm -f config.gypi icu_config.gypi
76         -rm -f config.mk
77         -rm -rf $(NODE_EXE) $(NODE_G_EXE)
78         -rm -rf node_modules
79         -rm -rf deps/icu
80         -rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp
81         -rm -f $(BINARYTAR).* $(TARBALL).*
82
83 check: test
84
85 cctest: all
86         @out/$(BUILDTYPE)/$@
87
88 test: | cctest  # Depends on 'all'.
89         $(PYTHON) tools/test.py --mode=release message parallel sequential -J
90         $(MAKE) jslint
91         $(MAKE) cpplint
92
93 test-parallel: all
94         $(PYTHON) tools/test.py --mode=release parallel -J
95
96 test-valgrind: all
97         $(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message
98
99 test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE)
100         $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
101                 --directory="$(shell pwd)/test/gc/node_modules/weak" \
102                 --nodedir="$(shell pwd)"
103
104 # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
105 test/addons/.docbuildstamp: doc/api/addons.markdown
106         $(RM) -r test/addons/doc-*/
107         $(NODE) tools/doc/addon-verify.js
108         touch $@
109
110 ADDONS_BINDING_GYPS := \
111         $(filter-out test/addons/doc-*/binding.gyp, \
112                 $(wildcard test/addons/*/binding.gyp))
113
114 # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
115 test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) | test/addons/.docbuildstamp
116         # Cannot use $(wildcard test/addons/*/) here, it's evaluated before
117         # embedded addons have been generated from the documentation.
118         for dirname in test/addons/*/; do \
119                 $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
120                         --directory="$$PWD/$$dirname" \
121                         --nodedir="$$PWD"; \
122         done
123         touch $@
124
125 # .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
126 # directly because it calls make recursively.  The parent make cannot know
127 # if the subprocess touched anything so it pessimistically assumes that
128 # .buildstamp and .docbuildstamp are out of date and need a rebuild.
129 # Just goes to show that recursive make really is harmful...
130 # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
131 build-addons: $(NODE_EXE) test/addons/.buildstamp
132
133 test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
134         $(PYTHON) tools/test.py --mode=release gc
135
136 test-build: | all build-addons
137
138 test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node
139         $(PYTHON) tools/test.py --mode=debug,release
140
141 test-all-valgrind: test-build
142         $(PYTHON) tools/test.py --mode=debug,release --valgrind
143
144 test-ci: | build-addons
145         $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \
146                 $(TEST_CI_ARGS) addons message parallel sequential
147
148 test-release: test-build
149         $(PYTHON) tools/test.py --mode=release
150
151 test-debug: test-build
152         $(PYTHON) tools/test.py --mode=debug
153
154 test-message: test-build
155         $(PYTHON) tools/test.py message
156
157 test-simple: | cctest  # Depends on 'all'.
158         $(PYTHON) tools/test.py parallel sequential
159
160 test-pummel: all
161         $(PYTHON) tools/test.py pummel
162
163 test-internet: all
164         $(PYTHON) tools/test.py internet
165
166 test-debugger: all
167         $(PYTHON) tools/test.py debugger
168
169 test-npm: $(NODE_EXE)
170         NODE=$(NODE) tools/test-npm.sh
171
172 test-npm-publish: $(NODE_EXE)
173         npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js
174
175 test-addons: test-build
176         $(PYTHON) tools/test.py --mode=release addons
177
178 test-timers:
179         $(MAKE) --directory=tools faketime
180         $(PYTHON) tools/test.py --mode=release timers
181
182 test-timers-clean:
183         $(MAKE) --directory=tools clean
184
185 apidoc_sources = $(wildcard doc/api/*.markdown)
186 apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
187                 $(addprefix out/,$(apidoc_sources:.markdown=.json))
188
189 apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
190
191 apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
192
193 doc: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE)
194
195 $(apidoc_dirs):
196         mkdir -p $@
197
198 out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
199         cp $< $@
200
201 out/doc/%: doc/%
202         cp -r $< $@
203
204 out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE)
205         $(NODE) tools/doc/generate.js --format=json $< > $@
206
207 out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE)
208         $(NODE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
209
210 docopen: out/doc/api/all.html
211         -google-chrome out/doc/api/all.html
212
213 docclean:
214         -rm -rf out/doc
215
216 run-ci:
217         $(PYTHON) ./configure $(CONFIG_FLAGS)
218         $(MAKE)
219         $(MAKE) test-ci
220
221 RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
222 VERSION=v$(RAWVER)
223
224 # For nightly builds, you must set DISTTYPE to "nightly", "next-nightly" or
225 # "custom". For the nightly and next-nightly case, you need to set DATESTRING
226 # and COMMIT in order to properly name the build.
227 # For the rc case you need to set CUSTOMTAG to an appropriate CUSTOMTAG number
228
229 ifndef DISTTYPE
230 DISTTYPE=release
231 endif
232 ifeq ($(DISTTYPE),release)
233 FULLVERSION=$(VERSION)
234 else # ifeq ($(DISTTYPE),release)
235 ifeq ($(DISTTYPE),custom)
236 ifndef CUSTOMTAG
237 $(error CUSTOMTAG is not set for DISTTYPE=custom)
238 endif # ifndef CUSTOMTAG
239 TAG=$(CUSTOMTAG)
240 else # ifeq ($(DISTTYPE),custom)
241 ifndef DATESTRING
242 $(error DATESTRING is not set for nightly)
243 endif # ifndef DATESTRING
244 ifndef COMMIT
245 $(error COMMIT is not set for nightly)
246 endif # ifndef COMMIT
247 ifneq ($(DISTTYPE),nightly)
248 ifneq ($(DISTTYPE),next-nightly)
249 $(error DISTTYPE is not release, custom, nightly or next-nightly)
250 endif # ifneq ($(DISTTYPE),next-nightly)
251 endif # ifneq ($(DISTTYPE),nightly)
252 TAG=$(DISTTYPE)$(DATESTRING)$(COMMIT)
253 endif # ifeq ($(DISTTYPE),custom)
254 FULLVERSION=$(VERSION)-$(TAG)
255 endif # ifeq ($(DISTTYPE),release)
256
257 DISTTYPEDIR ?= $(DISTTYPE)
258 RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/node_version.h)
259 PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
260 NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/')
261
262 ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
263 DESTCPU ?= x64
264 else
265 DESTCPU ?= x86
266 endif
267 ifeq ($(DESTCPU),x64)
268 ARCH=x64
269 else
270 ifeq ($(DESTCPU),arm)
271 ARCH=arm
272 else
273 ifeq ($(DESTCPU),ppc64)
274 ARCH=ppc64
275 else
276 ifeq ($(DESTCPU),ppc)
277 ARCH=ppc
278 else
279 ARCH=x86
280 endif
281 endif
282 endif
283 endif
284
285 # enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel
286 ifeq ($(ARCH),ia32)
287 override ARCH=x86
288 endif
289 ifeq ($(DESTCPU),ia32)
290 override DESTCPU=x86
291 endif
292
293 TARNAME=node-$(FULLVERSION)
294 TARBALL=$(TARNAME).tar
295 BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
296 BINARYTAR=$(BINARYNAME).tar
297 # OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
298 XZ=$(shell which xz > /dev/null 2>&1; echo $$?)
299 XZ_COMPRESSION ?= 9
300 PKG=$(TARNAME).pkg
301 PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
302 PKGDIR=out/dist-osx
303
304 release-only:
305         @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
306                 exit 0 ; \
307         else \
308                 echo "" >&2 ; \
309                 echo "The git repository is not clean." >&2 ; \
310                 echo "Please commit changes before building release tarball." >&2 ; \
311                 echo "" >&2 ; \
312                 git status --porcelain | egrep -v '^\?\?' >&2 ; \
313                 echo "" >&2 ; \
314                 exit 1 ; \
315         fi
316         @if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \
317                 exit 0; \
318         else \
319                 echo "" >&2 ; \
320                 echo "#NODE_VERSION_IS_RELEASE is set to $(RELEASE)." >&2 ; \
321                 echo "Did you remember to update src/node_version.h?" >&2 ; \
322                 echo "" >&2 ; \
323                 exit 1 ; \
324         fi
325
326 $(PKG): release-only
327         rm -rf $(PKGDIR)
328         rm -rf out/deps out/Release
329         $(PYTHON) ./configure \
330                 --dest-cpu=x64 \
331                 --tag=$(TAG) \
332                 --release-urlbase=$(RELEASE_URLBASE) \
333                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
334         $(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
335         SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
336         cat tools/osx-pkg.pmdoc/index.xml.tmpl \
337                 | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \
338                 | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
339                 > tools/osx-pkg.pmdoc/index.xml
340         $(PACKAGEMAKER) \
341                 --id "org.node.pkg" \
342                 --doc tools/osx-pkg.pmdoc \
343                 --out $(PKG)
344         SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh
345
346 pkg: $(PKG)
347
348 pkg-upload: pkg
349         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
350         chmod 664 node-$(FULLVERSION).pkg
351         scp -p node-$(FULLVERSION).pkg $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg
352         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg.done"
353
354 $(TARBALL): release-only $(NODE_EXE) doc
355         git checkout-index -a -f --prefix=$(TARNAME)/
356         mkdir -p $(TARNAME)/doc/api
357         cp doc/node.1 $(TARNAME)/doc/node.1
358         cp -r out/doc/api/* $(TARNAME)/doc/api/
359         rm -rf $(TARNAME)/deps/v8/{test,samples,tools/profviz} # too big
360         rm -rf $(TARNAME)/doc/images # too big
361         rm -rf $(TARNAME)/deps/uv/{docs,samples,test}
362         rm -rf $(TARNAME)/deps/openssl/{doc,demos,test}
363         rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused
364         find $(TARNAME)/ -type l | xargs rm # annoying on windows
365         tar -cf $(TARNAME).tar $(TARNAME)
366         rm -rf $(TARNAME)
367         gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz
368 ifeq ($(XZ), 0)
369         xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz
370 endif
371         rm $(TARNAME).tar
372
373 tar: $(TARBALL)
374
375 tar-upload: tar
376         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
377         chmod 664 node-$(FULLVERSION).tar.gz
378         scp -p node-$(FULLVERSION).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz
379         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz.done"
380 ifeq ($(XZ), 0)
381         chmod 664 node-$(FULLVERSION).tar.xz
382         scp -p node-$(FULLVERSION).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz
383         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz.done"
384 endif
385
386 doc-upload: tar
387         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
388         chmod -R ug=rw-x+X,o=r+X out/doc/
389         scp -pr out/doc/ $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/
390         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs.done"
391
392 $(TARBALL)-headers: config.gypi release-only
393         $(PYTHON) ./configure \
394                 --prefix=/ \
395                 --dest-cpu=$(DESTCPU) \
396                 --tag=$(TAG) \
397                 --release-urlbase=$(RELEASE_URLBASE) \
398                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
399         HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/'
400         find $(TARNAME)/ -type l | xargs rm # annoying on windows
401         tar -cf $(TARNAME)-headers.tar $(TARNAME)
402         rm -rf $(TARNAME)
403         gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
404 ifeq ($(XZ), 0)
405         xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
406 endif
407         rm $(TARNAME)-headers.tar
408
409 tar-headers: $(TARBALL)-headers
410
411 tar-headers-upload: tar-headers
412         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
413         chmod 664 $(TARNAME)-headers.tar.gz
414         scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz
415         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done"
416 ifeq ($(XZ), 0)
417         chmod 664 $(TARNAME)-headers.tar.xz
418         scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz
419         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
420 endif
421
422 $(BINARYTAR): release-only
423         rm -rf $(BINARYNAME)
424         rm -rf out/deps out/Release
425         $(PYTHON) ./configure \
426                 --prefix=/ \
427                 --dest-cpu=$(DESTCPU) \
428                 --tag=$(TAG) \
429                 --release-urlbase=$(RELEASE_URLBASE) \
430                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
431         $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
432         cp README.md $(BINARYNAME)
433         cp LICENSE $(BINARYNAME)
434         cp CHANGELOG.md $(BINARYNAME)
435         tar -cf $(BINARYNAME).tar $(BINARYNAME)
436         rm -rf $(BINARYNAME)
437         gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz
438 ifeq ($(XZ), 0)
439         xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz
440 endif
441         rm $(BINARYNAME).tar
442
443 binary: $(BINARYTAR)
444
445 binary-upload: binary
446         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
447         chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
448         scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
449         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done"
450 ifeq ($(XZ), 0)
451         chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
452         scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
453         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz.done"
454 endif
455
456 haswrk=$(shell which wrk > /dev/null 2>&1; echo $$?)
457 wrk:
458 ifneq ($(haswrk), 0)
459         @echo "please install wrk before proceeding. More information can be found in benchmark/README.md." >&2
460         @exit 1
461 endif
462
463 bench-net: all
464         @$(NODE) benchmark/common.js net
465
466 bench-crypto: all
467         @$(NODE) benchmark/common.js crypto
468
469 bench-tls: all
470         @$(NODE) benchmark/common.js tls
471
472 bench-http: wrk all
473         @$(NODE) benchmark/common.js http
474
475 bench-fs: all
476         @$(NODE) benchmark/common.js fs
477
478 bench-misc: all
479         @$(MAKE) -C benchmark/misc/function_call/
480         @$(NODE) benchmark/common.js misc
481
482 bench-array: all
483         @$(NODE) benchmark/common.js arrays
484
485 bench-buffer: all
486         @$(NODE) benchmark/common.js buffers
487
488 bench-url: all
489         @$(NODE) benchmark/common.js url
490
491 bench-events: all
492         @$(NODE) benchmark/common.js events
493
494 bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events
495
496 bench: bench-net bench-http bench-fs bench-tls
497
498 bench-http-simple:
499         benchmark/http_simple_bench.sh
500
501 bench-idle:
502         $(NODE) benchmark/idle_server.js &
503         sleep 1
504         $(NODE) benchmark/idle_clients.js &
505
506 jslint:
507         $(NODE) tools/eslint/bin/eslint.js src lib test --rulesdir tools/eslint-rules --reset --quiet
508
509 CPPLINT_EXCLUDE ?=
510 CPPLINT_EXCLUDE += src/node_lttng.cc
511 CPPLINT_EXCLUDE += src/node_root_certs.h
512 CPPLINT_EXCLUDE += src/node_lttng_tp.h
513 CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
514 CPPLINT_EXCLUDE += src/queue.h
515 CPPLINT_EXCLUDE += src/tree.h
516 CPPLINT_EXCLUDE += src/v8abbr.h
517 CPPLINT_EXCLUDE += $(wildcard test/addons/doc-*/*.cc test/addons/doc-*/*.h)
518
519 CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
520         deps/debugger-agent/include/* \
521         deps/debugger-agent/src/* \
522         src/*.c \
523         src/*.cc \
524         src/*.h \
525         test/addons/*/*.cc \
526         test/addons/*/*.h \
527         tools/icu/*.cc \
528         tools/icu/*.h \
529         ))
530
531 cpplint:
532         @$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
533
534 lint: jslint cpplint
535
536 .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
537         check uninstall install install-includes install-bin all staticlib \
538         dynamiclib test test-all test-addons build-addons website-upload pkg \
539         blog blogclean tar binary release-only bench-http-simple bench-idle \
540         bench-all bench bench-misc bench-array bench-buffer bench-net \
541         bench-http bench-fs bench-tls cctest run-ci