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