Makefile.am 5.63 KB
Newer Older
Daniel Salzman's avatar
Daniel Salzman committed
1 2 3 4 5
MANPAGES_IN = \
	man/knot.conf.5in	\
	man/knotc.8in		\
	man/knotd.8in		\
	man/keymgr.8in		\
6
	man/kjournalprint.8in	\
Daniel Salzman's avatar
Daniel Salzman committed
7 8 9 10 11 12 13 14 15 16
	man/kdig.1in		\
	man/khost.1in		\
	man/knsupdate.1in	\
	man/knsec3hash.1in	\
	man/kzonecheck.1in

MANPAGES_RST = \
	man_knotc.rst		\
	man_knotd.rst		\
	man_keymgr.rst		\
17
	man_kjournalprint.rst	\
Daniel Salzman's avatar
Daniel Salzman committed
18 19 20 21 22
	man_kdig.rst		\
	man_khost.rst		\
	man_knsupdate.rst	\
	man_knsec3hash.rst	\
	man_kzonecheck.rst
23

24
EXTRA_DIST = \
Daniel Salzman's avatar
Daniel Salzman committed
25
	conf.py			\
26
	\
27
	appendices.rst		\
28 29 30 31 32
	configuration.rst	\
	index.rst		\
	installation.rst	\
	introduction.rst	\
	migration.rst		\
33
	modules.rst.in		\
Jan Včelák's avatar
Jan Včelák committed
34
	operation.rst		\
35 36
	reference.rst		\
	requirements.rst	\
37
	troubleshooting.rst	\
38 39
	utilities.rst		\
	\
40
	$(MANPAGES_IN)		\
41
	$(MANPAGES_RST)		\
42
	\
Jan Včelák's avatar
Jan Včelák committed
43
	logo.eps		\
44 45 46
	logo.png		\
	\
	theme_html
47

48 49 50
SPHINX_V = $(SPHINX_V_@AM_V@)
SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@)
SPHINX_V_0 = -q
51
SPHINX_V_1 = -n
52 53 54

AM_V_SPHINX = $(AM_V_SPHINX_@AM_V@)
AM_V_SPHINX_ = $(AM_V_SPHINX_@AM_DEFAULT_V@)
55
AM_V_SPHINX_0 = @echo "  SPHINX   $@";
56

57
AM_V_ECHO = @sh -c 'if $(AM_V_P); then echo $$1; fi' --
58

59
SPHINXBUILDDIR = $(builddir)/_build
60 61

_SPHINXOPTS    = -c $(srcdir) \
62
	         -a \
63
	         $(SPHINX_V)
64 65 66 67 68 69 70 71 72

ALLSPHINXOPTS  = $(_SPHINXOPTS) \
	         -D version="$(VERSION)" \
	         -D today="$(RELEASE_DATE)" \
	         -D release="$(VERSION)" \
	         $(SPHINXOPTS) \
	         $(srcdir)

man_SPHINXOPTS = $(_SPHINXOPTS) \
73 74
	         -D version="@""VERSION@" \
	         -D today="@""RELEASE_DATE@" \
75
	         -D release="@""VERSION@" \
76 77
	         $(SPHINXOPTS) \
	         $(srcdir)
78

79
.PHONY: html-local singlehtml pdf-local info-local man install-html-local install-singlehtml install-pdf-local install-info-local
80

81
man_MANS =
82 83

if HAVE_DAEMON
Daniel Salzman's avatar
Daniel Salzman committed
84 85 86
man_MANS += \
	man/knot.conf.5		\
	man/knotc.8		\
87
	man/knotd.8
88 89 90
endif # HAVE_DAEMON

if HAVE_UTILS
Daniel Salzman's avatar
Daniel Salzman committed
91 92 93
if HAVE_DAEMON
man_MANS += \
	man/keymgr.8		\
94
	man/kjournalprint.8	\
Daniel Salzman's avatar
Daniel Salzman committed
95 96 97 98 99 100 101 102
	man/kzonecheck.1
endif # HAVE_DAEMON

man_MANS += \
	man/kdig.1		\
	man/khost.1		\
	man/knsupdate.1		\
	man/knsec3hash.1
103 104
endif # HAVE_UTILS

Daniel Salzman's avatar
Daniel Salzman committed
105 106 107 108
man/knot.conf.5:	man/knot.conf.5in
man/knotc.8:		man/knotc.8in
man/knotd.8:		man/knotd.8in
man/keymgr.8:		man/keymgr.8in
109
man/kjournalprint.8:	man/kjournalprint.8in
Daniel Salzman's avatar
Daniel Salzman committed
110 111 112 113 114
man/kdig.1:		man/kdig.1in
man/khost.1:		man/khost.1in
man/knsupdate.1:	man/knsupdate.1in
man/knsec3hash.1:	man/knsec3hash.1in
man/kzonecheck.1:	man/kzonecheck.1in
115

116 117 118 119 120 121 122 123
man_SUBST = $(AM_V_GEN)mkdir -p man; \
            sed -e 's,[@]VERSION@,$(VERSION),' \
                -e 's,[@]RELEASE_DATE@,$(RELEASE_DATE),' \
                -e 's,[@]config_dir@,$(config_dir),' \
                -e 's,[@]storage_dir@,$(storage_dir),' \
                -e 's,[@]run_dir@,$(run_dir),' \
                -e 's,[@]conf_mapsize@,$(conf_mapsize),' \
            $< > $@
124 125 126 127 128 129 130 131 132 133

.1in.1:
	$(man_SUBST)

.5in.5:
	$(man_SUBST)

.8in.8:
	$(man_SUBST)

134 135
if HAVE_DOCS

136
if HAVE_SPHINXBUILD
137
html-local:
138
	$(AM_V_SPHINX)$(SPHINXBUILD) -b html -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html
139 140
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html/."
141

142 143 144 145 146 147
install-html-local:
	$(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static $(DESTDIR)/$(docdir)/_sources
	$(INSTALL) -D $(SPHINXBUILDDIR)/html/*.html $(DESTDIR)/$(docdir)/
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/html/_sources/* $(DESTDIR)/$(docdir)/_sources/
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/html/_static/* $(DESTDIR)/$(docdir)/_static/

148
singlehtml:
149
	$(AM_V_SPHINX)$(SPHINXBUILD) -b singlehtml -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/singlehtml
150 151
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The HTML page is in $(SPHINXBUILDDIR)/singlehtml/."
152

153
install-singlehtml: singlehtml
154 155 156 157
	$(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/*.html $(DESTDIR)/$(docdir)/
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/_static/* $(DESTDIR)/$(docdir)/_static/

158
if HAVE_PDFLATEX
159
pdf-local:
160
	$(AM_V_SPHINX)$(SPHINXBUILD) -b latex -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/latex
161
	$(MAKE) -C $(SPHINXBUILDDIR)/latex all-pdf
162 163
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The PDF file is in $(SPHINXBUILDDIR)/latex/."
164 165 166

install-pdf-local:
	$(INSTALL) -d $(DESTDIR)/$(docdir)
167
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/latex/knot.pdf $(DESTDIR)/$(docdir)/
168

169
else
170
pdf-local install-pdf-local:
171 172
	$(AM_V_ECHO) "You need to install pdflatex and re-run configure to be"
	$(AM_V_ECHO) "able to generate PDF documentation."
173 174 175
endif

if HAVE_MAKEINFO
176
info-local:
177
	$(AM_V_SPHINX)$(SPHINXBUILD) -b texinfo -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/texinfo
178
	$(MAKE) -C $(SPHINXBUILDDIR)/texinfo info
179 180
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The Info file is in $(SPHINXBUILDDIR)/texinfo/."
181 182 183

install-info-local:
	$(INSTALL) -d $(DESTDIR)/$(infodir)
184
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/texinfo/knot.info $(DESTDIR)/$(infodir)/
185

186
else
187
info-local install-info-local:
188 189
	$(AM_V_ECHO) "You need to install GNU Texinfo and re-run configure to be"
	$(AM_V_ECHO) "able to generate info pages."
190 191
endif

192
.NOTPARALLEL: man
193 194
man: $(man_MANS)
$(MANPAGES_IN): $(MANPAGES_RST)
195
	$(AM_V_SPHINX)$(SPHINXBUILD) -b man -d $(SPHINXBUILDDIR)/doctrees $(man_SPHINXOPTS) $(SPHINXBUILDDIR)/man
196 197
	@mkdir -p $(srcdir)/man
	@for f in $(SPHINXBUILDDIR)/man/*; do \
198
	  sed -e '/^\.TP$$/ {' -e 'n' -e 's/^\.B //' -e '}' "$$f" > "$(srcdir)/man/$$(basename $$f)in"; \
199
	done
200 201
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The man pages are in man/."
202

203
else
204
html-local singlehtml pdf-local info-local man install-html-local install-singlehtml install-pdf-local install-info-local:
205
	$(AM_V_ECHO) "Please install sphinx (python-sphinx) to generate Knot DNS documentation."
206
endif # HAVE_SPHINXBUILD
Daniel Salzman's avatar
Daniel Salzman committed
207

208 209
endif # HAVE_DOCS

Daniel Salzman's avatar
Daniel Salzman committed
210
clean-local:
211
	-rm -rf $(SPHINXBUILDDIR)
212
	-rm -f man/*.1 man/*.5 man/*.8