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