| 1 |
# Makefile for Sphinx documentation |
| 2 |
# |
| 3 |
|
| 4 |
# You can set these variables from the command line. |
| 5 |
SPHINXOPTS = |
| 6 |
SPHINXBUILD = sphinx-build |
| 7 |
PAPER = |
| 8 |
SRCDIR = source |
| 9 |
BUILDDIR = build |
| 10 |
PYTHON = python3 |
| 11 |
|
| 12 |
# Internal variables. |
| 13 |
PAPEROPT_a4 = -D latex_paper_size=a4 |
| 14 |
PAPEROPT_letter = -D latex_paper_size=letter |
| 15 |
ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR) |
| 16 |
|
| 17 |
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck api |
| 18 |
|
| 19 |
default: html |
| 20 |
|
| 21 |
help: |
| 22 |
@echo "Please use \`make <target>' where <target> is one of" |
| 23 |
@echo " html standalone HTML files" |
| 24 |
@echo " html_noapi same as above, without the time consuming API docs" |
| 25 |
@echo " pickle pickle files (usable by e.g. sphinx-web)" |
| 26 |
@echo " htmlhelp HTML files and a HTML help project" |
| 27 |
@echo " latex LaTeX files, you can set PAPER=a4 or PAPER=letter" |
| 28 |
@echo " texinfo Texinfo files" |
| 29 |
@echo " info Texinfo files and run them through makeinfo" |
| 30 |
@echo " changes an overview over all changed/added/deprecated items" |
| 31 |
@echo " linkcheck check all external links for integrity (takes a long time)" |
| 32 |
@echo |
| 33 |
@echo "Compound utility targets:" |
| 34 |
@echo "pdf latex and then runs the PDF generation" |
| 35 |
@echo "all html and pdf" |
| 36 |
@echo "dist all, and then puts the results in dist/" |
| 37 |
|
| 38 |
clean_api: |
| 39 |
-rm -rf $(SRCDIR)/api/generated |
| 40 |
|
| 41 |
clean: clean_api |
| 42 |
-rm -rf build/* dist/* |
| 43 |
-rm -f $(SRCDIR)/config/options/config-generated.txt |
| 44 |
-rm -f $(SRCDIR)/config/shortcuts/*.csv |
| 45 |
-rm -f $(SRCDIR)/interactive/magics-generated.txt |
| 46 |
|
| 47 |
pdf: latex |
| 48 |
cd build/latex && make all-pdf |
| 49 |
|
| 50 |
all: html pdf |
| 51 |
|
| 52 |
# For final distribution, only build HTML (our pdf is now so large as to be |
| 53 |
# unusable, takes forever to build and just bloats the downloads). We leave |
| 54 |
# them hardlinked at the top-level so users find them easily, though the |
| 55 |
# original build/html dir is left in-place (useful to reload builds while |
| 56 |
# testing). |
| 57 |
dist: html |
| 58 |
rm -rf html |
| 59 |
cp -al build/html . |
| 60 |
@echo "Build finished. Final docs are in html/" |
| 61 |
|
| 62 |
html: api autoconfig automagic autogen_shortcuts |
| 63 |
html_noapi: clean_api autoconfig automagic autogen_shortcuts |
| 64 |
|
| 65 |
html html_noapi: |
| 66 |
mkdir -p build/html build/doctrees |
| 67 |
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html |
| 68 |
@echo |
| 69 |
@echo "Build finished. The HTML pages are in build/html." |
| 70 |
|
| 71 |
automagic: source/interactive/magics-generated.txt |
| 72 |
|
| 73 |
source/interactive/magics-generated.txt: autogen_magics.py |
| 74 |
$(PYTHON) autogen_magics.py |
| 75 |
@echo "Created docs for line & cell magics" |
| 76 |
|
| 77 |
autoconfig: source/config/options/config-generated.txt |
| 78 |
|
| 79 |
source/config/options/config-generated.txt: autogen_config.py |
| 80 |
$(PYTHON) autogen_config.py |
| 81 |
@echo "Created docs for config options" |
| 82 |
|
| 83 |
api: source/api/generated/gen.txt |
| 84 |
|
| 85 |
source/api/generated/gen.txt: |
| 86 |
$(PYTHON) autogen_api.py |
| 87 |
@echo "Build API docs finished." |
| 88 |
|
| 89 |
autogen_shortcuts: autogen_shortcuts.py ../IPython/terminal/interactiveshell.py source/config/shortcuts/index.rst |
| 90 |
$(PYTHON) autogen_shortcuts.py |
| 91 |
@echo "Created docs for shortcuts" |
| 92 |
|
| 93 |
pickle: |
| 94 |
mkdir -p build/pickle build/doctrees |
| 95 |
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle |
| 96 |
@echo |
| 97 |
@echo "Build finished; now you can process the pickle files or run" |
| 98 |
@echo " sphinx-web build/pickle" |
| 99 |
@echo "to start the sphinx-web server." |
| 100 |
|
| 101 |
web: pickle |
| 102 |
|
| 103 |
htmlhelp: |
| 104 |
mkdir -p build/htmlhelp build/doctrees |
| 105 |
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp |
| 106 |
@echo |
| 107 |
@echo "Build finished; now you can run HTML Help Workshop with the" \ |
| 108 |
".hhp project file in build/htmlhelp." |
| 109 |
|
| 110 |
latex: api autoconfig |
| 111 |
mkdir -p build/latex build/doctrees |
| 112 |
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex |
| 113 |
@echo |
| 114 |
@echo "Build finished; the LaTeX files are in build/latex." |
| 115 |
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
| 116 |
"run these through (pdf)latex." |
| 117 |
|
| 118 |
changes: |
| 119 |
mkdir -p build/changes build/doctrees |
| 120 |
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes |
| 121 |
@echo |
| 122 |
@echo "The overview file is in build/changes." |
| 123 |
|
| 124 |
linkcheck: |
| 125 |
mkdir -p build/linkcheck build/doctrees |
| 126 |
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck |
| 127 |
@echo |
| 128 |
@echo "Link check complete; look for any errors in the above output " \ |
| 129 |
"or in build/linkcheck/output.rst." |
| 130 |
|
| 131 |
texinfo: |
| 132 |
mkdir -p $(BUILDDIR)/texinfo |
| 133 |
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo |
| 134 |
@echo |
| 135 |
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." |
| 136 |
@echo "Run \`make' in that directory to run these through makeinfo" \ |
| 137 |
"(use \`make info' here to do that automatically)." |
| 138 |
|
| 139 |
info: |
| 140 |
mkdir -p $(BUILDDIR)/texinfo |
| 141 |
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo |
| 142 |
@echo "Running Texinfo files through makeinfo..." |
| 143 |
make -C $(BUILDDIR)/texinfo info |
| 144 |
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." |