1
# Makefile for Sphinx documentation
3
# You can set these variables from the command line.
5
SPHINXBUILD = sphinx-build
9
# Custom rules used by top level make
10
MANGOAL:= $(BUILDDIR)/man/.dirstamp
11
HTMLGOAL:= $(BUILDDIR)/html/.dirstamp
13
.PHONY: all distclean distcheck maintainer-clean check test
14
all: $(MANGOAL) $(HTMLGOAL)
16
maintainer-clean distclean: clean
18
distcheck check distdir:
20
RST_FILES= $(shell find source -type f -name '*.rst')
27
SOURCES+= $(RST_FILES)
28
SOURCES+= source/conf.py
31
$(MANGOAL): $(SOURCES)
32
@$(MAKE) $(AM_MAKEFLAGS) man
35
$(HTMLGOAL): $(SOURCES)
36
@$(MAKE) $(AM_MAKEFLAGS) html
39
# User-friendly check for sphinx-build
40
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
41
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
45
PAPEROPT_a4 = -D latex_paper_size=a4
46
PAPEROPT_letter = -D latex_paper_size=letter
47
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
48
# the i18n builder cannot share the environment and doctrees with the others
49
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
51
.PHONY: help clean dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text changes linkcheck doctest gettext
54
@echo "Please use \`make <target>' where <target> is one of"
55
@echo " html to make standalone HTML files"
56
@echo " dirhtml to make HTML files named index.html in directories"
57
@echo " singlehtml to make a single large HTML file"
58
@echo " pickle to make pickle files"
59
@echo " json to make JSON files"
60
@echo " htmlhelp to make HTML files and a HTML help project"
61
@echo " qthelp to make HTML files and a qthelp project"
62
@echo " devhelp to make HTML files and a Devhelp project"
63
@echo " epub to make an epub"
64
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
65
@echo " latexpdf to make LaTeX files and run them through pdflatex"
66
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
67
@echo " text to make text files"
68
@echo " man to make manual pages"
69
@echo " texinfo to make Texinfo files"
70
@echo " info to make Texinfo files and run them through makeinfo"
71
@echo " gettext to make PO message catalogs"
72
@echo " changes to make an overview of all changed/added/deprecated items"
73
@echo " xml to make Docutils-native XML files"
74
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
75
@echo " linkcheck to check all external links for integrity"
76
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
79
@$(RM) -r $(BUILDDIR)/*
82
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
85
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
87
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
90
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
92
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
95
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
98
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
100
@echo "Build finished; now you can process the JSON files."
103
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
105
@echo "Build finished; now you can run HTML Help Workshop with the" \
106
".hhp project file in $(BUILDDIR)/htmlhelp."
109
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
111
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
112
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
113
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/gearmand.qhcp"
114
@echo "To view the help file:"
115
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/gearmand.qhc"
118
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
120
@echo "Build finished."
121
@echo "To view the help file:"
122
@echo "# mkdir -p $$HOME/.local/share/devhelp/gearmand"
123
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/gearmand"
127
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
129
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
132
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
134
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
135
@echo "Run \`make' in that directory to run these through (pdf)latex" \
136
"(use \`make latexpdf' here to do that automatically)."
139
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140
@echo "Running LaTeX files through pdflatex..."
141
$(MAKE) -C $(BUILDDIR)/latex all-pdf
142
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
145
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
146
@echo "Running LaTeX files through platex and dvipdfmx..."
147
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
148
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
151
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
153
@echo "Build finished. The text files are in $(BUILDDIR)/text."
156
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
159
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
161
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
162
@echo "Run \`make' in that directory to run these through makeinfo" \
163
"(use \`make info' here to do that automatically)."
166
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
167
@echo "Running Texinfo files through makeinfo..."
168
make -C $(BUILDDIR)/texinfo info
169
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
172
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
174
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
177
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
179
@echo "The overview file is in $(BUILDDIR)/changes."
182
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
184
@echo "Link check complete; look for any errors in the above output " \
185
"or in $(BUILDDIR)/linkcheck/output.txt."
188
@$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
189
@echo "Testing of doctests in the sources finished, look at the " \
190
"results in $(BUILDDIR)/doctest/output.txt."
193
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
195
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
198
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
200
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."