-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
60 lines (39 loc) · 1.49 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
# reorg.github.com -- html pages generation
VERSIONS = 1.1 1.2 1.3 1.4 1.5
VERSIONS_JP = 1.3 1.4
PIP = env/bin/pip
VIRTUALENV = python3 -m venv
CSS = sm/master/doc/style.css
RST2HTML = env/bin/rst2html.py
RSTOPTS = --template=template.txt --stylesheet-path=$(CSS),html4css1.css --initial-header-level=2
ADDVERSION = tools/addversion.py
SM = sm/1.1 sm/1.2 sm/1.3 sm/1.4 sm/master
HTML_EN = pg_repack/index.html $(patsubst %,pg_repack/%/index.html,$(VERSIONS))
HTML_JP = pg_repack/jp/index.html $(patsubst %,pg_repack/%/jp/index.html,$(VERSIONS_JP))
HTML = $(HTML_EN) $(HTML_JP)
HTMLSUPP = $(CSS) $(RST2HTML) $(ADDVERSION)
all: html
sm: $(SM)
html: $(HTML)
sm/master: FORCE
cd $@ && git fetch && git reset --hard origin/master
sm/?.?: FORCE
cd $@ && git fetch && git reset --hard origin/maint_`basename $@`
pg_repack/index.html: sm/master/doc/pg_repack.rst $(HTMLSUPP)
mkdir -p `dirname $@`
$(ADDVERSION) $< | $(RST2HTML) $(RSTOPTS) > $@
pg_repack/%/index.html: sm/%/doc/pg_repack.rst $(HTMLSUPP)
mkdir -p `dirname $@`
$(ADDVERSION) $< | $(RST2HTML) $(RSTOPTS) > $@
pg_repack/jp/index.html: sm/master/doc/pg_repack_jp.rst $(HTMLSUPP)
mkdir -p `dirname $@`
$(ADDVERSION) $< | $(RST2HTML) $(RSTOPTS) > $@
pg_repack/%/jp/index.html: sm/%/doc/pg_repack_jp.rst $(HTMLSUPP)
mkdir -p `dirname $@`
$(ADDVERSION) $< | $(RST2HTML) $(RSTOPTS) > $@
$(RST2HTML): requirements.txt $(PIP)
$(PIP) install -U -r requirements.txt
env/bin/pip:
$(VIRTUALENV) env
# .PHONY doesn't seem to work with vpath rules?
FORCE: