forked from lvinsonneau/website
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
188 lines (167 loc) · 6.05 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Makefile for Sphinx documentation
#
# $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/$$lang;
#
# You can set these variables from the command line.
BUILDDIR = _build
SPHINXOPTS =
SPHINXBUILD = ./buildout/bin/sphinx-build
PAPER =
TRANSLATIONS = fr
LANGUAGES = en $(TRANSLATIONS)
# On mapserver.org we need to write alternate links for the language switcher.
# This is triggered by setting TARGET to 'mapserverorg'
# Unsetting or every other value will cause the standard behaviour.
#
#TARGET = mapserverorg
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees/$$lang $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -c . -A language=$$lang -D language=$$lang -A target=$(TARGET) -A languages='$(LANGUAGES)'
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " init to preprocess translation directories"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " all-pdf to make PDF file"
@echo " all-ps to make PS file"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
clean:
-rm -rf $(BUILDDIR)/*
init:
@for lang in $(TRANSLATIONS) ;\
do \
# We change the Internal Field Separator (IFS) because to handle filename with special char like space. \
OLDIFS="$$IFS"; \
IFS=$$'\n'; \
for file in `cd en; find . -type f -a -regex '.*\.rst$$' -a -not -regex '.*\.svn.*' -printf "%p\n" ; cd ..;`; \
do \
if [ ! -f $$lang/$$file ]; then \
mkdir -p `dirname "$$lang/$$file"`; \
(echo ".. meta::"; echo " :ROBOTS: NOINDEX") | cat - "en/$$file" > "$$lang/$$file"; \
fi \
done; \
IFS=$$OLDIFS; \
# Copy all no .rst files \
yes n | cp -ipR en/* $$lang &> /dev/null; \
done
@echo "Init finished. Other target can now be build.";\
html:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/html/$$lang $(BUILDDIR)/doctrees/$$lang; \
echo "$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/html/$$lang";\
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/html/$$lang;\
done
@cp index.html $(BUILDDIR)/html/
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/<language>.";\
singlehtml:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/singlehtml/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/singlehtml/$$lang;\
done
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/singlehtml/<language>.";\
pickle:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/pickle/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/pickle/$$lang;\
done
@echo
@echo "Build finished; now you can process the pickle files."
web: pickle
json:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/json/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/json/$$lang;\
done
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/htmlhelp/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/htmlhelp/$$lang;\
done
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp/<language>."
latex:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/latex/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/latex/$$lang;\
done
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex/<language>."\
@echo "Run \`make all-pdf' or \`make all-ps'"
pdf:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/pdf/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/pdf/$$lang;\
done
@echo
@echo "Build finished; the PDF files are in $(BUILDDIR)/pdf/<language>."\
@echo "Run \`make pdf' "
epub:
@for lang in en;\
do \
mkdir -p $(BUILDDIR)/epub/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/epub/$$lang;\
done
@echo
@echo "Build finished; the epub files are in $(BUILDDIR)/epub/<language>."\
@echo "Run \`make epub' "
all-pdf:
@for lang in $(LANGUAGES);\
do \
/usr/bin/make -C $(BUILDDIR)/latex/$$lang all-pdf ; \
if [ -d $(BUILDDIR)/html/$$lang ]; then \
mv -f $(BUILDDIR)/latex/$$lang/MapServer.pdf $(BUILDDIR)/html/$$lang ; \
fi \
done
all-ps:
@for lang in $(LANGUAGES);\
do \
/usr/bin/make -C $(BUILDDIR)/latex/$$lang all-ps ; \
if [ -d $(BUILDDIR)/html/$$lang ]; then \
mv -f $(BUILDDIR)/latex/$$lang/MapServer.pdf $(BUILDDIR)/html/$$lang ; \
fi \
done
changes:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/changes/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/changes/$$lang;\
done
@echo
@echo "The overview file is in $(BUILDDIR)/changes/<language>."
linkcheck:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/linkcheck/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/linkcheck/$$lang;\
done
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/<language>/output.rst."
labels:
@for lang in $(LANGUAGES);\
do \
mkdir -p $(BUILDDIR)/labels/$$lang $(BUILDDIR)/doctrees/$$lang; \
$(SPHINXBUILD) -b labels $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/labels/$$lang;\
cp $(BUILDDIR)/labels/$$lang/labels.rst $$lang/include/labels.inc;\
done
@echo
@echo "Label generation complete; look for any errors in the above output " \
"or in $(BUILDDIR)/labels/<language>/labels.rst."