1 MKHTML=mkdoc |
1 MKHTML=mkdoc |
2 MKHTMLOPTS=--doctype article --target html --stylesheet standard |
2 MKHTMLOPTS=--doctype article --target html --stylesheet standard |
3 SRC=. |
3 SRC=. |
4 |
4 |
5 TXTFILES:= $(wildcard *.txt) |
5 TXTFILES:= $(wildcard *.txt) |
6 TARGET := $(TXTFILES:.txt=.html) |
6 TARGET := $(TXTFILES:.txt=.html) |
7 |
7 |
8 # You can set these sphinx variables from the command line. |
8 # You can set these sphinx variables from the command line. |
9 SPHINXOPTS = |
9 SPHINXOPTS = |
10 SPHINXBUILD = sphinx-build |
10 SPHINXBUILD = sphinx-build |
11 PAPER = |
11 PAPER = |
|
12 #BUILDDIR = build |
|
13 BUILDDIR = /tmp/cwdoc |
12 |
14 |
13 # Internal variables for sphinx |
15 # Internal variables for sphinx |
14 PAPEROPT_a4 = -D latex_paper_size=a4 |
16 PAPEROPT_a4 = -D latex_paper_size=a4 |
15 PAPEROPT_letter = -D latex_paper_size=letter |
17 PAPEROPT_letter = -D latex_paper_size=letter |
16 ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
18 ALLSPHINXOPTS = -d ${BUILDDIR}/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
17 |
19 |
18 |
20 |
19 .PHONY: help clean html web pickle htmlhelp latex changes linkcheck |
21 .PHONY: help clean html web pickle htmlhelp latex changes linkcheck |
20 |
22 |
21 help: |
23 help: |
22 @echo "Please use \`make <target>' where <target> is one of" |
24 @echo "Please use \`make <target>' where <target> is one of" |
23 @echo " all to make standalone HTML files, developer manual and API doc" |
25 @echo " all to make standalone HTML files, developer manual and API doc" |
24 @echo " apidoc to make API doc" |
26 @echo " apidoc to make API doc" |
25 @echo " html to make standalone HTML files" |
27 @echo " html to make standalone HTML files" |
26 @echo "--- " |
28 @echo "--- " |
27 @echo " pickle to make pickle files (usable by e.g. sphinx-web)" |
29 @echo " pickle to make pickle files (usable by e.g. sphinx-web)" |
28 @echo " htmlhelp to make HTML files and a HTML help project" |
30 @echo " htmlhelp to make HTML files and a HTML help project" |
29 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
31 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
30 @echo " changes to make an overview over all changed/added/deprecated items" |
32 @echo " changes to make an overview over all changed/added/deprecated items" |
31 @echo " linkcheck to check all external links for integrity" |
33 @echo " linkcheck to check all external links for integrity" |
32 |
34 |
33 clean: |
35 clean: |
34 rm -rf apidoc/ |
36 rm -rf apidoc/ |
35 rm -f *.html |
37 rm -f *.html |
36 -rm -rf build/* |
38 -rm -rf ${BUILDDIR}/* |
37 |
39 |
38 all: ${TARGET} apidoc html |
40 all: ${TARGET} apidoc html |
39 |
41 |
40 %.html: %.txt |
42 %.html: %.txt |
41 ${MKHTML} ${MKHTMLOPTS} $< |
43 ${MKHTML} ${MKHTMLOPTS} $< |
42 |
44 |
43 #apydoc: |
45 #apydoc: |
44 # epydoc --html -o epydoc/ -n ../server/*.py ../core/*.py ../common/*.py ../server/*/*.py ../modpython/*/*.py ../common/*/*.py |
46 # epydoc --html -o epydoc/ -n ../server/*.py ../core/*.py ../common/*.py ../server/*/*.py ../modpython/*/*.py ../common/*/*.py |
45 apidoc: |
47 apidoc: |
46 epydoc --html -o apidoc -n "cubicweb" --exclude=setup --exclude=__pkginfo__ ../../../ |
48 epydoc --html -o apidoc -n "cubicweb" --exclude=setup --exclude=__pkginfo__ ../../../ |
47 |
49 |
48 # run sphinx ### |
50 # run sphinx ### |
49 html: |
51 html: |
50 mkdir -p build/html build/doctrees |
52 mkdir -p ${BUILDDIR}/html ${BUILDDIR}/doctrees |
51 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html |
53 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${BUILDDIR}/html |
52 @echo |
54 @echo |
53 @echo "Build finished. The HTML pages are in build/html." |
55 @echo "Build finished. The HTML pages are in ${BUILDDIR}/html." |
54 |
56 |
55 pickle: |
57 pickle: |
56 mkdir -p build/pickle build/doctrees |
58 mkdir -p ${BUILDDIR}/pickle ${BUILDDIR}/doctrees |
57 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle |
59 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) ${BUILDDIR}/pickle |
58 @echo |
60 @echo |
59 @echo "Build finished; now you can process the pickle files or run" |
61 @echo "Build finished; now you can process the pickle files or run" |
60 @echo " sphinx-web build/pickle" |
62 @echo " sphinx-web ${BUILDDIR}/pickle" |
61 @echo "to start the sphinx-web server." |
63 @echo "to start the sphinx-web server." |
62 |
64 |
63 web: pickle |
65 web: pickle |
64 |
66 |
65 htmlhelp: |
67 htmlhelp: |
66 mkdir -p build/htmlhelp build/doctrees |
68 mkdir -p ${BUILDDIR}/htmlhelp ${BUILDDIR}/doctrees |
67 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp |
69 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) ${BUILDDIR}/htmlhelp |
68 @echo |
70 @echo |
69 @echo "Build finished; now you can run HTML Help Workshop with the" \ |
71 @echo "Build finished; now you can run HTML Help Workshop with the" \ |
70 ".hhp project file in build/htmlhelp." |
72 ".hhp project file in ${BUILDDIR}/htmlhelp." |
71 |
73 |
72 latex: |
74 latex: |
73 mkdir -p build/latex build/doctrees |
75 mkdir -p ${BUILDDIR}/latex ${BUILDDIR}/doctrees |
74 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex |
76 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) ${BUILDDIR}/latex |
75 @echo |
77 @echo |
76 @echo "Build finished; the LaTeX files are in build/latex." |
78 @echo "Build finished; the LaTeX files are in ${BUILDDIR}/latex." |
77 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
79 @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
78 "run these through (pdf)latex." |
80 "run these through (pdf)latex." |
79 |
81 |
80 changes: |
82 changes: |
81 mkdir -p build/changes build/doctrees |
83 mkdir -p ${BUILDDIR}/changes ${BUILDDIR}/doctrees |
82 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes |
84 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) ${BUILDDIR}/changes |
83 @echo |
85 @echo |
84 @echo "The overview file is in build/changes." |
86 @echo "The overview file is in ${BUILDDIR}/changes." |
85 |
87 |
86 linkcheck: |
88 linkcheck: |
87 mkdir -p build/linkcheck build/doctrees |
89 mkdir -p ${BUILDDIR}/linkcheck ${BUILDDIR}/doctrees |
88 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck |
90 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) ${BUILDDIR}/linkcheck |
89 @echo |
91 @echo |
90 @echo "Link check complete; look for any errors in the above output " \ |
92 @echo "Link check complete; look for any errors in the above output " \ |
91 "or in build/linkcheck/output.txt." |
93 "or in ${BUILDDIR}/linkcheck/output.txt." |