forked from qgis/QGIS-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (77 loc) · 3.25 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
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
LANG = en
# currently we are building for the following languages, if you want yours to be build: ask!
LANGUAGES = en # bg cs de es fi fr id it ja ko nl pt_BR pt_PT ro ru tr zh_Hant zh_Hans
# for transifex we need other codes for the chinese languages
# a symbolic link is needed to be able to build them
#LANGUAGES = en bg cs de es fi fr id it ja ko nl pt_BR pt_PT ro ru tr zh-Hant zh-Hans
SPHINXOPTS =
SPHINXINTLOPTS = $(SPHINXOPTS) -D language=$(LANG)
SPHINXBUILD ?= sphinx-build
SPHINXINTL ?= sphinx-intl
SOURCEDIR = .
BUILDDIR = build
#SITEDIR = /var/www/html/qgisdocs
SITEDIR = qgis2:/var/www/qgisdata/QGIS-Documentation/live/html
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
springclean:
rm -r $(BUILDDIR)
# all .mo files
find $(SOURCEDIR)/locale/*/LC_MESSAGES/ -type f -name '*.mo' -delete
gettext:
@$(SPHINXBUILD) -M gettext "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# this will build html-version of one language (defaults to english: en)
# to build for example dutch on Linux:
# make LANG=nl html
# on windows:
# set SPHINXOPTS=-D language=nl
# make.bat html
# note that the translations/po files from git will be used
# so if you want most up to date files, download or use 'tx' to get those first
html:
echo "$(SPHINXOPTS) $(SPHINXINTLOPTS)"
if [ $(LANG) != "en" ]; then \
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html/$(LANG)" $(SPHINXINTLOPTS) $(0); \
else \
$(SPHINXBUILD) -b html -nW --keep-going "$(SOURCEDIR)" "$(BUILDDIR)/html/$(LANG)" $(SPHINXOPTS) $(0); \
fi
latex:
$(SPHINXBUILD) -b latex -t latex "$(SOURCEDIR)" "$(BUILDDIR)/latex/$(LANG)" $(SPHINXINTLOPTS) $(0); \
pdf: latex
(cd $(BUILDDIR)/latex/$(LANG); \
pdflatex QGISUserGuide.tex; \
pdflatex QGISUserGuide.tex; \
pdflatex PyQGISDeveloperCookbook.tex; \
pdflatex PyQGISDeveloperCookbook.tex; \
pdflatex QGISTrainingManual.tex; \
pdflatex QGISTrainingManual.tex;)
mkdir -p $(BUILDDIR)/pdf/$(LANG);
mv $(BUILDDIR)/latex/$(LANG)/QGISUserGuide.pdf $(BUILDDIR)/pdf/$(LANG)/;
mv $(BUILDDIR)/latex/$(LANG)/PyQGISDeveloperCookbook.pdf $(BUILDDIR)/pdf/$(LANG)/;
mv $(BUILDDIR)/latex/$(LANG)/QGISTrainingManual.pdf $(BUILDDIR)/pdf/$(LANG)/;
site: html #pdf
rsync -az $(BUILDDIR)/html/$(LANG) $(SITEDIR)/
#rsync -az $(BUILDDIR)/pdf $(SITEDIR)/
# this will build ALL languages, AND tries to rsync them to the web dir on qgis2
# to be able to run this you will need a key on the server
all:
@for LANG in $(LANGUAGES) ; do \
make LANG=$$LANG site; \
done
# this will pull ALL translations (or at least from the languages we build for)
# to your local disk, so it can be committed into github
# in that way a build from git will contain those translation
# tx is the python transifex cli client (pip install transifex-client)
tx_force_pull_translations:
@for LANG in $(LANGUAGES) ; do \
tx pull -f --parallel -l $$LANG ; \
done
doctest:
$(SPHINXBUILD) -b doctest . $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."