Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 247 lines (176 sloc) 7.252 kB
2c9dede @isaacs makefile: spacing
isaacs authored
1 # vim: set softtabstop=2 shiftwidth=2:
64b4d65 explicitly set bash as the shell since the makefile uses bash-isms
gflarity authored
2 SHELL = bash
3
27c4bb6 @isaacs Publish with --tag=v1.4-next
isaacs authored
4 PUBLISHTAG = $(shell node scripts/publish-tag.js)
5abce1b @othiym23 build: explicitly push to a branch
othiym23 authored
5 BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
27c4bb6 @isaacs Publish with --tag=v1.4-next
isaacs authored
6
cc34185 @isaacs doc/index.md depends on readme
isaacs authored
7 markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md
8fdd60d @isaacs Build an index of all html documentation files
isaacs authored
8
fb35715 @isaacs doc: Build index and readme html properly
isaacs authored
9 html_docdeps = html/dochead.html \
2c9dede @isaacs makefile: spacing
isaacs authored
10 html/docfoot.html \
11 scripts/doc-build.sh \
12 package.json
fb35715 @isaacs doc: Build index and readme html properly
isaacs authored
13
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
14 cli_mandocs = $(shell find doc/cli -name '*.md' \
15 |sed 's|.md|.1|g' \
16 |sed 's|doc/cli/|man/man1/|g' ) \
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
17 man/man1/npm-README.1
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
18
19 api_mandocs = $(shell find doc/api -name '*.md' \
20 |sed 's|.md|.3|g' \
21 |sed 's|doc/api/|man/man3/|g' )
22
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
23 files_mandocs = $(shell find doc/files -name '*.md' \
24 |sed 's|.md|.5|g' \
2feda6a @isaacs doc: Build legacy json/global docs
isaacs authored
25 |sed 's|doc/files/|man/man5/|g' ) \
2c9dede @isaacs makefile: spacing
isaacs authored
26 man/man5/npm-json.5 \
27 man/man5/npm-global.5
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
28
29 misc_mandocs = $(shell find doc/misc -name '*.md' \
30 |sed 's|.md|.7|g' \
fb35715 @isaacs doc: Build index and readme html properly
isaacs authored
31 |sed 's|doc/misc/|man/man7/|g' ) \
a4c9bab @isaacs Avoid doc collisions on npm version upgrade
isaacs authored
32 man/man7/npm-index.7
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
33
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
34
35 cli_partdocs = $(shell find doc/cli -name '*.md' \
36 |sed 's|.md|.html|g' \
37 |sed 's|doc/cli/|html/partial/doc/cli/|g' ) \
38 html/partial/doc/README.html
39
40 api_partdocs = $(shell find doc/api -name '*.md' \
41 |sed 's|.md|.html|g' \
42 |sed 's|doc/api/|html/partial/doc/api/|g' )
43
44 files_partdocs = $(shell find doc/files -name '*.md' \
45 |sed 's|.md|.html|g' \
46 |sed 's|doc/files/|html/partial/doc/files/|g' ) \
47 html/partial/doc/files/npm-json.html \
48 html/partial/doc/files/npm-global.html
49
50 misc_partdocs = $(shell find doc/misc -name '*.md' \
51 |sed 's|.md|.html|g' \
52 |sed 's|doc/misc/|html/partial/doc/misc/|g' ) \
53 html/partial/doc/index.html
54
55
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
56 cli_htmldocs = $(shell find doc/cli -name '*.md' \
57 |sed 's|.md|.html|g' \
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
58 |sed 's|doc/cli/|html/doc/cli/|g' ) \
59 html/doc/README.html
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
60
61 api_htmldocs = $(shell find doc/api -name '*.md' \
62 |sed 's|.md|.html|g' \
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
63 |sed 's|doc/api/|html/doc/api/|g' )
64
65 files_htmldocs = $(shell find doc/files -name '*.md' \
66 |sed 's|.md|.html|g' \
2feda6a @isaacs doc: Build legacy json/global docs
isaacs authored
67 |sed 's|doc/files/|html/doc/files/|g' ) \
2c9dede @isaacs makefile: spacing
isaacs authored
68 html/doc/files/npm-json.html \
69 html/doc/files/npm-global.html
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
70
71 misc_htmldocs = $(shell find doc/misc -name '*.md' \
72 |sed 's|.md|.html|g' \
fb35715 @isaacs doc: Build index and readme html properly
isaacs authored
73 |sed 's|doc/misc/|html/doc/misc/|g' ) \
2c9dede @isaacs makefile: spacing
isaacs authored
74 html/doc/index.html
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
75
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
76 mandocs = $(api_mandocs) $(cli_mandocs) $(files_mandocs) $(misc_mandocs)
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
77
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
78 partdocs = $(api_partdocs) $(cli_partdocs) $(files_partdocs) $(misc_partdocs)
79
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
80 htmldocs = $(api_htmldocs) $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs)
0e151fc @isaacs build submodules in make process
isaacs authored
81
d8799b9 @isaacs update makefile for submodule removal
isaacs authored
82 all: doc
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
83
d8799b9 @isaacs update makefile for submodule removal
isaacs authored
84 latest:
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
85 @echo "Installing latest published npm"
86 @echo "Use 'make install' or 'make link' to install the code"
87 @echo "in this folder that you're looking at right now."
eeff04d @aredridel Add an NPMOPTS variable to toplevel install
aredridel authored
88 node cli.js install -g -f npm ${NPMOPTS}
743d387 @isaacs Improve install process.
isaacs authored
89
a8da8d6 @isaacs write builtin config on any global npm install
isaacs authored
90 install: all
eeff04d @aredridel Add an NPMOPTS variable to toplevel install
aredridel authored
91 node cli.js install -g -f ${NPMOPTS}
743d387 @isaacs Improve install process.
isaacs authored
92
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
93 # backwards compat
94 dev: install
95
db9ee01 @isaacs clean when linking
isaacs authored
96 link: uninstall
364dfc6 @isaacs Clobber in Makefile
isaacs authored
97 node cli.js link -f
e0c6abb @isaacs Add 'clean' make target
isaacs authored
98
ab8dd87 @isaacs s/ronn/marked-man/g
isaacs authored
99 clean: markedclean marked-manclean doc-clean uninstall
0a7e6b5 @isaacs the tests require docs to be made already
isaacs authored
100 rm -rf npmrc
c7ec9b5 @isaacs No need to clean cache as often, makes search slow
isaacs authored
101 node cli.js cache clean
743d387 @isaacs Improve install process.
isaacs authored
102
d8799b9 @isaacs update makefile for submodule removal
isaacs authored
103 uninstall:
94df8f3 @isaacs Support npm_debug env in install script
isaacs authored
104 node cli.js rm npm -g -f
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
105
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
106 doc: $(mandocs) $(htmldocs) $(partdocs)
c638e80 @isaacs Add a makefile to build the man page.
isaacs authored
107
28d6217 @GeJ Allow to build all the docs OOTB.
GeJ authored
108 markedclean:
109 rm -rf node_modules/marked node_modules/.bin/marked .building_marked
110
ab8dd87 @isaacs s/ronn/marked-man/g
isaacs authored
111 marked-manclean:
112 rm -rf node_modules/marked-man node_modules/.bin/marked-man .building_marked-man
a4c9bab @isaacs Avoid doc collisions on npm version upgrade
isaacs authored
113
64ff08f @isaacs Alias doc-clean and doc-publish to docclean and docpublish
isaacs authored
114 docclean: doc-clean
928bb81 @isaacs Update version in doc
isaacs authored
115 doc-clean:
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
116 rm -rf \
28d6217 @GeJ Allow to build all the docs OOTB.
GeJ authored
117 .building_marked \
ab8dd87 @isaacs s/ronn/marked-man/g
isaacs authored
118 .building_marked-man \
2c9dede @isaacs makefile: spacing
isaacs authored
119 html/doc \
6306d16 @isaacs doc: Fix links on legacy html docs
isaacs authored
120 html/api \
a4c9bab @isaacs Avoid doc collisions on npm version upgrade
isaacs authored
121 man
205a056 @isaacs Close #1445 'make' should build docs as well
isaacs authored
122
ab8dd87 @isaacs s/ronn/marked-man/g
isaacs authored
123 # use `npm install marked-man` for this to work.
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
124 man/man1/npm-README.1: README.md scripts/doc-build.sh package.json
125 @[ -d man/man1 ] || mkdir -p man/man1
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
126 scripts/doc-build.sh $< $@
127
1f67836 @isaacs Makefile: cli docs live in doc/cli/%.md
isaacs authored
128 man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json
88c9df2 @isaacs Depending on a folder is dumb
isaacs authored
129 @[ -d man/man1 ] || mkdir -p man/man1
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
130 scripts/doc-build.sh $< $@
30818ab @isaacs html docs
isaacs authored
131
88c9df2 @isaacs Depending on a folder is dumb
isaacs authored
132 man/man3/%.3: doc/api/%.md scripts/doc-build.sh package.json
133 @[ -d man/man3 ] || mkdir -p man/man3
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
134 scripts/doc-build.sh $< $@
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
135
2feda6a @isaacs doc: Build legacy json/global docs
isaacs authored
136 man/man5/npm-json.5: man/man5/package.json.5
137 cp $< $@
138
139 man/man5/npm-global.5: man/man5/npm-folders.5
140 cp $< $@
141
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
142 man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json
143 @[ -d man/man5 ] || mkdir -p man/man5
144 scripts/doc-build.sh $< $@
145
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
146 man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json
147 @[ -d man/man7 ] || mkdir -p man/man7
148 scripts/doc-build.sh $< $@
149
150
9120644 @isaacs doc: Build index as 'npm-index.md'
isaacs authored
151 doc/misc/npm-index.md: scripts/index-build.js package.json
fb35715 @isaacs doc: Build index and readme html properly
isaacs authored
152 node scripts/index-build.js > $@
153
154
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
155 # html/doc depends on html/partial/doc
156 html/doc/%.html: html/partial/doc/%.html
157 @[ -d html/doc ] || mkdir -p html/doc
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
158 scripts/doc-build.sh $< $@
159
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
160 html/doc/README.html: html/partial/doc/README.html
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
161 @[ -d html/doc ] || mkdir -p html/doc
162 scripts/doc-build.sh $< $@
163
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
164 html/doc/cli/%.html: html/partial/doc/cli/%.html
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
165 @[ -d html/doc/cli ] || mkdir -p html/doc/cli
166 scripts/doc-build.sh $< $@
167
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
168 html/doc/misc/%.html: html/partial/doc/misc/%.html
169 @[ -d html/doc/misc ] || mkdir -p html/doc/misc
170 scripts/doc-build.sh $< $@
171
172 html/doc/files/%.html: html/partial/doc/files/%.html
173 @[ -d html/doc/files ] || mkdir -p html/doc/files
174 scripts/doc-build.sh $< $@
175
176 html/doc/api/%.html: html/partial/doc/api/%.html
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
177 @[ -d html/doc/api ] || mkdir -p html/doc/api
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
178 scripts/doc-build.sh $< $@
2feda6a @isaacs doc: Build legacy json/global docs
isaacs authored
179
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
180
181 html/partial/doc/index.html: doc/misc/npm-index.md $(html_docdeps)
182 @[ -d html/partial/doc ] || mkdir -p html/partial/doc
183 scripts/doc-build.sh $< $@
184
185 html/partial/doc/README.html: README.md $(html_docdeps)
186 @[ -d html/partial/doc ] || mkdir -p html/partial/doc
187 scripts/doc-build.sh $< $@
188
189 html/partial/doc/cli/%.html: doc/cli/%.md $(html_docdeps)
190 @[ -d html/partial/doc/cli ] || mkdir -p html/partial/doc/cli
191 scripts/doc-build.sh $< $@
192
193 html/partial/doc/api/%.html: doc/api/%.md $(html_docdeps)
194 @[ -d html/partial/doc/api ] || mkdir -p html/partial/doc/api
195 scripts/doc-build.sh $< $@
196
197 html/partial/doc/files/npm-json.html: html/partial/doc/files/package.json.html
2feda6a @isaacs doc: Build legacy json/global docs
isaacs authored
198 cp $< $@
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
199 html/partial/doc/files/npm-global.html: html/partial/doc/files/npm-folders.html
2feda6a @isaacs doc: Build legacy json/global docs
isaacs authored
200 cp $< $@
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
201
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
202 html/partial/doc/files/%.html: doc/files/%.md $(html_docdeps)
203 @[ -d html/partial/doc/files ] || mkdir -p html/partial/doc/files
bf46460 @isaacs Abstract doc building to a separate script
isaacs authored
204 scripts/doc-build.sh $< $@
205
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
206 html/partial/doc/misc/%.html: doc/misc/%.md $(html_docdeps)
207 @[ -d html/partial/doc/misc ] || mkdir -p html/partial/doc/misc
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
208 scripts/doc-build.sh $< $@
209
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
210
8b58ad0 @isaacs doc: build partial html content as well as full-baked pages
isaacs authored
211
212
28d6217 @GeJ Allow to build all the docs OOTB.
GeJ authored
213 marked: node_modules/.bin/marked
214
215 node_modules/.bin/marked:
216 node cli.js install marked --no-global
f031bd8 @isaacs doc: build sections 5 and 7
isaacs authored
217
ab8dd87 @isaacs s/ronn/marked-man/g
isaacs authored
218 marked-man: node_modules/.bin/marked-man
308dd42 @isaacs Merge branch 'api-doc' into api-doc2
isaacs authored
219
ab8dd87 @isaacs s/ronn/marked-man/g
isaacs authored
220 node_modules/.bin/marked-man:
221 node cli.js install marked-man --no-global
b337ace @isaacs Update 'make doc' to only ronn build if necessary
isaacs authored
222
5021c4d @isaacs folder structure change
isaacs authored
223 doc: man
dbee5c3 @isaacs Change the way npm help works, so that it will work with man programs…
isaacs authored
224
cf3d925 @isaacs Correct `make doc` and `make man`
isaacs authored
225 man: $(cli_docs) $(api_docs)
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
226
0a7e6b5 @isaacs the tests require docs to be made already
isaacs authored
227 test: doc
176f12e @isaacs Move test command into package.json
isaacs authored
228 node cli.js test
90c9ec8 @isaacs Make test (quietly)
isaacs authored
229
b6bb746 @isaacs Add 'make tag' to tag current release as latest
isaacs authored
230 tag:
231 npm tag npm@$(PUBLISHTAG) latest
232
b499806 @othiym23 doc: use a preversion script to update AUTHORS
othiym23 authored
233 publish: link doc
df5b2cf @isaacs Makefile: git push on publish
isaacs authored
234 @git push origin :v$(shell npm -v) 2>&1 || true
235 git clean -fd &&\
5abce1b @othiym23 build: explicitly push to a branch
othiym23 authored
236 git push origin $(BRANCH) &&\
a7552f6 @isaacs don't always try to push to master. just push to origin
isaacs authored
237 git push origin --tags &&\
27c4bb6 @isaacs Publish with --tag=v1.4-next
isaacs authored
238 npm publish --tag=$(PUBLISHTAG)
2d27e74 @isaacs Add a 'publish' make target
isaacs authored
239
ccf2f4e @isaacs A script for building a release
isaacs authored
240 release:
241 @bash scripts/release.sh
242
64ff08f @isaacs Alias doc-clean and doc-publish to docclean and docpublish
isaacs authored
243 sandwich:
0490394 @isaacs minor makefile fixup
isaacs authored
244 @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13)
64ff08f @isaacs Alias doc-clean and doc-publish to docclean and docpublish
isaacs authored
245
b499806 @othiym23 doc: use a preversion script to update AUTHORS
othiym23 authored
246 .PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release
Something went wrong with that request. Please try again.