blob: ea62f0081bef5cc5cbfdc68551e71390af959d51 [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 Brandl8ec7f652007-08-15 14:28:01 +000011
Georg Brandleee1fc52007-12-16 19:36:51 +000012ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
13 $(SPHINXOPTS) . build/$(BUILDER)
Georg Brandl8ec7f652007-08-15 14:28:01 +000014
15.PHONY: help checkout update build html web htmlhelp clean
16
17help:
18 @echo "Please use \`make <target>' where <target> is one of"
Georg Brandleee1fc52007-12-16 19:36:51 +000019 @echo " html to make standalone HTML files"
20 @echo " web to make file usable by Sphinx.web"
Georg Brandl8ec7f652007-08-15 14:28:01 +000021 @echo " htmlhelp to make HTML files and a HTML help project"
Georg Brandleee1fc52007-12-16 19:36:51 +000022 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
Georg Brandl8ec7f652007-08-15 14:28:01 +000023
24checkout:
25 @if [ ! -d tools/sphinx ]; then \
26 echo "Checking out Sphinx..."; \
27 svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \
28 fi
29 @if [ ! -d tools/docutils ]; then \
30 echo "Checking out Docutils..."; \
31 svn checkout $(SVNROOT)/external/docutils-0.4/docutils tools/docutils; \
32 fi
33 @if [ ! -d tools/pygments ]; then \
34 echo "Checking out Pygments..."; \
Georg Brandlfef8be62007-10-23 18:21:35 +000035 svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \
Georg Brandl8ec7f652007-08-15 14:28:01 +000036 fi
37
Martin v. Löwis39942402007-09-10 13:19:10 +000038update: checkout
Georg Brandl8ec7f652007-08-15 14:28:01 +000039 svn update tools/sphinx
40 svn update tools/docutils
41 svn update tools/pygments
42
43build: checkout
44 mkdir -p build/$(BUILDER) build/doctrees
45 $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
46 @echo
47
48html: BUILDER = html
49html: build
50 @echo "Build finished. The HTML pages are in build/html."
51
52web: BUILDER = web
53web: build
54 @echo "Build finished; now you can run"
55 @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
56 @echo "to start the server."
57
58htmlhelp: BUILDER = htmlhelp
59htmlhelp: build
60 @echo "Build finished; now you can run HTML Help Workshop with the" \
Georg Brandl09a5c3e2007-08-15 18:30:42 +000061 "build/htmlhelp/pydoc.hhp project file."
Georg Brandl8ec7f652007-08-15 14:28:01 +000062
Georg Brandl584265b2007-12-02 14:58:50 +000063latex: BUILDER = latex
64latex: build
65 @echo "Build finished; the LaTeX files are in build/latex."
Georg Brandleee1fc52007-12-16 19:36:51 +000066 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
67 "run these through (pdf)latex."
Georg Brandl584265b2007-12-02 14:58:50 +000068
Georg Brandl8ec7f652007-08-15 14:28:01 +000069clean:
70 -rm -rf build/*
71 -rm -rf tools/sphinx