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:
authorJameson Little <t.jameson.little@gmail.com>2011-08-20 05:57:09 +0400
committerisaacs <i@izs.me>2011-08-23 06:05:40 +0400
commita98be6a80d2e7e8a49a23de2ff19f0af40f27ad6 (patch)
treeb7ac22a6e51a11d5f638535f1e5e7e03925aab45 /Makefile
parentc7824f412f0cb59d6f55cf0bc220253c39e6029f (diff)
Updated Makefile to enable building of api-docs into man3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 22 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index bb2f8f475..ade54f565 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,19 @@
SHELL = bash
-docs = $(shell find doc -name '*.md' \
+cli_docs = $(shell find doc -name '*.md' \
|sed 's|.md|.1|g' \
|sed 's|doc/|man1/|g' )
-doc_subfolders = $(shell find doc -type d \
+api_docs = $(shell find api-doc -name '*.md' \
+ |sed 's|.md|.3|g' \
+ |sed 's|api-doc/|man3/|g' )
+
+cli_doc_subfolders = $(shell find doc -type d \
|sed 's|doc/|man1/|g' )
+api_doc_subfolders = $(shell find api-doc -type d \
+ |sed 's|api-doc/|man3/|g' )
+
# This is the default make target.
# Since 'make' typically does non-installation build stuff,
# it seems appropriate.
@@ -34,12 +41,15 @@ clean: uninstall
uninstall: submodules
node cli.js rm npm -g -f
-man: man1
+man: man1 man3
-man1: $(doc_subfolders)
+man1: $(cli_doc_subfolders)
[ -d man1 ] || mkdir -p man1
-doc: man1 $(docs)
+man3: $(api_doc_subfolders)
+ [ -d man3 ] || mkdir -p man3
+
+doc: man1 $(cli_docs) man3 $(api_docs)
# use `npm install ronn` for this to work.
man1/%.1: doc/%.md
@@ -49,6 +59,13 @@ man1/%.1: doc/%.md
man1/%/: doc/%/
@[ -d $@ ] || mkdir -p $@
+man3/%.3: api-doc/%.md
+ @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
+ ./node_modules/.bin/ronn --roff $< > $@
+
+man3/%/: api-doc/%/
+ @[ -d $@ ] || mkdir -p $@
+
test: submodules
node cli.js test