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 = |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 11 | SOURCES = |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 12 | |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame] | 13 | ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 14 | $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 15 | |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 16 | .PHONY: help checkout update build html web htmlhelp clean coverage |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 17 | |
| 18 | help: |
| 19 | @echo "Please use \`make <target>' where <target> is one of" |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 20 | @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" |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 26 | @echo " coverage to check documentation coverage for library and C API" |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 27 | |
| 28 | checkout: |
| 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 |
Benjamin Peterson | d860762 | 2008-04-13 23:11:15 +0000 | [diff] [blame^] | 37 | @if [ ! -d tools/jinja ]; then \ |
| 38 | echo "Checking out Jinja..."; \ |
| 39 | svn checkout $(SVNROOT)/external/Jinja-1.1/jinja tools/jinja; \ |
| 40 | fi |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 41 | @if [ ! -d tools/pygments ]; then \ |
| 42 | echo "Checking out Pygments..."; \ |
Georg Brandl | d1cdf21 | 2007-10-23 18:21:41 +0000 | [diff] [blame] | 43 | svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \ |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 44 | fi |
| 45 | |
Thomas Wouters | bca5480 | 2007-09-10 19:32:14 +0000 | [diff] [blame] | 46 | update: checkout |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 47 | svn update tools/sphinx |
| 48 | svn update tools/docutils |
Benjamin Peterson | d860762 | 2008-04-13 23:11:15 +0000 | [diff] [blame^] | 49 | svn update tools/jinja |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 50 | svn update tools/pygments |
| 51 | |
| 52 | build: checkout |
| 53 | mkdir -p build/$(BUILDER) build/doctrees |
| 54 | $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS) |
| 55 | @echo |
| 56 | |
| 57 | html: BUILDER = html |
| 58 | html: build |
| 59 | @echo "Build finished. The HTML pages are in build/html." |
| 60 | |
| 61 | web: BUILDER = web |
| 62 | web: build |
| 63 | @echo "Build finished; now you can run" |
| 64 | @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web" |
| 65 | @echo "to start the server." |
| 66 | |
| 67 | htmlhelp: BUILDER = htmlhelp |
| 68 | htmlhelp: build |
| 69 | @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] | 70 | "build/htmlhelp/pydoc.hhp project file." |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 71 | |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 72 | latex: BUILDER = latex |
| 73 | latex: build |
| 74 | @echo "Build finished; the LaTeX files are in build/latex." |
Christian Heimes | 2c18161 | 2007-12-17 20:04:13 +0000 | [diff] [blame] | 75 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
| 76 | "run these through (pdf)latex." |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 77 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 78 | changes: BUILDER = changes |
| 79 | changes: build |
| 80 | @echo "The overview file is in build/changes." |
| 81 | |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 82 | linkcheck: BUILDER = linkcheck |
| 83 | linkcheck: build |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 84 | @echo "Link check complete; look for any errors in the above output " \ |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 85 | "or in build/$(BUILDER)/output.txt" |
| 86 | |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 87 | coverage: BUILDER = coverage |
| 88 | coverage: build |
| 89 | @echo "Coverage finished; see c.txt and python.txt in build/coverage" |
| 90 | |
Christian Heimes | fe337bf | 2008-03-23 21:54:12 +0000 | [diff] [blame] | 91 | doctest: BUILDER = doctest |
| 92 | doctest: build |
| 93 | @echo "Testing of doctests in the sources finished, look at the " \ |
| 94 | "results in build/doctest/output.txt" |
| 95 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 96 | clean: |
| 97 | -rm -rf build/* |
| 98 | -rm -rf tools/sphinx |