summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-09-05 22:34:06 +0200
committerAnna Henningsen <anna@addaleax.net>2016-09-20 13:58:06 +0200
commit9391cb0fdeb5a247e60621abde79f0c323feb2a8 (patch)
treeadf65d4b297f20bbeaa63f00bbdea5354893eacb /Makefile
parent2eb3fa14f8d62fcf8eeb54a907714efa354423ac (diff)
downloadandroid-node-v8-9391cb0fdeb5a247e60621abde79f0c323feb2a8.tar.gz
android-node-v8-9391cb0fdeb5a247e60621abde79f0c323feb2a8.tar.bz2
android-node-v8-9391cb0fdeb5a247e60621abde79f0c323feb2a8.zip
build: run `npm install` for doc builds in tarball
Run `npm install` before building the documentation from release tarballs. The doctool currently depends on `js-yaml`, which is imported from the `tools/eslint` subtree; however, release tarballs don’t contain that directory. Running `npm install` is clearly not a beautiful solution, but it works. Fixes: https://github.com/nodejs/node/issues/7872 PR-URL: https://github.com/nodejs/node/pull/8413 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 81700ed50f..5705789b80 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,7 @@ EXEEXT := $(shell $(PYTHON) -c \
NODE_EXE = node$(EXEEXT)
NODE ?= ./$(NODE_EXE)
NODE_G_EXE = node_g$(EXEEXT)
+NPM ?= ./deps/npm/bin/npm-cli.js
# Flags for packaging.
BUILD_DOWNLOAD_FLAGS ?= --download=all
@@ -311,11 +312,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 ] || \
+ [ -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)
# 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 $< > $@
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)
docopen: out/doc/api/all.html