blob: 6274d4d8cbca8d4c0684782f5b969ae26d6875b6 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001#
2# Makefile for Python documentation
3# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4#
5
6# You can set these variables from the command line.
Guido van Rossumba9c9ac2007-08-18 00:03:44 +00007PYTHON = python2.5
Guido van Rossumda27fd22007-08-17 00:24:54 +00008SVNROOT = http://svn.python.org/projects
9SPHINXOPTS =
Christian Heimes2c181612007-12-17 20:04:13 +000010PAPER =
Christian Heimesfe337bf2008-03-23 21:54:12 +000011SOURCES =
Georg Brandl116aa622007-08-15 14:28:22 +000012
Christian Heimes2c181612007-12-17 20:04:13 +000013ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
Christian Heimesfe337bf2008-03-23 21:54:12 +000014 $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
Georg Brandl116aa622007-08-15 14:28:22 +000015
Christian Heimesd3eb5a152008-02-24 00:38:49 +000016.PHONY: help checkout update build html web htmlhelp clean coverage
Georg Brandl116aa622007-08-15 14:28:22 +000017
18help:
19 @echo "Please use \`make <target>' where <target> is one of"
Christian Heimes292d3512008-02-03 16:51:08 +000020 @echo " html to make standalone HTML files"
21 @echo " web to make file usable by 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 " changes to make an overview over all changed/added/deprecated items"
25 @echo " linkcheck to check all external links for integrity"
Christian Heimesd3eb5a152008-02-24 00:38:49 +000026 @echo " coverage to check documentation coverage for library and C API"
Georg Brandl116aa622007-08-15 14:28:22 +000027
28checkout:
29 @if [ ! -d tools/sphinx ]; then \
30 echo "Checking out Sphinx..."; \
31 svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \
32 fi
33 @if [ ! -d tools/docutils ]; then \
34 echo "Checking out Docutils..."; \
35 svn checkout $(SVNROOT)/external/docutils-0.4/docutils tools/docutils; \
36 fi
Benjamin Petersond8607622008-04-13 23:11:15 +000037 @if [ ! -d tools/jinja ]; then \
38 echo "Checking out Jinja..."; \
39 svn checkout $(SVNROOT)/external/Jinja-1.1/jinja tools/jinja; \
40 fi
Georg Brandl116aa622007-08-15 14:28:22 +000041 @if [ ! -d tools/pygments ]; then \
42 echo "Checking out Pygments..."; \
Georg Brandld1cdf212007-10-23 18:21:41 +000043 svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \
Georg Brandl116aa622007-08-15 14:28:22 +000044 fi
45
Thomas Woutersbca54802007-09-10 19:32:14 +000046update: checkout
Georg Brandl116aa622007-08-15 14:28:22 +000047 svn update tools/sphinx
48 svn update tools/docutils
Benjamin Petersond8607622008-04-13 23:11:15 +000049 svn update tools/jinja
Georg Brandl116aa622007-08-15 14:28:22 +000050 svn update tools/pygments
51
52build: checkout
53 mkdir -p build/$(BUILDER) build/doctrees
54 $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
55 @echo
56
57html: BUILDER = html
58html: build
59 @echo "Build finished. The HTML pages are in build/html."
60
61web: BUILDER = web
62web: build
63 @echo "Build finished; now you can run"
64 @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
65 @echo "to start the server."
66
67htmlhelp: BUILDER = htmlhelp
68htmlhelp: build
69 @echo "Build finished; now you can run HTML Help Workshop with the" \
Guido van Rossumda27fd22007-08-17 00:24:54 +000070 "build/htmlhelp/pydoc.hhp project file."
Georg Brandl116aa622007-08-15 14:28:22 +000071
Christian Heimesd8654cf2007-12-02 15:22:16 +000072latex: BUILDER = latex
73latex: build
74 @echo "Build finished; the LaTeX files are in build/latex."
Christian Heimes2c181612007-12-17 20:04:13 +000075 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
76 "run these through (pdf)latex."
Christian Heimesd8654cf2007-12-02 15:22:16 +000077
Christian Heimes5b5e81c2007-12-31 16:14:33 +000078changes: BUILDER = changes
79changes: build
80 @echo "The overview file is in build/changes."
81
Christian Heimes292d3512008-02-03 16:51:08 +000082linkcheck: BUILDER = linkcheck
83linkcheck: build
Christian Heimesd3eb5a152008-02-24 00:38:49 +000084 @echo "Link check complete; look for any errors in the above output " \
Christian Heimes292d3512008-02-03 16:51:08 +000085 "or in build/$(BUILDER)/output.txt"
86
Christian Heimesd3eb5a152008-02-24 00:38:49 +000087coverage: BUILDER = coverage
88coverage: build
89 @echo "Coverage finished; see c.txt and python.txt in build/coverage"
90
Christian Heimesfe337bf2008-03-23 21:54:12 +000091doctest: BUILDER = doctest
92doctest: build
93 @echo "Testing of doctests in the sources finished, look at the " \
94 "results in build/doctest/output.txt"
95
Georg Brandl116aa622007-08-15 14:28:22 +000096clean:
97 -rm -rf build/*
98 -rm -rf tools/sphinx