blob: f69383ee9c620454dd1e0c03c73ac4466da20916 [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 =
Georg Brandl116aa622007-08-15 14:28:22 +000011
Christian Heimes2c181612007-12-17 20:04:13 +000012ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
13 $(SPHINXOPTS) . build/$(BUILDER)
Georg Brandl116aa622007-08-15 14:28:22 +000014
Christian Heimesd3eb5a152008-02-24 00:38:49 +000015.PHONY: help checkout update build html web htmlhelp clean coverage
Georg Brandl116aa622007-08-15 14:28:22 +000016
17help:
18 @echo "Please use \`make <target>' where <target> is one of"
Christian Heimes292d3512008-02-03 16:51:08 +000019 @echo " html to make standalone HTML files"
20 @echo " web to make file usable by Sphinx.web"
21 @echo " htmlhelp to make HTML files and a HTML help project"
22 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
23 @echo " changes to make an overview over all changed/added/deprecated items"
24 @echo " linkcheck to check all external links for integrity"
Christian Heimesd3eb5a152008-02-24 00:38:49 +000025 @echo " coverage to check documentation coverage for library and C API"
Georg Brandl116aa622007-08-15 14:28:22 +000026
27checkout:
28 @if [ ! -d tools/sphinx ]; then \
29 echo "Checking out Sphinx..."; \
30 svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \
31 fi
32 @if [ ! -d tools/docutils ]; then \
33 echo "Checking out Docutils..."; \
34 svn checkout $(SVNROOT)/external/docutils-0.4/docutils tools/docutils; \
35 fi
36 @if [ ! -d tools/pygments ]; then \
37 echo "Checking out Pygments..."; \
Georg Brandld1cdf212007-10-23 18:21:41 +000038 svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \
Georg Brandl116aa622007-08-15 14:28:22 +000039 fi
40
Thomas Woutersbca54802007-09-10 19:32:14 +000041update: checkout
Georg Brandl116aa622007-08-15 14:28:22 +000042 svn update tools/sphinx
43 svn update tools/docutils
44 svn update tools/pygments
45
46build: checkout
47 mkdir -p build/$(BUILDER) build/doctrees
48 $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
49 @echo
50
51html: BUILDER = html
52html: build
53 @echo "Build finished. The HTML pages are in build/html."
54
55web: BUILDER = web
56web: build
57 @echo "Build finished; now you can run"
58 @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
59 @echo "to start the server."
60
61htmlhelp: BUILDER = htmlhelp
62htmlhelp: build
63 @echo "Build finished; now you can run HTML Help Workshop with the" \
Guido van Rossumda27fd22007-08-17 00:24:54 +000064 "build/htmlhelp/pydoc.hhp project file."
Georg Brandl116aa622007-08-15 14:28:22 +000065
Christian Heimesd8654cf2007-12-02 15:22:16 +000066latex: BUILDER = latex
67latex: build
68 @echo "Build finished; the LaTeX files are in build/latex."
Christian Heimes2c181612007-12-17 20:04:13 +000069 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
70 "run these through (pdf)latex."
Christian Heimesd8654cf2007-12-02 15:22:16 +000071
Christian Heimes5b5e81c2007-12-31 16:14:33 +000072changes: BUILDER = changes
73changes: build
74 @echo "The overview file is in build/changes."
75
Christian Heimes292d3512008-02-03 16:51:08 +000076linkcheck: BUILDER = linkcheck
77linkcheck: build
Christian Heimesd3eb5a152008-02-24 00:38:49 +000078 @echo "Link check complete; look for any errors in the above output " \
Christian Heimes292d3512008-02-03 16:51:08 +000079 "or in build/$(BUILDER)/output.txt"
80
Christian Heimesd3eb5a152008-02-24 00:38:49 +000081coverage: BUILDER = coverage
82coverage: build
83 @echo "Coverage finished; see c.txt and python.txt in build/coverage"
84
Georg Brandl116aa622007-08-15 14:28:22 +000085clean:
86 -rm -rf build/*
87 -rm -rf tools/sphinx