Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | # |
| 2 | # Makefile for Python documentation |
| 3 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 4 | # |
| 5 | |
| 6 | # You can set these variables from the command line. |
Guido van Rossum | ba9c9ac | 2007-08-18 00:03:44 +0000 | [diff] [blame] | 7 | PYTHON = python2.5 |
Guido van Rossum | da27fd2 | 2007-08-17 00:24:54 +0000 | [diff] [blame] | 8 | SVNROOT = http://svn.python.org/projects |
| 9 | SPHINXOPTS = |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame^] | 10 | PAPER = |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 11 | |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame^] | 12 | ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ |
| 13 | $(SPHINXOPTS) . build/$(BUILDER) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 14 | |
| 15 | .PHONY: help checkout update build html web htmlhelp clean |
| 16 | |
| 17 | help: |
| 18 | @echo "Please use \`make <target>' where <target> is one of" |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame^] | 19 | @echo " html to make standalone HTML files" |
| 20 | @echo " web to make file usable by Sphinx.web" |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 21 | @echo " htmlhelp to make HTML files and a HTML help project" |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame^] | 22 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 23 | |
| 24 | checkout: |
| 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 Brandl | d1cdf21 | 2007-10-23 18:21:41 +0000 | [diff] [blame] | 35 | svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \ |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 36 | fi |
| 37 | |
Thomas Wouters | bca5480 | 2007-09-10 19:32:14 +0000 | [diff] [blame] | 38 | update: checkout |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 39 | svn update tools/sphinx |
| 40 | svn update tools/docutils |
| 41 | svn update tools/pygments |
| 42 | |
| 43 | build: checkout |
| 44 | mkdir -p build/$(BUILDER) build/doctrees |
| 45 | $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS) |
| 46 | @echo |
| 47 | |
| 48 | html: BUILDER = html |
| 49 | html: build |
| 50 | @echo "Build finished. The HTML pages are in build/html." |
| 51 | |
| 52 | web: BUILDER = web |
| 53 | web: 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 | |
| 58 | htmlhelp: BUILDER = htmlhelp |
| 59 | htmlhelp: build |
| 60 | @echo "Build finished; now you can run HTML Help Workshop with the" \ |
Guido van Rossum | da27fd2 | 2007-08-17 00:24:54 +0000 | [diff] [blame] | 61 | "build/htmlhelp/pydoc.hhp project file." |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 62 | |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 63 | latex: BUILDER = latex |
| 64 | latex: build |
| 65 | @echo "Build finished; the LaTeX files are in build/latex." |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame^] | 66 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
| 67 | "run these through (pdf)latex." |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 68 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 69 | clean: |
| 70 | -rm -rf build/* |
| 71 | -rm -rf tools/sphinx |