From 1738fa189d4bfeb0485c820a31f4c3ba1f773574 Mon Sep 17 00:00:00 2001 From: Robert Jefe Lindstaedt Date: Fri, 20 May 2016 23:16:47 +0200 Subject: [PATCH] doc: make doc-only -> fallback to user binary --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ef503ae69975e8..9a5bbf2f79c497 100644 --- a/Makefile +++ b/Makefile @@ -278,11 +278,15 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/ out/doc/%: doc/% cp -r $< $@ +# 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 - $(NODE) tools/doc/generate.js --format=json $< > $@ + [ -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 - $(NODE) tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@ + [ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html) docopen: out/doc/api/all.html -google-chrome out/doc/api/all.html