@@ -492,28 +492,25 @@ out/doc/%: doc/%
492
492
493
493
# check if ./node is actually set, else use user pre-installed binary
494
494
gen-json = tools/doc/generate.js --format=json $< > $@
495
- out/doc/api/% .json : doc/api/% .md
496
- @[ -e tools/doc/node_modules/js-yaml/package.json ] || \
495
+ gen-html = tools/doc/generate.js --node-version=$(FULLVERSION ) --format=html \
496
+ --template=doc/template.html --analytics=$(DOCS_ANALYTICS ) $< > $@
497
+
498
+ gen-doc = \
499
+ [ -e tools/doc/node_modules/js-yaml/package.json ] || \
497
500
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
498
501
if [ -x $(NODE ) ]; then \
499
502
cd tools/doc && ../../$(NODE ) ../../$(NPM ) install; \
500
503
else \
501
504
cd tools/doc && node ../../$(NPM ) install; \
502
- fi
503
- [ -x $( NODE) ] && $(NODE ) $(gen-json ) || node $(gen-json )
505
+ fi;\
506
+ [ -x $(NODE ) ] && $(NODE ) $(gen-json ) || node
507
+
508
+ out/doc/api/% .json : doc/api/% .md
509
+ $(gen-doc ) $(gen-json )
504
510
505
511
# check if ./node is actually set, else use user pre-installed binary
506
- gen-html = tools/doc/generate.js --node-version=$(FULLVERSION ) --format=html \
507
- --template=doc/template.html --analytics=$(DOCS_ANALYTICS ) $< > $@
508
512
out/doc/api/% .html : doc/api/% .md
509
- @[ -e tools/doc/node_modules/js-yaml/package.json ] || \
510
- [ -e tools/eslint/node_modules/js-yaml/package.json ] || \
511
- if [ -x $( NODE) ]; then \
512
- cd tools/doc && ../../$(NODE ) ../../$(NPM ) install; \
513
- else \
514
- cd tools/doc && node ../../$(NPM ) install; \
515
- fi
516
- [ -x $( NODE) ] && $(NODE ) $(gen-html ) || node $(gen-html )
513
+ $(gen-doc ) $(gen-html )
517
514
518
515
docopen : $(apidocs_html )
519
516
@$(PYTHON ) -mwebbrowser file://$(PWD ) /out/doc/api/all.html
@@ -880,15 +877,17 @@ bench: bench-net bench-http bench-fs bench-tls
880
877
881
878
bench-ci : bench
882
879
880
+ JSLINT_TARGETS = benchmark doc lib test tools
881
+
883
882
jslint :
884
883
@echo " Running JS linter..."
885
884
$(NODE ) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.md \
886
- benchmark doc lib test tools
885
+ $( JSLINT_TARGETS )
887
886
888
887
jslint-ci :
889
888
@echo " Running JS linter..."
890
889
$(NODE ) tools/jslint.js $(PARALLEL_ARGS ) -f tap -o test-eslint.tap \
891
- benchmark doc lib test tools
890
+ $( JSLINT_TARGETS )
892
891
893
892
CPPLINT_EXCLUDE ?=
894
893
CPPLINT_EXCLUDE += src/node_root_certs.h
0 commit comments