-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
161 lines (123 loc) · 3.89 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
all: jekyll
.PHONY: all core c r python jekyll devserver
# Default doc version
CVERSION?=0.10.15
RVERSION?=1.3.5
PYVERSION?=0.10.1
# Available versions
CVERSIONS ?= '0.9.0 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 0.9.10 0.10.0 0.10.1 0.10.2 0.10.3 0.10.4 0.10.5 0.10.6 0.10.7 0.10.8 0.10.9 0.10.10 0.10.11 0.10.12 0.10.13 0.10.15 master develop'
RVERSIONS ?= '1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5'
PYVERSIONS ?= '0.9.6 0.9.7 0.9.8 0.9.9 0.9.10 0.9.11 0.10.0 0.10.1'
PYCVERSIONS ?= '0.9.4 0.9.4 0.9.4 0.9.6 0.9.8 0.9.9 0.10.0 0.10.1'
# FIXME: this is broken now
# optional variable so we can update the C docs without making a release
# CCOMMITHASH?=8bca587ad
CREPO=https://github.com/igraph/igraph
RREPO=https://github.com/igraph/rigraph
PYREPO=https://github.com/igraph/python-igraph
######################################################################
## C stuff
C=_build/c
clean_c:
rm -rf c/html c/pdf c/stamp
rm -rf $(C)
update_c:
rm -rf c/stamp $(C)/build/doc/stamp $(C)/stamp
$(MAKE) c
c: core c/stamp
c/stamp: $(C)/build/doc/stamp
mkdir -p c/pre
python3 _tools/c_postprocess_html.py $(C)/build/doc/html c/html $(CVERSIONS) $(CVERSION)
cp -r $(C)/build/doc/pdf c/
touch $@
$(C)/build/doc/stamp: $(C)/stamp
_tools/c_build_versioned.sh $(C) $(CVERSIONS)
touch $@
$(C)/stamp:
mkdir -p $(C)
# Clone repo if not present, fetch updates if it is present
if [ ! -d $(C)/.git ]; then \
cd $(C) && \
git clone $(CREPO) .; \
else \
cd $(C) && \
git fetch; \
fi
touch $@
######################################################################
## R stuff
R=_build/r
clean_r:
rm -rf r/pre r/html r/pdf
rm -rf $(R)
update_r:
rm -rf r/stamp $(R)/stamp
$(MAKE) r
r: core r/stamp
r/stamp: $(R)/stamp
mkdir -p r/pre
cp -r $(R)/build/doc/html/* r/pre/
cp -r $(R)/build/doc/pdf r/
mkdir -p r/html
_tools/r_postprocess_html.sh r/pre r/html $(RVERSION)
rm -rf r/pre
touch r/stamp
$(R)/stamp:
mkdir -p $(R)
_tools/r_build_versioned.sh $(R) $(RVERSIONS) $(RVERSION)
touch $@
######################################################################
## Python stuff
PY_ARCHFLAGS=-Wno-error=unused-command-line-argument -Wno-error=unused-but-set-variable
PY=_build/python
clean_python:
rm -rf python/api
rm -rf python/tutorial
rm -rf $(PY)
update_python:
rm -rf python/stamp $(PY)/stamp
$(MAKE) python
python: core python/stamp
python/stamp: $(PY)/stamp
export ARCHFLAGS="$(PY_ARCHFLAGS)" && _tools/py_build_versioned.sh $(PY) $(PYVERSIONS) $(PYCVERSIONS)
_tools/py_postprocess_html.py $(PY) $(PYVERSIONS)
touch $@
$(PY)/stamp:
mkdir -p $(PY)
# Clone repo if not present, fetch updates if it is present
if [ ! -d $(PY)/.git ]; then \
cd $(PY) && \
git clone $(PYREPO) . && \
git submodule update --init; \
else \
cd $(PY) && \
git fetch; \
fi
# Make virtual environment if not present
if [ ! -d $(PY)/.venv ]; then \
cd $(PY) && \
python3 -m venv .venv && \
.venv/bin/pip install epydoc matplotlib pydoctor wheel Sphinx sphinxbootstrap4theme; \
fi
touch $@
######################################################################
## Core stuff
HTML= index.html news.html code-of-conduct.html \
_layouts/default.html _layouts/r-manual.html _layouts/c-manual.html \
c/index.html r/index.html
CSS= css/affix.css css/manual.css css/other.css fonts/fonts.css
POSTS= $(wildcard _posts/*)
core: $(HTML) $(CSS) $(POSTS) vendor/bundle
printf "$(CVERSION)" > _includes/igraph-cversion
printf "$(RVERSION)" > _includes/igraph-rversion
printf "$(PYVERSION)" > _includes/igraph-pyversion
printf "$(CVERSIONS)" | tr -d "'" > _includes/igraph-cversions
printf "$(RVERSIONS)" | tr -d "'" > _includes/igraph-rversions
printf "$(PYVERSIONS)" | tr -d "'" > _includes/igraph-pyversions
jekyll: core c r python
bundle exec jekyll build
devserver: core c r python
bundle exec jekyll serve
vendor/bundle:
bundle config set --local path 'vendor/bundle'
bundle install