blob: 5cfe635b4d2a40b142d9e4ce255fabcc0652a547 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001#
2# Makefile for Python documentation
3# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4#
5
6# You can set these variables from the command line.
Georg Brandl7094a0c2007-08-15 18:02:37 +00007PYTHON = python
8SVNROOT = http://svn.python.org/projects
9SPHINXOPTS =
Georg Brandleee1fc52007-12-16 19:36:51 +000010PAPER =
Georg Brandlb98fe5a2008-03-22 10:58:38 +000011SOURCES =
Georg Brandl8ec7f652007-08-15 14:28:01 +000012
Georg Brandleee1fc52007-12-16 19:36:51 +000013ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
Georg Brandlb98fe5a2008-03-22 10:58:38 +000014 $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
Georg Brandl8ec7f652007-08-15 14:28:01 +000015
Georg Brandl17048282008-02-23 18:47:04 +000016.PHONY: help checkout update build html web htmlhelp clean coverage
Georg Brandl8ec7f652007-08-15 14:28:01 +000017
18help:
19 @echo "Please use \`make <target>' where <target> is one of"
Georg Brandlcd235272008-02-01 15:50:15 +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"
Georg Brandl17048282008-02-23 18:47:04 +000026 @echo " coverage to check documentation coverage for library and C API"
Georg Brandl8ec7f652007-08-15 14:28:01 +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
37 @if [ ! -d tools/pygments ]; then \
38 echo "Checking out Pygments..."; \
Georg Brandlfef8be62007-10-23 18:21:35 +000039 svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \
Georg Brandl8ec7f652007-08-15 14:28:01 +000040 fi
41
Martin v. Löwis39942402007-09-10 13:19:10 +000042update: checkout
Georg Brandl8ec7f652007-08-15 14:28:01 +000043 svn update tools/sphinx
44 svn update tools/docutils
45 svn update tools/pygments
46
47build: checkout
48 mkdir -p build/$(BUILDER) build/doctrees
49 $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
50 @echo
51
52html: BUILDER = html
53html: build
54 @echo "Build finished. The HTML pages are in build/html."
55
56web: BUILDER = web
57web: build
58 @echo "Build finished; now you can run"
59 @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
60 @echo "to start the server."
61
62htmlhelp: BUILDER = htmlhelp
63htmlhelp: build
64 @echo "Build finished; now you can run HTML Help Workshop with the" \
Georg Brandl09a5c3e2007-08-15 18:30:42 +000065 "build/htmlhelp/pydoc.hhp project file."
Georg Brandl8ec7f652007-08-15 14:28:01 +000066
Georg Brandl584265b2007-12-02 14:58:50 +000067latex: BUILDER = latex
68latex: build
69 @echo "Build finished; the LaTeX files are in build/latex."
Georg Brandleee1fc52007-12-16 19:36:51 +000070 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
71 "run these through (pdf)latex."
Georg Brandl584265b2007-12-02 14:58:50 +000072
Georg Brandlb19be572007-12-29 10:57:00 +000073changes: BUILDER = changes
74changes: build
75 @echo "The overview file is in build/changes."
76
Georg Brandlcd235272008-02-01 15:50:15 +000077linkcheck: BUILDER = linkcheck
78linkcheck: build
Georg Brandl17048282008-02-23 18:47:04 +000079 @echo "Link check complete; look for any errors in the above output " \
Georg Brandl7be67ff2008-02-01 19:24:01 +000080 "or in build/$(BUILDER)/output.txt"
Georg Brandlcd235272008-02-01 15:50:15 +000081
Georg Brandl17048282008-02-23 18:47:04 +000082coverage: BUILDER = coverage
83coverage: build
84 @echo "Coverage finished; see c.txt and python.txt in build/coverage"
85
Georg Brandl17baef02008-03-22 10:56:23 +000086doctest: BUILDER = doctest
87doctest: build
88 @echo "Testing of doctests in the sources finished, look at the " \
89 "results in build/doctest/output.txt"
90
Georg Brandl8ec7f652007-08-15 14:28:01 +000091clean:
92 -rm -rf build/*
93 -rm -rf tools/sphinx