Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 89 lines (63 sloc) 2.376 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
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
5 mandocs = $(shell find doc -name '*.md' \
6 |grep -v 'index.md' \
7 |sed 's|.md|.1|g' \
8 |sed 's|doc/|man1/|g' ) \
9 man1/README.1 \
10 man1/index.1
0e151fc @isaacs build submodules in make process
isaacs authored
11
30818ab @isaacs html docs
isaacs authored
12 htmldocs = $(shell find doc -name '*.md' \
23b36f1 @isaacs Don't try to double-build/clean index
isaacs authored
13 |grep -v 'index.md' \
14 |sed 's|.md|.html|g' \
15 |sed 's|doc/|html/doc/|g' ) \
16 html/doc/README.html \
17 html/doc/index.html
30818ab @isaacs html docs
isaacs authored
18
de338f9 @isaacs Support subfolders in the man/doc files
isaacs authored
19 doc_subfolders = $(shell find doc -type d \
23b36f1 @isaacs Don't try to double-build/clean index
isaacs authored
20 |sed 's|doc/|man1/|g' )
0e151fc @isaacs build submodules in make process
isaacs authored
21
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
22 all: submodules doc
23
0e151fc @isaacs build submodules in make process
isaacs authored
24 submodules:
007fedb @isaacs Update submodules recursively in make
isaacs authored
25 ! [ -d .git ] || git submodule update --init --recursive
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
26
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
27 latest: submodules
28 @echo "Installing latest published npm"
29 @echo "Use 'make install' or 'make link' to install the code"
30 @echo "in this folder that you're looking at right now."
4325dcc @isaacs fix make latest
isaacs authored
31 node cli.js install -g -f npm
743d387 @isaacs Improve install process.
isaacs authored
32
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
33 install: all
364dfc6 @isaacs Clobber in Makefile
isaacs authored
34 node cli.js install -g -f
743d387 @isaacs Improve install process.
isaacs authored
35
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
36 # backwards compat
37 dev: install
38
db9ee01 @isaacs clean when linking
isaacs authored
39 link: uninstall
364dfc6 @isaacs Clobber in Makefile
isaacs authored
40 node cli.js link -f
e0c6abb @isaacs Add 'clean' make target
isaacs authored
41
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
42 clean: doc-clean uninstall
c7ec9b5 @isaacs No need to clean cache as often, makes search slow
isaacs authored
43 node cli.js cache clean
743d387 @isaacs Improve install process.
isaacs authored
44
0e151fc @isaacs build submodules in make process
isaacs authored
45 uninstall: submodules
94df8f3 @isaacs Support npm_debug env in install script
isaacs authored
46 node cli.js rm npm -g -f
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
47
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
48 doc: node_modules/ronn $(mandocs) $(htmldocs)
c638e80 @isaacs Add a makefile to build the man page.
isaacs authored
49
928bb81 @isaacs Update version in doc
isaacs authored
50 doc-clean:
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
51 rm -rf node_modules/ronn doc/index.md $(mandocs) $(htmldocs) &>/dev/null || true
52
53 node_modules/ronn:
54 node cli.js install git+https://github.com/isaacs/ronnjs.git
928bb81 @isaacs Update version in doc
isaacs authored
55
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
56 # use `npm install ronn` for this to work.
7ce63c3 @isaacs docs include version
isaacs authored
57 man1/README.1: README.md scripts/doc-build.sh package.json
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
58 scripts/doc-build.sh $< $@
30818ab @isaacs html docs
isaacs authored
59
7ce63c3 @isaacs docs include version
isaacs authored
60 man1/%.1: doc/%.md scripts/doc-build.sh package.json
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
61 scripts/doc-build.sh $< $@
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
62
7ce63c3 @isaacs docs include version
isaacs authored
63 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
64 scripts/doc-build.sh $< $@
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
65
7ce63c3 @isaacs docs include version
isaacs authored
66 html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html scripts/doc-build.sh package.json
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
67 scripts/doc-build.sh $< $@
68
7ce63c3 @isaacs docs include version
isaacs authored
69 doc/index.md: $(markdowns) scripts/index-build.js scripts/doc-build.sh package.json
8fdd60d @isaacs Build an index of all html documentation files
isaacs authored
70 node scripts/index-build.js > doc/index.md
71
0e151fc @isaacs build submodules in make process
isaacs authored
72 test: submodules
176f12e @isaacs Move test command into package.json
isaacs authored
73 node cli.js test
90c9ec8 @isaacs Make test (quietly)
isaacs authored
74
5846adf @isaacs version bumper
isaacs authored
75 version: link
4f0d334 @isaacs Less warning, better style
isaacs authored
76 git add package.json &&\
77 git ci -m v$(shell npm -v)
5846adf @isaacs version bumper
isaacs authored
78
79 publish: link
4f0d334 @isaacs Less warning, better style
isaacs authored
80 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
81 git push origin master --tags &&\
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
82 npm publish &&\
83 make doc-publish
84
85 doc-publish: doc
86 rsync -vazu --stats --no-implied-dirs --delete html/doc/ npmjs.org:/var/www/npmjs.org/public/doc
2d27e74 @isaacs Add a 'publish' make target
isaacs authored
87
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
88 .PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean
Something went wrong with that request. Please try again.