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

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>2017-05-05 20:55:16 +0300
committerRebecca Turner <me@re-becca.org>2017-08-17 21:45:41 +0300
commit0756d687d4ccfcd4a7fd83db0065eceb9261befb (patch)
tree9cd8b7718758fa6d3892dded8af7b6dd17fc1e2f /Makefile
parent0ef320cb40222693b7367b97c60ddffabc2d58c5 (diff)
makefile: fix doc build tools dependencies
The build tools for the documentation need to be built/installed before the documents, even with parallel builds. Make has a simple mechanism which was made exactly for that: target dependencies. PR-URL: https://github.com/npm/npm/pull/16550 Credit: @metux Reviewed-By: @iarna
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 14 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 53ab16a29..42b7beda9 100644
--- a/Makefile
+++ b/Makefile
@@ -88,12 +88,16 @@ doc-clean:
html/doc \
man
+## build-time tools for the documentation
+build-doc-tools := node_modules/.bin/marked \
+ node_modules/.bin/marked-man
+
# use `npm install marked-man` for this to work.
-man/man1/npm-README.1: README.md scripts/doc-build.sh package.json
+man/man1/npm-README.1: README.md scripts/doc-build.sh package.json $(build-doc-tools)
@[ -d man/man1 ] || mkdir -p man/man1
scripts/doc-build.sh $< $@
-man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json
+man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json $(build-doc-tools)
@[ -d man/man1 ] || mkdir -p man/man1
scripts/doc-build.sh $< $@
@@ -106,26 +110,26 @@ man/man5/npm-json.5: man/man5/package.json.5
man/man5/npm-global.5: man/man5/npm-folders.5
cp $< $@
-man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json
+man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json $(build-doc-tools)
@[ -d man/man5 ] || mkdir -p man/man5
scripts/doc-build.sh $< $@
-doc/misc/npm-index.md: scripts/index-build.js package.json
+doc/misc/npm-index.md: scripts/index-build.js package.json $(build-doc-tools)
node scripts/index-build.js > $@
-html/doc/index.html: doc/misc/npm-index.md $(html_docdeps)
+html/doc/index.html: doc/misc/npm-index.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc ] || mkdir -p html/doc
scripts/doc-build.sh $< $@
-man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json
+man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json $(build-doc-tools)
@[ -d man/man7 ] || mkdir -p man/man7
scripts/doc-build.sh $< $@
-html/doc/README.html: README.md $(html_docdeps)
+html/doc/README.html: README.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc ] || mkdir -p html/doc
scripts/doc-build.sh $< $@
-html/doc/cli/%.html: doc/cli/%.md $(html_docdeps)
+html/doc/cli/%.html: doc/cli/%.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc/cli ] || mkdir -p html/doc/cli
scripts/doc-build.sh $< $@
@@ -135,11 +139,11 @@ html/doc/files/npm-json.html: html/doc/files/package.json.html
html/doc/files/npm-global.html: html/doc/files/npm-folders.html
cp $< $@
-html/doc/files/%.html: doc/files/%.md $(html_docdeps)
+html/doc/files/%.html: doc/files/%.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc/files ] || mkdir -p html/doc/files
scripts/doc-build.sh $< $@
-html/doc/misc/%.html: doc/misc/%.md $(html_docdeps)
+html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc/misc ] || mkdir -p html/doc/misc
scripts/doc-build.sh $< $@