diff options
author | isaacs <i@izs.me> | 2011-10-04 05:47:53 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-10-04 05:47:53 +0400 |
commit | b337aced94f3e7d8c0de148e3bbb77f73020c23d (patch) | |
tree | 5eefec215ad516d70e3b375dc5ecbd4d4acaa578 | |
parent | bd0c73dbbe9dbe11ff2f75fb7ef11c7431a59ab9 (diff) |
Update 'make doc' to only ronn build if necessary
Also, updated to play nicely with 'make -j8 doc'
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rwxr-xr-x | scripts/doc-build.sh | 20 |
3 files changed, 27 insertions, 6 deletions
@@ -53,12 +53,14 @@ clean: doc-clean uninstall uninstall: submodules node cli.js rm npm -g -f -doc: node_modules/ronn $(mandocs) $(htmldocs) +doc: $(mandocs) $(htmldocs) docclean: doc-clean doc-clean: rm -rf \ node_modules/ronn \ + node_modules/.bin/ronn \ + .building_ronn \ doc/cli/index.md \ doc/api/index.md \ $(api_mandocs) \ @@ -67,9 +69,6 @@ doc-clean: $(cli_htmldocs) \ &>/dev/null || true -node_modules/ronn: - node cli.js install git+https://github.com/isaacs/ronnjs.git - # use `npm install ronn` for this to work. man/man1/README.1: README.md scripts/doc-build.sh package.json scripts/doc-build.sh $< $@ @@ -94,6 +93,9 @@ html/api/%.html: doc/api/%.md html/dochead.html html/docfoot.html scripts/doc-bu doc/cli/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json node scripts/index-build.js > $@ +node_modules/ronn: + node cli.js install https://github.com/isaacs/ronnjs/tarball/master + doc: man man: $(cli_docs) $(api_docs) diff --git a/package.json b/package.json index e4c184b37..c3b11c353 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,8 @@ , "request" , "proto-list" , "which" ] -, "devDependencies" : { "ronn" : "" } +, "devDependencies" : + { "ronn" : "https://github.com/isaacs/ronnjs/tarball/master" } , "engines" : { "node" : "0.4 || 0.5", "npm" : "1" } , "scripts" : { "test" : "./test/run" , "prepublish" : "make doc" diff --git a/scripts/doc-build.sh b/scripts/doc-build.sh index 915a3793e..6c32ea183 100755 --- a/scripts/doc-build.sh +++ b/scripts/doc-build.sh @@ -6,7 +6,25 @@ fi set -o errexit set -o pipefail -[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn +if ! [ -x node_modules/.bin/ronn ]; then + if [ -f .building_ronn ]; then + while [ -f .building_ronn ]; do + sleep 1 + done + else + # a race to see which make process will be the one to install ronn + echo $$ > .building_ronn + sleep 1 + if [ $(cat .building_ronn) == $$ ]; then + make node_modules/ronn + rm .building_ronn + else + while [ -f .building_ronn ]; do + sleep 1 + done + fi + fi +fi src=$1 dest=$2 |