Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Bekenev <furyinbox@gmail.com>2017-06-05 22:32:57 +0300
committerMyles Borins <mylesborins@google.com>2017-09-12 04:16:56 +0300
commit9d373981f44a0be93b34dec1db05446384f2dfd1 (patch)
treed0a79b1ae1d833d9bb6476b2076dbc18ae8f5fba /Makefile
parent80fe40aabfa2993e60ffd458bda045ae34057007 (diff)
build: remove duplicated code
Makefile contains copy-pasted code in some targets and this commit aims to remove it. PR-URL: https://github.com/nodejs/node/pull/13482 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 15 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index ced319ee68f..bb02aa36426 100644
--- a/Makefile
+++ b/Makefile
@@ -492,28 +492,25 @@ out/doc/%: doc/%
# check if ./node is actually set, else use user pre-installed binary
gen-json = tools/doc/generate.js --format=json $< > $@
-out/doc/api/%.json: doc/api/%.md
- @[ -e tools/doc/node_modules/js-yaml/package.json ] || \
+gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
+ --template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@
+
+gen-doc = \
+ [ -e tools/doc/node_modules/js-yaml/package.json ] || \
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
if [ -x $(NODE) ]; then \
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
else \
cd tools/doc && node ../../$(NPM) install; \
- fi
- [ -x $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json)
+ fi;\
+ [ -x $(NODE) ] && $(NODE) $(gen-json) || node
+
+out/doc/api/%.json: doc/api/%.md
+ $(gen-doc) $(gen-json)
# check if ./node is actually set, else use user pre-installed binary
-gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
- --template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@
out/doc/api/%.html: doc/api/%.md
- @[ -e tools/doc/node_modules/js-yaml/package.json ] || \
- [ -e tools/eslint/node_modules/js-yaml/package.json ] || \
- if [ -x $(NODE) ]; then \
- cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
- else \
- cd tools/doc && node ../../$(NPM) install; \
- fi
- [ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html)
+ $(gen-doc) $(gen-html)
docopen: $(apidocs_html)
@$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html
@@ -880,15 +877,17 @@ bench: bench-net bench-http bench-fs bench-tls
bench-ci: bench
+JSLINT_TARGETS = benchmark doc lib test tools
+
jslint:
@echo "Running JS linter..."
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.md \
- benchmark doc lib test tools
+ $(JSLINT_TARGETS)
jslint-ci:
@echo "Running JS linter..."
$(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
- benchmark doc lib test tools
+ $(JSLINT_TARGETS)
CPPLINT_EXCLUDE ?=
CPPLINT_EXCLUDE += src/node_root_certs.h