Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | # |
| 2 | # Makefile for Python documentation |
| 3 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 4 | # |
| 5 | |
| 6 | # You can set these variables from the command line. |
Georg Brandl | 7094a0c | 2007-08-15 18:02:37 +0000 | [diff] [blame] | 7 | PYTHON = python |
| 8 | SVNROOT = http://svn.python.org/projects |
| 9 | SPHINXOPTS = |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 10 | PAPER = |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 11 | |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 12 | ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ |
| 13 | $(SPHINXOPTS) . build/$(BUILDER) |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +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" |
Georg Brandl | cd23527 | 2008-02-01 15:50:15 +0000 | [diff] [blame] | 19 | @echo " html to make standalone HTML files" |
| 20 | @echo " web to make file usable by Sphinx.web" |
| 21 | @echo " htmlhelp to make HTML files and a HTML help project" |
| 22 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
| 23 | @echo " changes to make an overview over all changed/added/deprecated items" |
| 24 | @echo " linkcheck to check all external links for integrity" |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 25 | |
| 26 | checkout: |
| 27 | @if [ ! -d tools/sphinx ]; then \ |
| 28 | echo "Checking out Sphinx..."; \ |
| 29 | svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \ |
| 30 | fi |
| 31 | @if [ ! -d tools/docutils ]; then \ |
| 32 | echo "Checking out Docutils..."; \ |
| 33 | svn checkout $(SVNROOT)/external/docutils-0.4/docutils tools/docutils; \ |
| 34 | fi |
| 35 | @if [ ! -d tools/pygments ]; then \ |
| 36 | echo "Checking out Pygments..."; \ |
Georg Brandl | fef8be6 | 2007-10-23 18:21:35 +0000 | [diff] [blame] | 37 | svn checkout $(SVNROOT)/external/Pygments-0.9/pygments tools/pygments; \ |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 38 | fi |
| 39 | |
Martin v. Löwis | 3994240 | 2007-09-10 13:19:10 +0000 | [diff] [blame] | 40 | update: checkout |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 41 | svn update tools/sphinx |
| 42 | svn update tools/docutils |
| 43 | svn update tools/pygments |
| 44 | |
| 45 | build: checkout |
| 46 | mkdir -p build/$(BUILDER) build/doctrees |
| 47 | $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS) |
| 48 | @echo |
| 49 | |
| 50 | html: BUILDER = html |
| 51 | html: build |
| 52 | @echo "Build finished. The HTML pages are in build/html." |
| 53 | |
| 54 | web: BUILDER = web |
| 55 | web: build |
| 56 | @echo "Build finished; now you can run" |
| 57 | @echo " PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web" |
| 58 | @echo "to start the server." |
| 59 | |
| 60 | htmlhelp: BUILDER = htmlhelp |
| 61 | htmlhelp: build |
| 62 | @echo "Build finished; now you can run HTML Help Workshop with the" \ |
Georg Brandl | 09a5c3e | 2007-08-15 18:30:42 +0000 | [diff] [blame] | 63 | "build/htmlhelp/pydoc.hhp project file." |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 64 | |
Georg Brandl | 584265b | 2007-12-02 14:58:50 +0000 | [diff] [blame] | 65 | latex: BUILDER = latex |
| 66 | latex: build |
| 67 | @echo "Build finished; the LaTeX files are in build/latex." |
Georg Brandl | eee1fc5 | 2007-12-16 19:36:51 +0000 | [diff] [blame] | 68 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
| 69 | "run these through (pdf)latex." |
Georg Brandl | 584265b | 2007-12-02 14:58:50 +0000 | [diff] [blame] | 70 | |
Georg Brandl | b19be57 | 2007-12-29 10:57:00 +0000 | [diff] [blame] | 71 | changes: BUILDER = changes |
| 72 | changes: build |
| 73 | @echo "The overview file is in build/changes." |
| 74 | |
Georg Brandl | cd23527 | 2008-02-01 15:50:15 +0000 | [diff] [blame] | 75 | linkcheck: BUILDER = linkcheck |
| 76 | linkcheck: build |
Georg Brandl | 7be67ff | 2008-02-01 19:24:01 +0000 | [diff] [blame^] | 77 | @echo "Link check complete; look for any errors in the above output "\ |
| 78 | "or in build/$(BUILDER)/output.txt" |
Georg Brandl | cd23527 | 2008-02-01 15:50:15 +0000 | [diff] [blame] | 79 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 80 | clean: |
| 81 | -rm -rf build/* |
| 82 | -rm -rf tools/sphinx |