forked from nodejs/nodejs.org-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
114 lines (85 loc) · 2.97 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
VERSION=v`cat STABLE`
NODE_WEBSITE_PORT ?= 8080
REMOTE_SHA = $(shell git ls-remote [email protected]:joyent/node-website.git | awk '/master/ {print $$1}')
LOCAL_SHA = $(shell git rev-parse HEAD)
generated_files1 = $(shell find doc -follow -type f -name \*.md | grep -v /blog/ | xargs)
generated_files = $(addprefix out/,$(patsubst %.md,%.html,$(generated_files1)))
website_dirs = \
out/doc/video \
out/doc/download \
out/doc/logos \
out/doc/images
doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))
website_assets = $(addprefix out/,$(wildcard doc/*.css doc/*.js))
blog_dirs = $(patsubst out/doc/%,out/blog/%,$(website_dirs))
blog_assets = $(patsubst out/doc/%,out/blog/%,$(website_assets))
blog_images = $(patsubst out/doc/%,out/blog/%,$(doc_images))
advisory_board:
rm -rf /tmp/advisory-board
rm -rf ./doc/advisory-board
mkdir ./doc/advisory-board
git clone https://github.com/joyent/nodejs-advisory-board.git /tmp/advisory-board
mv /tmp/advisory-board/meetings/* ./doc/advisory-board
website_files = \
out/doc/index.html \
out/doc/v0.4_announcement.html \
out/doc/sh_main.js \
out/doc/sh_javascript.min.js \
out/doc/sh_vim-dark.css \
out/doc/sh.css \
out/doc/favicon.ico \
out/doc/pipe.css \
out/doc/video/index.html \
out/doc/download/index.html \
$(generated_files) \
$(doc_images) \
$(website_assets)
blog_files = \
$(blog_assets) \
$(blog_images)
doc: website blog
blogclean:
rm -rf out/blog
blog: doc/blog tools/blog $(blog_dirs) $(blog_files)
node tools/blog/generate.js doc/blog/ out/blog/ doc/blog.html doc/rss.xml
website: $(website_dirs) $(website_files)
echo "Make sure to clone the advisory-board repository into doc/advisory-board (tip: use make advisory_board)."
stat doc/advisory-board > /dev/null
out/doc/%.html: doc/%.md
mkdir -p $(shell dirname $@)
node tools/doc/generate.js --format=html --template=doc/website.html $< > $@
$(website_dirs):
mkdir -p $@
$(blog_dirs):
mkdir -p $@
out/doc/%.html: doc/%.html
cat $< | sed -e 's|__VERSION__|'$(VERSION)'|g' > $@
out/doc/main.js: doc/main.js
cat $< | sed -e 's|__VERSION__|'$(VERSION)'|g' > $@
out/doc/%: doc/%
cp -r $< $@
out/blog/%: doc/%
cp -r $< $@
blog-upload: blog
rsync -r out/blog/ [email protected]:~/web/nodejs.org/blog/
website-upload: doc
rsync -r out/doc/ [email protected]:~/web/nodejs.org/
release: predeploycheck clean website-upload blog-upload
rsync -r out/doc/ [email protected]:~/web/nodejs.org/dist/$(VERSION)/docs/
docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
docclean:
-rm -rf out/doc
predeploycheck:
ifneq ($(REMOTE_SHA),$(LOCAL_SHA))
@echo "remote repository and local repository not up to date... please pull latest master"
exit 1
endif
test: doc
open http://localhost:${NODE_WEBSITE_PORT}
node tools/server/server.js
test-blog: blog
open http://localhost:${NODE_WEBSITE_PORT}
node tools/server/server.js blog
clean: docclean blogclean
.PHONY: clean docopen docclean doc all website-upload blog blogclean predeploycheck