프로젝트

일반

사용자정보

통계
| 개정판:

root / HServer / 00.Server / 00.Program / node_modules / npm / Makefile

이력 | 보기 | 이력해설 | 다운로드 (5.16 KB)

1 39 HKM
# vim: set softtabstop=2 shiftwidth=2:
2
SHELL = bash
3
4
PUBLISHTAG = $(shell node scripts/publish-tag.js)
5
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
6
7
markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md
8
9
html_docdeps = html/dochead.html \
10
               html/docfoot.html \
11
               scripts/doc-build.sh \
12
               package.json
13
14
cli_mandocs = $(shell find doc/cli -name '*.md' \
15
               |sed 's|.md|.1|g' \
16
               |sed 's|doc/cli/|man/man1/|g' ) \
17
               man/man1/npm-README.1 \
18
               man/man1/npx.1
19
20
files_mandocs = $(shell find doc/files -name '*.md' \
21
               |sed 's|.md|.5|g' \
22
               |sed 's|doc/files/|man/man5/|g' ) \
23
               man/man5/npm-json.5 \
24
               man/man5/npm-global.5
25
26
misc_mandocs = $(shell find doc/misc -name '*.md' \
27
               |sed 's|.md|.7|g' \
28
               |sed 's|doc/misc/|man/man7/|g' ) \
29
               man/man7/npm-index.7
30
31
cli_htmldocs = $(shell find doc/cli -name '*.md' \
32
                |sed 's|.md|.html|g' \
33
                |sed 's|doc/cli/|html/doc/cli/|g' ) \
34
                html/doc/README.html
35
36
files_htmldocs = $(shell find doc/files -name '*.md' \
37
                  |sed 's|.md|.html|g' \
38
                  |sed 's|doc/files/|html/doc/files/|g' ) \
39
                  html/doc/files/npm-json.html \
40
                  html/doc/files/npm-global.html
41
42
misc_htmldocs = $(shell find doc/misc -name '*.md' \
43
                 |sed 's|.md|.html|g' \
44
                 |sed 's|doc/misc/|html/doc/misc/|g' ) \
45
                 html/doc/index.html
46
47
mandocs = $(cli_mandocs) $(files_mandocs) $(misc_mandocs)
48
49
htmldocs = $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs)
50
51
all: doc
52
53
latest:
54
	@echo "Installing latest published npm"
55
	@echo "Use 'make install' or 'make link' to install the code"
56
	@echo "in this folder that you're looking at right now."
57
	node bin/npm-cli.js install -g -f npm ${NPMOPTS}
58
59
install: all
60
	node bin/npm-cli.js install -g -f ${NPMOPTS} $(shell node bin/npm-cli.js pack | tail -1)
61
62
# backwards compat
63
dev: install
64
65
link: uninstall
66
	node bin/npm-cli.js link -f
67
68
clean: markedclean marked-manclean doc-clean uninstall
69
	rm -rf npmrc
70
	node bin/npm-cli.js cache clean
71
72
uninstall:
73
	node bin/npm-cli.js rm npm -g -f
74
75
doc: $(mandocs) $(htmldocs)
76
77
markedclean:
78
	rm -rf node_modules/marked node_modules/.bin/marked .building_marked
79
80
marked-manclean:
81
	rm -rf node_modules/marked-man node_modules/.bin/marked-man .building_marked-man
82
83
docclean: doc-clean
84
doc-clean:
85
	rm -rf \
86
    .building_marked \
87
    .building_marked-man \
88
    html/doc \
89
    man
90
91
# use `npm install marked-man` for this to work.
92
man/man1/npm-README.1: README.md scripts/doc-build.sh package.json
93
	@[ -d man/man1 ] || mkdir -p man/man1
94
	scripts/doc-build.sh $< $@
95
96
man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json
97
	@[ -d man/man1 ] || mkdir -p man/man1
98
	scripts/doc-build.sh $< $@
99
100
man/man1/npx.1: node_modules/libnpx/libnpx.1
101
	cat $< | sed s/libnpx/npx/ > $@
102
103
man/man5/npm-json.5: man/man5/package.json.5
104
	cp $< $@
105
106
man/man5/npm-global.5: man/man5/npm-folders.5
107
	cp $< $@
108
109
man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json
110
	@[ -d man/man5 ] || mkdir -p man/man5
111
	scripts/doc-build.sh $< $@
112
113
doc/misc/npm-index.md: scripts/index-build.js package.json
114
	node scripts/index-build.js > $@
115
116
html/doc/index.html: doc/misc/npm-index.md $(html_docdeps)
117
	@[ -d html/doc ] || mkdir -p html/doc
118
	scripts/doc-build.sh $< $@
119
120
man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json
121
	@[ -d man/man7 ] || mkdir -p man/man7
122
	scripts/doc-build.sh $< $@
123
124
html/doc/README.html: README.md $(html_docdeps)
125
	@[ -d html/doc ] || mkdir -p html/doc
126
	scripts/doc-build.sh $< $@
127
128
html/doc/cli/%.html: doc/cli/%.md $(html_docdeps)
129
	@[ -d html/doc/cli ] || mkdir -p html/doc/cli
130
	scripts/doc-build.sh $< $@
131
132
html/doc/files/npm-json.html: html/doc/files/package.json.html
133
	cp $< $@
134
135
html/doc/files/npm-global.html: html/doc/files/npm-folders.html
136
	cp $< $@
137
138
html/doc/files/%.html: doc/files/%.md $(html_docdeps)
139
	@[ -d html/doc/files ] || mkdir -p html/doc/files
140
	scripts/doc-build.sh $< $@
141
142
html/doc/misc/%.html: doc/misc/%.md $(html_docdeps)
143
	@[ -d html/doc/misc ] || mkdir -p html/doc/misc
144
	scripts/doc-build.sh $< $@
145
146
147
marked: node_modules/.bin/marked
148
149
node_modules/.bin/marked:
150
	node bin/npm-cli.js install marked --no-global --no-timing --no-save
151
152
marked-man: node_modules/.bin/marked-man
153
154
node_modules/.bin/marked-man:
155
	node bin/npm-cli.js install marked-man --no-global --no-timing --no-save
156
157
doc: man
158
159
man: $(cli_docs)
160
161
test: doc
162
	node bin/npm-cli.js test
163
164
tag:
165
	node bin/npm-cli.js tag npm@$(PUBLISHTAG) latest
166
167
ls-ok:
168
	node . ls >/dev/null
169
170
gitclean:
171
	git clean -fd
172
173
publish: gitclean ls-ok link doc-clean doc
174
	@git push origin :v$(shell node bin/npm-cli.js --no-timing -v) 2>&1 || true
175
	git push origin $(BRANCH) &&\
176
	git push origin --tags &&\
177
	node bin/npm-cli.js publish --tag=$(PUBLISHTAG)
178
179
release: gitclean ls-ok markedclean marked-manclean doc-clean doc
180
	node bin/npm-cli.js prune --production --no-save
181
	@bash scripts/release.sh
182
183
sandwich:
184
	@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13)
185
186
.PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release ls-ok realclean