doc/book/en/makefile
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Sun, 17 Oct 2010 21:10:44 +0200
changeset 6528 6c6859a67673
parent 6486 2b3fa6fb647b
child 6531 e37bbab24f42
permissions -rw-r--r--
[doc] generate doc in cw/doc/html and include html files in cubicweb-documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     1
MKHTML=mkdoc
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
     2
MKHTMLOPTS=--doctype article --target html --stylesheet standard
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     3
SRC=.
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     4
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     5
TXTFILES:= $(wildcard *.txt)
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     6
TARGET := $(TXTFILES:.txt=.html)
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     7
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     8
# You can set these sphinx variables from the command line.
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     9
SPHINXOPTS    =
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    10
SPHINXBUILD   = sphinx-build
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    11
PAPER         =
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    12
#BUILDDIR      = build
6528
6c6859a67673 [doc] generate doc in cw/doc/html and include html files in cubicweb-documentation
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6486
diff changeset
    13
BUILDDIR      = ../../html
5470
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    14
CWDIR         = ../../..
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    15
JSDIR         = ${CWDIR}/web/data
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    16
JSTORST       = ${CWDIR}/doc/tools/pyjsrest.py
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    17
BUILDJS       = devweb/js_api
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    18
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    19
# Internal variables for sphinx
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    20
PAPEROPT_a4     = -D latex_paper_size=a4
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    21
PAPEROPT_letter = -D latex_paper_size=letter
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    22
ALLSPHINXOPTS   = -d ${BUILDDIR}/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    23
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    24
5470
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    25
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    26
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    27
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    28
help:
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    29
	@echo "Please use \`make <target>' where <target> is one of"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    30
	@echo "  all       to make standalone HTML files, developer manual and API doc"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    31
	@echo "  html      to make standalone HTML files"
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    32
	@echo "---  "
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    33
	@echo "  pickle    to make pickle files (usable by e.g. sphinx-web)"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    34
	@echo "  htmlhelp  to make HTML files and a HTML help project"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    35
	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    36
	@echo "  changes   to make an overview over all changed/added/deprecated items"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    37
	@echo "  linkcheck to check all external links for integrity"
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    38
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    39
clean:
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    40
	rm -f *.html
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    41
	-rm -rf ${BUILDDIR}/*
5470
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    42
	-rm -rf ${BUILDJS}
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    43
6486
2b3fa6fb647b [doc] kill deprecated french documentation
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5470
diff changeset
    44
all: ${TARGET} html
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    45
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    46
%.html: %.txt
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    47
	${MKHTML} ${MKHTMLOPTS} $<
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    48
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    49
# run sphinx ###
5470
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    50
html: js
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    51
	mkdir -p ${BUILDDIR}/html ${BUILDDIR}/doctrees
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    52
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${BUILDDIR}/html
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    53
	@echo
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    54
	@echo "Build finished. The HTML pages are in ${BUILDDIR}/html."
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    55
5470
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    56
js:
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    57
	mkdir -p ${BUILDJS}
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    58
	$(JSTORST) -p ${JSDIR} -o ${BUILDJS}
fb004819cab4 [book] add generated js documentation to cw book
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 3557
diff changeset
    59
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    60
pickle:
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    61
	mkdir -p ${BUILDDIR}/pickle ${BUILDDIR}/doctrees
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    62
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) ${BUILDDIR}/pickle
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    63
	@echo
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    64
	@echo "Build finished; now you can process the pickle files or run"
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    65
	@echo "  sphinx-web ${BUILDDIR}/pickle"
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    66
	@echo "to start the sphinx-web server."
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    67
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    68
web: pickle
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    69
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    70
htmlhelp:
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    71
	mkdir -p ${BUILDDIR}/htmlhelp ${BUILDDIR}/doctrees
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    72
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) ${BUILDDIR}/htmlhelp
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    73
	@echo
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    74
	@echo "Build finished; now you can run HTML Help Workshop with the" \
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    75
	      ".hhp project file in ${BUILDDIR}/htmlhelp."
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    76
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    77
latex:
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    78
	mkdir -p ${BUILDDIR}/latex ${BUILDDIR}/doctrees
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    79
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) ${BUILDDIR}/latex
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    80
	@echo
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    81
	@echo "Build finished; the LaTeX files are in ${BUILDDIR}/latex."
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    82
	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    83
	      "run these through (pdf)latex."
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    84
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    85
changes:
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    86
	mkdir -p ${BUILDDIR}/changes ${BUILDDIR}/doctrees
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    87
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) ${BUILDDIR}/changes
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    88
	@echo
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    89
	@echo "The overview file is in ${BUILDDIR}/changes."
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    90
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    91
linkcheck:
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    92
	mkdir -p ${BUILDDIR}/linkcheck ${BUILDDIR}/doctrees
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    93
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) ${BUILDDIR}/linkcheck
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    94
	@echo
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
    95
	@echo "Link check complete; look for any errors in the above output " \
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 625
diff changeset
    96
	      "or in ${BUILDDIR}/linkcheck/output.txt."