~vcs-imports/scipy/numpy-docs

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: ptvirtan
  • Date: 2008-10-26 17:57:55 UTC
  • Revision ID: vcs-imports@canonical.com-20081026175755-265j4vcbtj2wk6iq
Import initial version of Numpy documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Makefile for Sphinx documentation
 
2
#
 
3
 
 
4
# You can set these variables from the command line.
 
5
SPHINXOPTS    =
 
6
SPHINXBUILD   = LANG=C sphinx-build
 
7
PAPER         =
 
8
 
 
9
# Internal variables.
 
10
PAPEROPT_a4     = -D latex_paper_size=a4
 
11
PAPEROPT_letter = -D latex_paper_size=letter
 
12
ALLSPHINXOPTS   = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
 
13
 
 
14
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
 
15
 
 
16
help:
 
17
        @echo "Please use \`make <target>' where <target> is one of"
 
18
        @echo "  dist      to make a distribution-ready tree"
 
19
        @echo "  html      to make standalone HTML files"
 
20
        @echo "  pickle    to make pickle files (usable by e.g. 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"
 
25
 
 
26
clean:
 
27
        -rm -rf build/* source/reference/generated
 
28
 
 
29
dist: html
 
30
        test -d build/latex || make latex
 
31
        make -C build/latex all-pdf
 
32
        -rm -rf build/dist
 
33
        cp -r build/html build/dist
 
34
        perl -pi -e 's#^\s*(<li><a href=".*?">NumPy.*?Manual.*?&raquo;</li>)#<li><a href="/">Numpy and Scipy Documentation</a> &raquo;</li>#;' build/dist/*.html build/dist/*/*.html build/dist/*/*/*.html
 
35
        cd build/html && zip -9r ../dist/numpy-html.zip .
 
36
        cp build/latex/*.pdf build/dist
 
37
        cd build/dist && tar czf ../dist.tar.gz *
 
38
 
 
39
generate: build/generate-stamp
 
40
build/generate-stamp: $(wildcard source/reference/*.rst) ext
 
41
        mkdir -p build
 
42
        ./ext/autosummary_generate.py source/reference/*.rst \
 
43
                -p dump.xml -o source/reference/generated 
 
44
        touch build/generate-stamp
 
45
 
 
46
ext:
 
47
        svn co http://sphinx.googlecode.com/svn/contrib/trunk/numpyext ext
 
48
 
 
49
html: generate
 
50
        mkdir -p build/html build/doctrees
 
51
        $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
 
52
        python postprocess.py html build/html/*.html
 
53
        @echo
 
54
        @echo "Build finished. The HTML pages are in build/html."
 
55
 
 
56
pickle: generate
 
57
        mkdir -p build/pickle build/doctrees
 
58
        $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
 
59
        @echo
 
60
        @echo "Build finished; now you can process the pickle files or run"
 
61
        @echo "  sphinx-web build/pickle"
 
62
        @echo "to start the sphinx-web server."
 
63
 
 
64
web: pickle
 
65
 
 
66
htmlhelp: generate
 
67
        mkdir -p build/htmlhelp build/doctrees
 
68
        $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp
 
69
        @echo
 
70
        @echo "Build finished; now you can run HTML Help Workshop with the" \
 
71
              ".hhp project file in build/htmlhelp."
 
72
 
 
73
latex: generate
 
74
        mkdir -p build/latex build/doctrees
 
75
        $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
 
76
        python postprocess.py tex build/latex/*.tex
 
77
        @echo
 
78
        @echo "Build finished; the LaTeX files are in build/latex."
 
79
        @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
 
80
              "run these through (pdf)latex."
 
81
 
 
82
coverage: build
 
83
        mkdir -p build/coverage build/doctrees
 
84
        $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) build/coverage
 
85
        @echo "Coverage finished; see c.txt and python.txt in build/coverage"
 
86
 
 
87
changes: generate
 
88
        mkdir -p build/changes build/doctrees
 
89
        $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
 
90
        @echo
 
91
        @echo "The overview file is in build/changes."
 
92
 
 
93
linkcheck: generate
 
94
        mkdir -p build/linkcheck build/doctrees
 
95
        $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck
 
96
        @echo
 
97
        @echo "Link check complete; look for any errors in the above output " \
 
98
              "or in build/linkcheck/output.txt."