src: add --security-revert command line flag
[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/doc-*/
109         $(NODE) tools/doc/addon-verify.js
110         touch $@
111
112 ADDONS_BINDING_GYPS := \
113         $(filter-out test/addons/doc-*/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),ppc64)
276 ARCH=ppc64
277 else
278 ifeq ($(DESTCPU),ppc)
279 ARCH=ppc
280 else
281 ARCH=x86
282 endif
283 endif
284 endif
285 endif
286
287 # enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel
288 ifeq ($(ARCH),ia32)
289 override ARCH=x86
290 endif
291 ifeq ($(DESTCPU),ia32)
292 override DESTCPU=x86
293 endif
294
295 TARNAME=node-$(FULLVERSION)
296 TARBALL=$(TARNAME).tar
297 BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
298 BINARYTAR=$(BINARYNAME).tar
299 # OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/
300 XZ=$(shell which xz > /dev/null 2>&1; echo $$?)
301 XZ_COMPRESSION ?= 9
302 PKG=$(TARNAME).pkg
303 PACKAGEMAKER ?= /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
304 PKGDIR=out/dist-osx
305
306 release-only:
307         @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
308                 exit 0 ; \
309         else \
310                 echo "" >&2 ; \
311                 echo "The git repository is not clean." >&2 ; \
312                 echo "Please commit changes before building release tarball." >&2 ; \
313                 echo "" >&2 ; \
314                 git status --porcelain | egrep -v '^\?\?' >&2 ; \
315                 echo "" >&2 ; \
316                 exit 1 ; \
317         fi
318         @if [ "$(DISTTYPE)" != "release" -o "$(RELEASE)" = "1" ]; then \
319                 exit 0; \
320         else \
321                 echo "" >&2 ; \
322                 echo "#NODE_VERSION_IS_RELEASE is set to $(RELEASE)." >&2 ; \
323                 echo "Did you remember to update src/node_version.h?" >&2 ; \
324                 echo "" >&2 ; \
325                 exit 1 ; \
326         fi
327
328 $(PKG): release-only
329         rm -rf $(PKGDIR)
330         rm -rf out/deps out/Release
331         $(PYTHON) ./configure \
332                 --dest-cpu=x64 \
333                 --tag=$(TAG) \
334                 --release-urlbase=$(RELEASE_URLBASE) \
335                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
336         $(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
337         SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
338         cat tools/osx-pkg.pmdoc/index.xml.tmpl \
339                 | sed -E "s/\\{nodeversion\\}/$(FULLVERSION)/g" \
340                 | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \
341                 > tools/osx-pkg.pmdoc/index.xml
342         $(PACKAGEMAKER) \
343                 --id "org.nodejs.pkg" \
344                 --doc tools/osx-pkg.pmdoc \
345                 --out $(PKG)
346         SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh
347
348 pkg: $(PKG)
349
350 pkg-upload: pkg
351         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
352         chmod 664 node-$(FULLVERSION).pkg
353         scp -p node-$(FULLVERSION).pkg $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg
354         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg.done"
355
356 $(TARBALL): release-only $(NODE_EXE) doc
357         git checkout-index -a -f --prefix=$(TARNAME)/
358         mkdir -p $(TARNAME)/doc/api
359         cp doc/node.1 $(TARNAME)/doc/node.1
360         cp -r out/doc/api/* $(TARNAME)/doc/api/
361         rm -rf $(TARNAME)/deps/v8/{test,samples,tools/profviz} # too big
362         rm -rf $(TARNAME)/doc/images # too big
363         rm -rf $(TARNAME)/deps/uv/{docs,samples,test}
364         rm -rf $(TARNAME)/deps/openssl/{doc,demos,test}
365         rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused
366         find $(TARNAME)/ -type l | xargs rm # annoying on windows
367         tar -cf $(TARNAME).tar $(TARNAME)
368         rm -rf $(TARNAME)
369         gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz
370 ifeq ($(XZ), 0)
371         xz -c -f -$(XZ_COMPRESSION) $(TARNAME).tar > $(TARNAME).tar.xz
372 endif
373         rm $(TARNAME).tar
374
375 tar: $(TARBALL)
376
377 tar-upload: tar
378         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
379         chmod 664 node-$(FULLVERSION).tar.gz
380         scp -p node-$(FULLVERSION).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz
381         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz.done"
382 ifeq ($(XZ), 0)
383         chmod 664 node-$(FULLVERSION).tar.xz
384         scp -p node-$(FULLVERSION).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz
385         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz.done"
386 endif
387
388 doc-upload: tar
389         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
390         chmod -R ug=rw-x+X,o=r+X out/doc/
391         scp -pr out/doc/ $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/
392         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs.done"
393
394 $(TARBALL)-headers: config.gypi release-only
395         $(PYTHON) ./configure \
396                 --prefix=/ \
397                 --dest-cpu=$(DESTCPU) \
398                 --tag=$(TAG) \
399                 --release-urlbase=$(RELEASE_URLBASE) \
400                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
401         HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/'
402         find $(TARNAME)/ -type l | xargs rm # annoying on windows
403         tar -cf $(TARNAME)-headers.tar $(TARNAME)
404         rm -rf $(TARNAME)
405         gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
406 ifeq ($(XZ), 0)
407         xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
408 endif
409         rm $(TARNAME)-headers.tar
410
411 tar-headers: $(TARBALL)-headers
412
413 tar-headers-upload: tar-headers
414         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
415         chmod 664 $(TARNAME)-headers.tar.gz
416         scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz
417         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done"
418 ifeq ($(XZ), 0)
419         chmod 664 $(TARNAME)-headers.tar.xz
420         scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz
421         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
422 endif
423
424 $(BINARYTAR): release-only
425         rm -rf $(BINARYNAME)
426         rm -rf out/deps out/Release
427         $(PYTHON) ./configure \
428                 --prefix=/ \
429                 --dest-cpu=$(DESTCPU) \
430                 --tag=$(TAG) \
431                 --release-urlbase=$(RELEASE_URLBASE) \
432                 $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
433         $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
434         cp README.md $(BINARYNAME)
435         cp LICENSE $(BINARYNAME)
436         cp CHANGELOG.md $(BINARYNAME)
437         tar -cf $(BINARYNAME).tar $(BINARYNAME)
438         rm -rf $(BINARYNAME)
439         gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz
440 ifeq ($(XZ), 0)
441         xz -c -f -$(XZ_COMPRESSION) $(BINARYNAME).tar > $(BINARYNAME).tar.xz
442 endif
443         rm $(BINARYNAME).tar
444
445 binary: $(BINARYTAR)
446
447 binary-upload: binary
448         ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
449         chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
450         scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz
451         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done"
452 ifeq ($(XZ), 0)
453         chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
454         scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz
455         ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz.done"
456 endif
457
458 haswrk=$(shell which wrk > /dev/null 2>&1; echo $$?)
459 wrk:
460 ifneq ($(haswrk), 0)
461         @echo "please install wrk before proceeding. More information can be found in benchmark/README.md." >&2
462         @exit 1
463 endif
464
465 bench-net: all
466         @$(NODE) benchmark/common.js net
467
468 bench-crypto: all
469         @$(NODE) benchmark/common.js crypto
470
471 bench-tls: all
472         @$(NODE) benchmark/common.js tls
473
474 bench-http: wrk all
475         @$(NODE) benchmark/common.js http
476
477 bench-fs: all
478         @$(NODE) benchmark/common.js fs
479
480 bench-misc: all
481         @$(MAKE) -C benchmark/misc/function_call/
482         @$(NODE) benchmark/common.js misc
483
484 bench-array: all
485         @$(NODE) benchmark/common.js arrays
486
487 bench-buffer: all
488         @$(NODE) benchmark/common.js buffers
489
490 bench-url: all
491         @$(NODE) benchmark/common.js url
492
493 bench-events: all
494         @$(NODE) benchmark/common.js events
495
496 bench-util: all
497         @$(NODE) benchmark/common.js util
498
499 bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events
500
501 bench: bench-net bench-http bench-fs bench-tls
502
503 bench-http-simple:
504         benchmark/http_simple_bench.sh
505
506 bench-idle:
507         $(NODE) benchmark/idle_server.js &
508         sleep 1
509         $(NODE) benchmark/idle_clients.js &
510
511 jslint:
512         $(NODE) tools/eslint/bin/eslint.js src lib test tools/eslint-rules \
513                 --rulesdir tools/eslint-rules --reset --quiet
514
515 CPPLINT_EXCLUDE ?=
516 CPPLINT_EXCLUDE += src/node_lttng.cc
517 CPPLINT_EXCLUDE += src/node_root_certs.h
518 CPPLINT_EXCLUDE += src/node_lttng_tp.h
519 CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
520 CPPLINT_EXCLUDE += src/queue.h
521 CPPLINT_EXCLUDE += src/tree.h
522 CPPLINT_EXCLUDE += src/v8abbr.h
523 CPPLINT_EXCLUDE += $(wildcard test/addons/doc-*/*.cc test/addons/doc-*/*.h)
524
525 CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
526         deps/debugger-agent/include/* \
527         deps/debugger-agent/src/* \
528         src/*.c \
529         src/*.cc \
530         src/*.h \
531         test/addons/*/*.cc \
532         test/addons/*/*.h \
533         tools/icu/*.cc \
534         tools/icu/*.h \
535         ))
536
537 cpplint:
538         @$(PYTHON) tools/cpplint.py $(CPPLINT_FILES)
539
540 lint: jslint cpplint
541
542 .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \
543         check uninstall install install-includes install-bin all staticlib \
544         dynamiclib test test-all test-addons build-addons website-upload pkg \
545         blog blogclean tar binary release-only bench-http-simple bench-idle \
546         bench-all bench bench-misc bench-array bench-buffer bench-net \
547         bench-http bench-fs bench-tls cctest run-ci