Michael Merickel
2018-10-19 69ea9e4ad7e11581d724ffe91aa66935a62c06d7
commit | author | age
f70c23 1 # Makefile for Sphinx documentation
CM 2 #
3
4 # You can set these variables from the command line.
c8b363 5 SPHINXOPTS    = -W
f70c23 6 SPHINXBUILD   = sphinx-build
CM 7 PAPER         =
4d8580 8 BUILDDIR      = _build
f70c23 9
CM 10 # Internal variables.
11 PAPEROPT_a4     = -D latex_paper_size=a4
12 PAPEROPT_letter = -D latex_paper_size=letter
4d8580 13 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
f70c23 14
54a218 15 .PHONY: help clean html text web pickle htmlhelp latex latexpdf xelatexpdf changes linkcheck epub doctest
f70c23 16
CM 17 help:
18     @echo "Please use \`make <target>' where <target> is one of"
b5fcc4 19     @echo "  html       to make standalone HTML files"
SP 20     @echo "  text       to make text files"
21     @echo "  pickle     to make pickle files (usable by e.g. sphinx-web)"
22     @echo "  htmlhelp   to make HTML files and a HTML help project"
23     @echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
24     @echo "  latexpdf   to make LaTeX files and run them through pdflatex"
54a218 25     @echo "  xelatexpdf to make LaTeX files and run them through xelatex"
b5fcc4 26     @echo "  changes    to make an overview over all changed/added/deprecated items"
SP 27     @echo "  linkcheck  to check all external links for integrity"
28     @echo "  epub       to make an epub"
29     @echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
f70c23 30
CM 31 clean:
4d8580 32     -rm -rf $(BUILDDIR)/*
f70c23 33
d4be9a 34 xelatexpdf:
SP 35     $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
36     @echo "Running LaTeX files through xelatex..."
37     $(MAKE) PDFLATEX=xelatex -C $(BUILDDIR)/latex all-pdf
38     @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
39
cc443a 40 html:
4d8580 41     mkdir -p $(BUILDDIR)/html $(BUILDDIR)/doctrees
MM 42     $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
f70c23 43     @echo
4d8580 44     @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
f70c23 45
012f0e 46 text:
4d8580 47     mkdir -p $(BUILDDIR)/text $(BUILDDIR)/doctrees
MM 48     $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
012f0e 49     @echo
4d8580 50     @echo "Build finished. The HTML pages are in $(BUILDDIR)/text."
012f0e 51
f70c23 52 pickle:
4d8580 53     mkdir -p $(BUILDDIR)/pickle $(BUILDDIR)/doctrees
MM 54     $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
f70c23 55     @echo
CM 56     @echo "Build finished; now you can process the pickle files or run"
4d8580 57     @echo "  sphinx-web $(BUILDDIR)/pickle"
f70c23 58     @echo "to start the sphinx-web server."
CM 59
60 web: pickle
61
cc443a 62 htmlhelp:
4d8580 63     mkdir -p $(BUILDDIR)/htmlhelp $(BUILDDIR)/doctrees
MM 64     $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
f70c23 65     @echo
CM 66     @echo "Build finished; now you can run HTML Help Workshop with the" \
4d8580 67           ".hhp project file in $(BUILDDIR)/htmlhelp."
f70c23 68
CM 69 latex:
4d8580 70     mkdir -p $(BUILDDIR)/latex $(BUILDDIR)/doctrees
MM 71     $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
72     cp _static/*.png $(BUILDDIR)/latex
451f04 73     ./convert_images.sh
4d8580 74     cp _static/latex-warning.png $(BUILDDIR)/latex
MM 75     cp _static/latex-note.png $(BUILDDIR)/latex
f70c23 76     @echo
4d8580 77     @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
54a218 78     @echo "Run \`make xelatexpdf' to build a PDF file from them."
239485 79
TL 80 latexpdf:
4d8580 81     $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
239485 82     @echo "Running LaTeX files through pdflatex..."
4d8580 83     $(MAKE) -C $(BUILDDIR)/latex all-pdf
MM 84     @echo "pdflatex finished; the PDF file is in $(BUILDDIR)/latex."
f70c23 85
CM 86 changes:
4d8580 87     mkdir -p $(BUILDDIR)/changes $(BUILDDIR)/doctrees
MM 88     $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
f70c23 89     @echo
4d8580 90     @echo "The overview file is in $(BUILDDIR)/changes."
f70c23 91
CM 92 linkcheck:
4d8580 93     mkdir -p $(BUILDDIR)/linkcheck $(BUILDDIR)/doctrees
MM 94     $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
f70c23 95     @echo
CM 96     @echo "Link check complete; look for any errors in the above output " \
4d8580 97           "or in $(BUILDDIR)/linkcheck/output.txt."
92feea 98
CM 99 epub:
4d8580 100     $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
92feea 101     @echo
4d8580 102     @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
54cf7c 103
b5fcc4 104 doctest:
SP 105     $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
106     @echo "Testing of doctests in the sources finished, look at the " \
107           "results in $(BUILDDIR)/doctest/output.txt."