blob: 84a297a18a3d784999412c2a527d5e63f5be3cbe [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 =
Georg Brandl116aa622007-08-15 14:28:22 +000010
11ALLSPHINXOPTS = -b$(BUILDER) -dbuild/doctrees $(SPHINXOPTS) . build/$(BUILDER)
12
13.PHONY: help checkout update build html web htmlhelp clean
14
15help:
16 @echo "Please use \`make <target>' where <target> is one of"
17 @echo " html to make standalone HTML files"
18 @echo " web to make file usable by Sphinx.web"
19 @echo " htmlhelp to make HTML files and a HTML help project"
20
21checkout:
22 @if [ ! -d tools/sphinx ]; then \
23 echo "Checking out Sphinx..."; \
24 svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \
25 fi
26 @if [ ! -d tools/docutils ]; then \
27 echo "Checking out Docutils..."; \
28 svn checkout $(SVNROOT)/external/docutils-0.4/docutils tools/docutils; \
29 fi
30 @if [ ! -d tools/pygments ]; then \
31 echo "Checking out Pygments..."; \
Georg Brandld1cdf212007-10-23 18:21:41 +000032 svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \
Georg Brandl116aa622007-08-15 14:28:22 +000033 fi
34
Thomas Woutersbca54802007-09-10 19:32:14 +000035update: checkout
Georg Brandl116aa622007-08-15 14:28:22 +000036 svn update tools/sphinx
37 svn update tools/docutils
38 svn update tools/pygments
39
40build: checkout
41 mkdir -p build/$(BUILDER) build/doctrees
42 $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
43 @echo
44
45html: BUILDER = html
46html: build
47 @echo "Build finished. The HTML pages are in build/html."
48
49web: BUILDER = web
50web: build
51 @echo "Build finished; now you can run"
52 @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
53 @echo "to start the server."
54
55htmlhelp: BUILDER = htmlhelp
56htmlhelp: build
57 @echo "Build finished; now you can run HTML Help Workshop with the" \
Guido van Rossumda27fd22007-08-17 00:24:54 +000058 "build/htmlhelp/pydoc.hhp project file."
Georg Brandl116aa622007-08-15 14:28:22 +000059
Christian Heimesd8654cf2007-12-02 15:22:16 +000060latex: BUILDER = latex
61latex: build
62 @echo "Build finished; the LaTeX files are in build/latex."
63
Georg Brandl116aa622007-08-15 14:28:22 +000064clean:
65 -rm -rf build/*
66 -rm -rf tools/sphinx