2 # Makefile for Python documentation
3 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 # You can set these variables from the command line.
8 SVNROOT
= http
://svn.python.org
/projects
13 ALLSPHINXOPTS
= -b
$(BUILDER
) -d build
/doctrees
-D latex_paper_size
=$(PAPER
) \
14 $(SPHINXOPTS
) . build
/$(BUILDER
) $(SOURCES
)
16 .PHONY
: help checkout update build html web htmlhelp
clean coverage
19 @echo
"Please use \`make <target>' where <target> is one of"
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
" text to make plain text files"
25 @echo
" changes to make an overview over all changed/added/deprecated items"
26 @echo
" linkcheck to check all external links for integrity"
27 @echo
" coverage to check documentation coverage for library and C API"
30 @if
[ ! -d tools
/sphinx
]; then \
31 echo
"Checking out Sphinx..."; \
32 svn checkout
$(SVNROOT
)/doctools
/trunk
/sphinx tools
/sphinx
; \
34 @if
[ ! -d tools
/docutils
]; then \
35 echo
"Checking out Docutils..."; \
36 svn checkout
$(SVNROOT
)/external
/docutils-0.5
/docutils tools
/docutils
; \
38 @if
[ ! -d tools
/jinja
]; then \
39 echo
"Checking out Jinja..."; \
40 svn checkout
$(SVNROOT
)/external
/Jinja-1.2
/jinja tools
/jinja
; \
42 @if
[ ! -d tools
/pygments
]; then \
43 echo
"Checking out Pygments..."; \
44 svn checkout
$(SVNROOT
)/external
/Pygments-0.10
/pygments tools
/pygments
; \
48 svn update tools
/sphinx
49 svn update tools
/docutils
50 svn update tools
/jinja
51 svn update tools
/pygments
54 mkdir
-p build
/$(BUILDER
) build
/doctrees
55 $(PYTHON
) tools
/sphinx-build.py
$(ALLSPHINXOPTS
)
60 @echo
"Build finished. The HTML pages are in build/html."
64 @echo
"Build finished; now you can run"
65 @echo
" PYTHONPATH=tools $(PYTHON) -m sphinx.web build/web"
66 @echo
"to start the server."
68 htmlhelp
: BUILDER
= htmlhelp
70 @echo
"Build finished; now you can run HTML Help Workshop with the" \
71 "build/htmlhelp/pydoc.hhp project file."
73 latex
: BUILDER
= latex
75 @echo
"Build finished; the LaTeX files are in build/latex."
76 @echo
"Run \`make all-pdf' or \`make all-ps' in that directory to" \
77 "run these through (pdf)latex."
81 @echo
"Build finished; the text files are in build/text."
83 changes
: BUILDER
= changes
85 @echo
"The overview file is in build/changes."
87 linkcheck
: BUILDER
= linkcheck
89 @echo
"Link check complete; look for any errors in the above output " \
90 "or in build/$(BUILDER)/output.txt"
92 coverage
: BUILDER
= coverage
94 @echo
"Coverage finished; see c.txt and python.txt in build/coverage"
96 doctest
: BUILDER
= doctest
98 @echo
"Testing of doctests in the sources finished, look at the " \
99 "results in build/doctest/output.txt"
101 pydoc-topics
: BUILDER
= pydoc-topics
103 @echo
"Building finished; now copy build/pydoc-topics/pydoc_topics.py " \
104 "into the Lib/ directory"
107 $(PYTHON
) -c
"import webbrowser; webbrowser.open('build/html/index.html')"