summaryrefslogtreecommitdiffstats
path: root/src/doc/Makefile.in
blob: d87a87c9654fc714e06db30ddbcbecacc96c2c1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
mydir=doc
BUILDTOP=$(REL)..

SPHINX_BUILD=sphinx-build
DOXYGEN=doxygen

docsrc=$(top_srcdir)/../doc
localstatedir=@localstatedir@
sysconfdir=@sysconfdir@
DEFCCNAME=@DEFCCNAME@
DEFKTNAME=@DEFKTNAME@
DEFCKTNAME=@DEFCKTNAME@

# Create HTML documentation in $(docsrc)/rst_html suitable for a
# release tarball or the web site (that is, without substitutions for
# configured paths).  This can be done in an unconfigured source tree
# with:
#     make -f Makefile.in srcdir=. top_srcdir=.. PYTHON=python rsthml
#     make -f Makefile.in clean
rsthtml: composite
	rm -rf $(docsrc)/rst_html
	$(SPHINX_BUILD) -q rst_composite $(docsrc)/rst_html

# Create HTML documentation in rst_html_subst suitable for
# installation by an OS package, with substitutions for configured
# paths.
substhtml: composite paths.py
	rm -rf rst_html_subst
	cp paths.py rst_composite
	$(SPHINX_BUILD) -t pathsubs -q rst_composite rst_html_subst

# Use doxygen to generate API documentation, translate it into RST
# format, and then create a composite of $(docsrc)/rst_source, the
# generated files, and the NOTICE file in rst_composite.  Used by the
# rsthtml and substhtml targets.
composite: Doxyfile
	rm -rf doxy rst_apiref rst_composite
	$(DOXYGEN)
	cwd=`pwd`; cd $(docsrc)/rst_tools && \
		$(PYTHON) doxy.py -i $$cwd/doxy/xml -o $$cwd/rst_apiref
	cp -r $(docsrc)/rst_source rst_composite
	cp rst_apiref/*.rst rst_composite/krb_appldev/refs/api
	cp rst_apiref/types/*.rst rst_composite/krb_appldev/refs/types
	cp rst_apiref/macros/*.rst rst_composite/krb_appldev/refs/macros
	cp $(top_srcdir)/../NOTICE rst_composite

Doxyfile: $(srcdir)/Doxyfile.in
	sed -e 's|@SRC@|$(top_srcdir)|g' \
	    -e 's|@DOC@|$(top_srcdir)/../doc|g' $(srcdir)/Doxyfile.in > $@

paths.py:
	rm -f $@
	echo 'bindir = "``$(CLIENT_BINDIR)``"' > $@
	echo 'sbindir = "``$(SERVER_BINDIR)``"' >> $@
	echo 'libdir = "``$(KRB5_LIBDIR)``"' >> $@
	echo 'localstatedir = "``$(localstatedir)``"' >> $@
	echo 'sysconfdir = "``$(sysconfdir)``"' >> $@
	echo 'ccache = "``$(DEFCCNAME)``"' >> $@
	echo 'keytab = "``$(DEFKTNAME)``"' >> $@
	echo 'ckeytab = "``$(DEFCKTNAME)``"' >> $@

clean::
	rm -rf doxy rst_apiref rst_composite rst_html_subst Doxyfile paths.py