-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (77 loc) · 4.26 KB
/
Makefile
File metadata and controls
90 lines (77 loc) · 4.26 KB
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
# makefile for Sphinx documentation
# =================================
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = OpenDroneMap
SOURCEDIR = source
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# this is for testing, it will only build the EN version of the docs
livehtml: autogenerate
sphinx-autobuild --open-browser --host 0.0.0.0 -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/html"
# this will update `arguments.rst` to match arguments in the ODM code
# add any individual file for an argument missing from `source/arguments_edit/`
# update the files in `source/arguments/` including adding in
# all user contributed content from files in `source/arguments_edit/`
autogenerate:
python scripts/extract_odm_strings.py https://raw.githubusercontent.com/OpenDroneMap/ODM/master/opendm/config.py
@$(SPHINXBUILD) -b gettext "$(SOURCEDIR)" "source/locale/pot"
sphinx-intl update --pot-dir "source/locale/pot" --language ar,cs,es,fil,fr,id,sw,te,zh
@$(MAKE) cleanobsolete
# update main EN pot files that serve as the source for translation process
updatepot:
@$(SPHINXBUILD) -b gettext "$(SOURCEDIR)" "source/locale/pot"
# update the po files for each target language from the EN pot files
updatelangpo:
sphinx-intl update --pot-dir "source/locale/pot" --language ar,cs,es,fil,fr,id,sw,te,zh
@$(MAKE) cleanobsolete
# remove obsolete entries from all .po files
cleanobsolete:
@echo "Removing obsolete entries from .po files..."
@for lang in ar cs es fil fr id sw te zh; do \
for po in source/locale/$$lang/LC_MESSAGES/*.po source/locale/$$lang/LC_MESSAGES/*/*.po; do \
if [ -f "$$po" ]; then \
msgattrib --no-obsolete --no-fuzzy -o "$$po.tmp" "$$po" 2>/dev/null && mv "$$po.tmp" "$$po" || rm -f "$$po.tmp"; \
fi; \
done; \
done
@echo "Done cleaning obsolete entries."
# push new and changed strings to Transifex
pushlang:
tx push --source
# push translated strings from Transifex
pulllang:
tx pull --language "ar,cs,es,fil,fr,id,sw,te,zh"
build:
@$(SPHINXBUILD) -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/html" -nW
@$(SPHINXBUILD) -b dirhtml -D language='cs' "$(SOURCEDIR)" "$(BUILDDIR)/html/cs" -nW
@$(SPHINXBUILD) -b dirhtml -D language='es' "$(SOURCEDIR)" "$(BUILDDIR)/html/es" -nW
@$(SPHINXBUILD) -b dirhtml -D language='fil' "$(SOURCEDIR)" "$(BUILDDIR)/html/fil" -nW
@$(SPHINXBUILD) -b dirhtml -D language='fr' "$(SOURCEDIR)" "$(BUILDDIR)/html/fr" -nW
@$(SPHINXBUILD) -b dirhtml -D language='id' "$(SOURCEDIR)" "$(BUILDDIR)/html/id" -nW
@$(SPHINXBUILD) -b dirhtml -D language='sw' "$(SOURCEDIR)" "$(BUILDDIR)/html/sw" -nW
@$(SPHINXBUILD) -b dirhtml -D language='te' "$(SOURCEDIR)" "$(BUILDDIR)/html/te" -nW
@$(SPHINXBUILD) -b dirhtml -D language='zh' "$(SOURCEDIR)" "$(BUILDDIR)/html/zh" -nW
# -n Run in nit-picky mode. Currently, this generates warnings for all missing references.
# -W Turn warnings into errors that stop the build.
# for more details about the options see https://www.sphinx-doc.org/en/1.8/man/sphinx-build.html#options
# `allerr` runs without nit-picky mode, so that an error doesn't halt the build
# it will log all errors that need to be fixed in the translations (generally syntax errors)
allerr:
@$(SPHINXBUILD) -v -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/html"
@$(SPHINXBUILD) -v -b dirhtml -D language='cs' "$(SOURCEDIR)" "$(BUILDDIR)/html/cs"
@$(SPHINXBUILD) -v -b dirhtml -D language='es' "$(SOURCEDIR)" "$(BUILDDIR)/html/es"
@$(SPHINXBUILD) -v -b dirhtml -D language='fil' "$(SOURCEDIR)" "$(BUILDDIR)/html/fil"
@$(SPHINXBUILD) -v -b dirhtml -D language='fr' "$(SOURCEDIR)" "$(BUILDDIR)/html/fr"
@$(SPHINXBUILD) -v -b dirhtml -D language='id' "$(SOURCEDIR)" "$(BUILDDIR)/html/id"
@$(SPHINXBUILD) -v -b dirhtml -D language='sw' "$(SOURCEDIR)" "$(BUILDDIR)/html/sw"
@$(SPHINXBUILD) -v -b dirhtml -D language='te' "$(SOURCEDIR)" "$(BUILDDIR)/html/te"
@$(SPHINXBUILD) -v -b dirhtml -D language='zh' "$(SOURCEDIR)" "$(BUILDDIR)/html/zh"
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)