-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
44 lines (32 loc) · 1.19 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
# MakeFile for building all the docs at once.
# Inspired by the Makefile used by bazaar.
# http://bazaar.launchpad.net/~bzr-pqm/bzr/2.3/
PYTHON = python
.PHONY: all clean html latexpdf epub htmlhelp
# Languages that can be built.
LANGS = en pt es fr
# Dependencies to perform before running other builds.
SPHINX_DEPENDENCIES = $(foreach lang, $(LANGS), $(lang)/Makefile)
# Copy-paste the english Makefile everwhere its needed.
%/Makefile : en/Makefile
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
#
# The various formats the documentation can be created in.
#
# Loop over the possible languages and call other build targets.
#
html: $(foreach lang, $(LANGS), html-$(lang))
htmlhelp: $(foreach lang, $(LANGS), htmlhelp-$(lang))
epub: $(foreach lang, $(LANGS), epub-$(lang))
latexpdf: $(foreach lang, $(PDF_LANGS), latex-$(lang))
# Make the HTML version of the documentation with correctly nested language folders.
html-%: $(SPHINX_DEPENDENCIES)
cd $* && make html LANG=$*
htmlhelp-%: $(SPHINX_DEPENDENCIES)
cd $* && make htmlhelp LANG=$*
epub-%: $(SPHINX_DEPENDENCIES)
cd $* && make epub LANG=$*
latexpdf-%: $(SPHINX_DEPENDENCIES)
cd $* && make latexpdf LANG=$*
clean:
rm -rf build/*