tools: reduce verbosity of cpplint
[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-npm: $(NODE_EXE)
172         NODE=$(NODE) tools/test-npm.sh
173
174 test-npm-publish: $(NODE_EXE)
175         npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js
176
177 test-addons: test-build
178         $(PYTHON) tools/test.py --mode=release addons
179
180 test-timers:
181         $(MAKE) --directory=tools faketime
182         $(PYTHON) tools/test.py --mode=release timers
183
184 test-timers-clean:
185         $(MAKE) --directory=tools clean
186
187 apidoc_sources = $(wildcard doc/api/*.markdown)
188 apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
189                 $(addprefix out/,$(apidoc_sources:.markdown=.json))
190
191 apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
192
193 apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
194
195 doc: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE)
196
197 $(apidoc_dirs):
198         mkdir -p $@
199
200 out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
201         cp $< $@
202
203 out/doc/%: doc/%
204         cp -r $< $@
205
206 out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE)
207         $(NODE) tools/doc/generate.js --format=json $< > $@
208
209 out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE)
210         $(NODE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
211
212 docopen: out/doc/api/all.html
213         -google-chrome out/doc/api/all.html
214
215 docclean:
216         -rm -rf out/doc
217
218 run-ci:
219         $(PYTHON) ./configure $(CONFIG_FLAGS)
220         $(MAKE)
221         $(MAKE) test-ci
222
223 RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
224 VERSION=v$(RAWVER)
225
226 # For nightly builds, you must set DISTTYPE to "nightly", "next-nightly" or
227 # "custom". For the nightly and next-nightly case, you need to set DATESTRING
228 # and COMMIT in order to properly name the build.
229 # For the rc case you need to set CUSTOMTAG to an appropriate CUSTOMTAG number
230
231 ifndef DISTTYPE
232 DISTTYPE=release
233 endif
234 ifeq ($(DISTTYPE),release)
235 FULLVERSION=$(VERSION)
236 else # ifeq ($(DISTTYPE),release)
237 ifeq ($(DISTTYPE),custom)
238 ifndef CUSTOMTAG
239 $(error CUSTOMTAG is not set for DISTTYPE=custom)
240 endif # ifndef CUSTOMTAG
241 TAG=$(CUSTOMTAG)
242 else # ifeq ($(DISTTYPE),custom)
243 ifndef DATESTRING
244 $(error DATESTRING is not set for nightly)
245 endif # ifndef DATESTRING
246 ifndef COMMIT
247 $(error COMMIT is not set for nightly)
248 endif # ifndef COMMIT
249 ifneq ($(DISTTYPE),nightly)
250 ifneq ($(DISTTYPE),next-nightly)
251 $(error DISTTYPE is not release, custom, nightly or next-nightly)
252 endif # ifneq ($(DISTTYPE),next-nightly)
253 endif # ifneq ($(DISTTYPE),nightly)
254 TAG=$(DISTTYPE)$(DATESTRING)$(COMMIT)
255 endif # ifeq ($(DISTTYPE),custom)
256 FULLVERSION=$(VERSION)-$(TAG)
257 endif # ifeq ($(DISTTYPE),release)
258
259 DISTTYPEDIR ?= $(DISTTYPE)
260 RELEASE=$(shell sed -ne 's/\#define NODE_VERSION_IS_RELEASE \([01]\)/\1/p' src/node_version.h)
261 PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
262 NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/')
263
264 ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
265 DESTCPU ?= x64
266 else
267 DESTCPU ?= x86
268 endif
269 ifeq ($(DESTCPU),x64)
270 ARCH=x64
271 else
272 ifeq ($(DESTCPU),arm)
273 ARCH=arm
274 else
275 ifeq ($(DESTCPU),aarch64)
276 ARCH=arm64
277 else
278 ifeq ($(DESTCPU),ppc64)
279 ARCH=ppc64
280 else
281 ifeq ($(DESTCPU),ppc)
282 ARCH=ppc
283 else
284 ARCH=x86
285 endif
286 endif
287 endif
288 endif
289 endif
290
291 # enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel
292 ifeq ($(ARCH),ia32)
293 override ARCH=x86
294 endif
295 ifeq ($(DESTCPU),ia32)
296 override DESTCPU=x86
297 endif
298
299 TARNAME=node-$(FULLVERSION)
300 TARBALL=$(TARNAME).tar
301 BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
302 BINARYTAR=$(BINARYNAME).tar
303 # OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
304 XZ=$(shell which xz > /dev/null 2>&1; echo $$?)
305 XZ_COMPRESSION ?= 9
306 PKG=$(TARNAME).pkg
307 PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
308 PKGDIR=out/dist-osx
309
310 release-only:
311         @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
312                 exit 0 ; \
313         else \
314                 echo "" >&2 ; \
315                 echo "The git repository is not clean." >&2 ; \
316                 echo "Please commit changes before building release tarball." >&2 ; \
317                 echo "" >&2 ; \
318                 git status --porcelain | egrep -v '^\?\?' >&2 ; \
319                 echo "" >&2 ; \
320                 exit 1 ; \
321         fi
322         @if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \
323                 exit 0; \
324         else \
325                 echo "" >&2 ; \
326                 echo "#NODE_VERSION_IS_RELEASE is set to $(RELEASE)." >&2 ; \
327                 echo "Did you remember to update src/node_version.h?" >&2 ; \
328                 echo "" >&2 ; \
329                 exit 1 ; \
330         fi
331
332 $(PKG): release-only
333         rm -rf $(PKGDIR)
334         rm -rf out/deps out/Release
335         $(PYTHON) ./configure \
336                 --dest-cpu=x64 \
337                 --tag=$(TAG) \
338                 --release-urlbase=$(RELEASE_URLBASE) \
339                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
340         $(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
341         SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
342         cat tools/osx-pkg.pmdoc/index.xml.tmpl \
343                 | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \
344                 | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
345                 > tools/osx-pkg.pmdoc/index.xml
346         $(PACKAGEMAKER) \
347                 --id "org.nodejs.pkg" \
348                 --doc tools/osx-pkg.pmdoc \
349                 --out $(PKG)
350         SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh
351
352 pkg: $(PKG)
353
354 pkg-upload: pkg
355         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
356         chmod 664 node-$(FULLVERSION).pkg
357         scp -p node-$(FULLVERSION).pkg $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg
358         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg.done"
359
360 $(TARBALL): release-only $(NODE_EXE) doc
361         git checkout-index -a -f --prefix=$(TARNAME)/
362         mkdir -p $(TARNAME)/doc/api
363         cp doc/node.1 $(TARNAME)/doc/node.1
364         cp -r out/doc/api/* $(TARNAME)/doc/api/
365         rm -rf $(TARNAME)/deps/v8/{test,samples,tools/profviz} # too big
366         rm -rf $(TARNAME)/doc/images # too big
367         rm -rf $(TARNAME)/deps/uv/{docs,samples,test}
368         rm -rf $(TARNAME)/deps/openssl/{doc,demos,test}
369         rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused
370         find $(TARNAME)/ -type l | xargs rm # annoying on windows
371         tar -cf $(TARNAME).tar $(TARNAME)
372         rm -rf $(TARNAME)
373         gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz
374 ifeq ($(XZ), 0)
375         xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz
376 endif
377         rm $(TARNAME).tar
378
379 tar: $(TARBALL)
380
381 tar-upload: tar
382         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
383         chmod 664 node-$(FULLVERSION).tar.gz
384         scp -p node-$(FULLVERSION).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz
385         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz.done"
386 ifeq ($(XZ), 0)
387         chmod 664 node-$(FULLVERSION).tar.xz
388         scp -p node-$(FULLVERSION).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz
389         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz.done"
390 endif
391
392 doc-upload: tar
393         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
394         chmod -R ug=rw-x+X,o=r+X out/doc/
395         scp -pr out/doc/ $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/
396         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs.done"
397
398 $(TARBALL)-headers: config.gypi release-only
399         $(PYTHON) ./configure \
400                 --prefix=/ \
401                 --dest-cpu=$(DESTCPU) \
402                 --tag=$(TAG) \
403                 --release-urlbase=$(RELEASE_URLBASE) \
404                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
405         HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/'
406         find $(TARNAME)/ -type l | xargs rm # annoying on windows
407         tar -cf $(TARNAME)-headers.tar $(TARNAME)
408         rm -rf $(TARNAME)
409         gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
410 ifeq ($(XZ), 0)
411         xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
412 endif
413         rm $(TARNAME)-headers.tar
414
415 tar-headers: $(TARBALL)-headers
416
417 tar-headers-upload: tar-headers
418         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
419         chmod 664 $(TARNAME)-headers.tar.gz
420         scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz
421         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done"
422 ifeq ($(XZ), 0)
423         chmod 664 $(TARNAME)-headers.tar.xz
424         scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz
425         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
426 endif
427
428 $(BINARYTAR): release-only
429         rm -rf $(BINARYNAME)
430         rm -rf out/deps out/Release
431         $(PYTHON) ./configure \
432                 --prefix=/ \
433                 --dest-cpu=$(DESTCPU) \
434                 --tag=$(TAG) \
435                 --release-urlbase=$(RELEASE_URLBASE) \
436                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
437         $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
438         cp README.md $(BINARYNAME)
439         cp LICENSE $(BINARYNAME)
440         cp CHANGELOG.md $(BINARYNAME)
441         tar -cf $(BINARYNAME).tar $(BINARYNAME)
442         rm -rf $(BINARYNAME)
443         gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz
444 ifeq ($(XZ), 0)
445         xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz
446 endif
447         rm $(BINARYNAME).tar
448
449 binary: $(BINARYTAR)
450
451 binary-upload: binary
452         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
453         chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
454         scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
455         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done"
456 ifeq ($(XZ), 0)
457         chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
458         scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
459         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz.done"
460 endif
461
462 haswrk=$(shell which wrk > /dev/null 2>&1; echo $$?)
463 wrk:
464 ifneq ($(haswrk), 0)
465         @echo "please install wrk before proceeding. More information can be found in benchmark/README.md." >&2
466         @exit 1
467 endif
468
469 bench-net: all
470         @$(NODE) benchmark/common.js net
471
472 bench-crypto: all
473         @$(NODE) benchmark/common.js crypto
474
475 bench-tls: all
476         @$(NODE) benchmark/common.js tls
477
478 bench-http: wrk all
479         @$(NODE) benchmark/common.js http
480
481 bench-fs: all
482         @$(NODE) benchmark/common.js fs
483
484 bench-misc: all
485         @$(MAKE) -C benchmark/misc/function_call/
486         @$(NODE) benchmark/common.js misc
487
488 bench-array: all
489         @$(NODE) benchmark/common.js arrays
490
491 bench-buffer: all
492         @$(NODE) benchmark/common.js buffers
493
494 bench-url: all
495         @$(NODE) benchmark/common.js url
496
497 bench-events: all
498         @$(NODE) benchmark/common.js events
499
500 bench-util: all
501         @$(NODE) benchmark/common.js util
502
503 bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events
504
505 bench: bench-net bench-http bench-fs bench-tls
506
507 bench-http-simple:
508         benchmark/http_simple_bench.sh
509
510 bench-idle:
511         $(NODE) benchmark/idle_server.js &
512         sleep 1
513         $(NODE) benchmark/idle_clients.js &
514
515 jslint:
516         $(NODE) tools/eslint/bin/eslint.js lib src test tools/doc tools/eslint-rules \
517                 --rulesdir tools/eslint-rules
518
519 CPPLINT_EXCLUDE ?=
520 CPPLINT_EXCLUDE += src/node_lttng.cc
521 CPPLINT_EXCLUDE += src/node_root_certs.h
522 CPPLINT_EXCLUDE += src/node_lttng_tp.h
523 CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
524 CPPLINT_EXCLUDE += src/queue.h
525 CPPLINT_EXCLUDE += src/tree.h
526 CPPLINT_EXCLUDE += src/v8abbr.h
527 CPPLINT_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
528
529 CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
530         deps/debugger-agent/include/* \
531         deps/debugger-agent/src/* \
532         src/*.c \
533         src/*.cc \
534         src/*.h \
535         test/addons/*/*.cc \
536         test/addons/*/*.h \
537         tools/icu/*.cc \
538         tools/icu/*.h \
539         ))
540
541 cpplint:
542         @$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
543
544 lint: jslint cpplint
545
546 .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
547         check uninstall install install-includes install-bin all staticlib \
548         dynamiclib test test-all test-addons build-addons website-upload pkg \
549         blog blogclean tar binary release-only bench-http-simple bench-idle \
550         bench-all bench bench-misc bench-array bench-buffer bench-net \
551         bench-http bench-fs bench-tls cctest run-ci