Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 125 lines (91 sloc) 3.439 kb
64b4d65 explicitly set bash as the shell since the makefile uses bash-isms
gflarity authored
1 SHELL = bash
2
cc34185 @isaacs doc/index.md depends on readme
isaacs authored
3 markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md
8fdd60d @isaacs Build an index of all html documentation files
isaacs authored
4
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
5 cli_mandocs = $(shell find doc/cli -name '*.md' \
6 |sed 's|.md|.1|g' \
7 |sed 's|doc/cli/|man/man1/|g' ) \
8 man/man1/README.1 \
9 man/man1/index.1
10
11 api_mandocs = $(shell find doc/api -name '*.md' \
12 |sed 's|.md|.3|g' \
13 |sed 's|doc/api/|man/man3/|g' )
14
15 cli_htmldocs = $(shell find doc/cli -name '*.md' \
16 |grep -v 'index.md' \
17 |sed 's|.md|.html|g' \
18 |sed 's|doc/cli/|html/doc/|g' ) \
19 html/doc/README.html \
20 html/doc/index.html
21
22 api_htmldocs = $(shell find doc/api -name '*.md' \
23 |sed 's|.md|.html|g' \
24 |sed 's|doc/api/|html/api/|g' )
25
26 mandocs = $(api_mandocs) $(cli_mandocs)
27
28 htmldocs = $(api_htmldocs) $(cli_htmldocs)
0e151fc @isaacs build submodules in make process
isaacs authored
29
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
30 all: submodules doc
31
0e151fc @isaacs build submodules in make process
isaacs authored
32 submodules:
007fedb @isaacs Update submodules recursively in make
isaacs authored
33 ! [ -d .git ] || git submodule update --init --recursive
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
34
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
35 latest: submodules
36 @echo "Installing latest published npm"
37 @echo "Use 'make install' or 'make link' to install the code"
38 @echo "in this folder that you're looking at right now."
4325dcc @isaacs fix make latest
isaacs authored
39 node cli.js install -g -f npm
743d387 @isaacs Improve install process.
isaacs authored
40
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
41 install: all
364dfc6 @isaacs Clobber in Makefile
isaacs authored
42 node cli.js install -g -f
743d387 @isaacs Improve install process.
isaacs authored
43
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
44 # backwards compat
45 dev: install
46
db9ee01 @isaacs clean when linking
isaacs authored
47 link: uninstall
364dfc6 @isaacs Clobber in Makefile
isaacs authored
48 node cli.js link -f
e0c6abb @isaacs Add 'clean' make target
isaacs authored
49
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
50 clean: doc-clean uninstall
c7ec9b5 @isaacs No need to clean cache as often, makes search slow
isaacs authored
51 node cli.js cache clean
743d387 @isaacs Improve install process.
isaacs authored
52
0e151fc @isaacs build submodules in make process
isaacs authored
53 uninstall: submodules
94df8f3 @isaacs Support npm_debug env in install script
isaacs authored
54 node cli.js rm npm -g -f
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
55
b337ace @isaacs Update 'make doc' to only ronn build if necessary
isaacs authored
56 doc: $(mandocs) $(htmldocs)
c638e80 @isaacs Add a makefile to build the man page.
isaacs authored
57
64ff08f @isaacs Alias doc-clean and doc-publish to docclean and docpublish
isaacs authored
58 docclean: doc-clean
928bb81 @isaacs Update version in doc
isaacs authored
59 doc-clean:
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
60 rm -rf \
61 node_modules/ronn \
b337ace @isaacs Update 'make doc' to only ronn build if necessary
isaacs authored
62 node_modules/.bin/ronn \
63 .building_ronn \
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
64 doc/cli/index.md \
65 doc/api/index.md \
66 $(api_mandocs) \
67 $(cli_mandocs) \
68 $(api_htmldocs) \
69 $(cli_htmldocs) \
70 &>/dev/null || true
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
71
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
72 # use `npm install ronn` for this to work.
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
73 man/man1/README.1: README.md scripts/doc-build.sh package.json
74 scripts/doc-build.sh $< $@
75
1f67836 @isaacs Makefile: cli docs live in doc/cli/%.md
isaacs authored
76 man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json
88c9df2 @isaacs Depending on a folder is dumb
isaacs authored
77 @[ -d man/man1 ] || mkdir -p man/man1
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
78 scripts/doc-build.sh $< $@
30818ab @isaacs html docs
isaacs authored
79
88c9df2 @isaacs Depending on a folder is dumb
isaacs authored
80 man/man3/%.3: doc/api/%.md scripts/doc-build.sh package.json
81 @[ -d man/man3 ] || mkdir -p man/man3
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
82 scripts/doc-build.sh $< $@
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
83
7ce63c3 @isaacs docs include version
isaacs authored
84 html/doc/README.html: README.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
85 scripts/doc-build.sh $< $@
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
86
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
87 html/doc/%.html: doc/cli/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
88 scripts/doc-build.sh $< $@
89
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
90 html/api/%.html: doc/api/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
91 scripts/doc-build.sh $< $@
92
93 doc/cli/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json
94 node scripts/index-build.js > $@
95
b337ace @isaacs Update 'make doc' to only ronn build if necessary
isaacs authored
96 node_modules/ronn:
97 node cli.js install https://github.com/isaacs/ronnjs/tarball/master
98
5021c4d @isaacs folder structure change
isaacs authored
99 doc: man
dbee5c3 @isaacs Change the way npm help works, so that it will work with man programs th...
isaacs authored
100
cf3d925 @isaacs Correct `make doc` and `make man`
isaacs authored
101 man: $(cli_docs) $(api_docs)
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
102
0e151fc @isaacs build submodules in make process
isaacs authored
103 test: submodules
176f12e @isaacs Move test command into package.json
isaacs authored
104 node cli.js test
90c9ec8 @isaacs Make test (quietly)
isaacs authored
105
5846adf @isaacs version bumper
isaacs authored
106 version: link
4f0d334 @isaacs Less warning, better style
isaacs authored
107 git add package.json &&\
108 git ci -m v$(shell npm -v)
5846adf @isaacs version bumper
isaacs authored
109
110 publish: link
4f0d334 @isaacs Less warning, better style
isaacs authored
111 git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\
7547328 @isaacs Update 'make publish' to push tags to github, too
isaacs authored
112 git push origin master --tags &&\
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
113 npm publish &&\
114 make doc-publish
115
64ff08f @isaacs Alias doc-clean and doc-publish to docclean and docpublish
isaacs authored
116 docpublish: doc-publish
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
117 doc-publish: doc
118 rsync -vazu --stats --no-implied-dirs --delete html/doc/ npmjs.org:/var/www/npmjs.org/public/doc
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
119 rsync -vazu --stats --no-implied-dirs --delete html/api/ npmjs.org:/var/www/npmjs.org/public/api
2d27e74 @isaacs Add a 'publish' make target
isaacs authored
120
64ff08f @isaacs Alias doc-clean and doc-publish to docclean and docpublish
isaacs authored
121 sandwich:
122 @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself"
123
124 .PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish
Something went wrong with that request. Please try again.