summaryrefslogtreecommitdiffstats
path: root/doc/Makefile.am
blob: 9003067b4b659f41e75a2a3565b51a62cf5ecf46 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
MANPAGES_IN = \
	man/knot.conf.5in	\
	man/knotc.8in		\
	man/knotd.8in		\
	man/kcatalogprint.8in	\
	man/keymgr.8in		\
	man/kjournalprint.8in	\
	man/kdig.1in		\
	man/khost.1in		\
	man/knsupdate.1in	\
	man/knsec3hash.1in	\
	man/kzonecheck.1in	\
	man/kzonesign.1in	\
	man/kxdpgun.8in

MANPAGES_RST = \
	man_knotc.rst		\
	man_knotd.rst		\
	man_kcatalogprint.rst	\
	man_keymgr.rst		\
	man_kjournalprint.rst	\
	man_kdig.rst		\
	man_khost.rst		\
	man_knsupdate.rst	\
	man_knsec3hash.rst	\
	man_kzonecheck.rst	\
	man_kzonesign.rst	\
	man_kxdpgun.rst

EXTRA_DIST = \
	conf.py			\
	\
	appendices.rst		\
	configuration.rst	\
	index.rst		\
	installation.rst	\
	introduction.rst	\
	migration.rst		\
	modules.rst.in		\
	operation.rst		\
	reference.rst		\
	requirements.rst	\
	troubleshooting.rst	\
	utilities.rst		\
	\
	$(MANPAGES_IN)		\
	$(MANPAGES_RST)		\
	\
	logo.pdf		\
	logo.svg		\
	\
	theme_html

SPHINX_V = $(SPHINX_V_@AM_V@)
SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@)
SPHINX_V_0 = -q
SPHINX_V_1 = -n

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

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

SPHINXBUILDDIR = $(builddir)/_build

_SPHINXOPTS    = -c $(srcdir) \
	         -a \
	         $(SPHINX_V)

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

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

.PHONY: html-local singlehtml pdf-local info-local epub man install-html-local install-singlehtml install-pdf-local install-info-local install-epub

man_MANS =

if HAVE_DAEMON
man_MANS += \
	man/knot.conf.5		\
	man/knotc.8		\
	man/knotd.8
endif # HAVE_DAEMON

if HAVE_UTILS
if HAVE_DAEMON
man_MANS += \
	man/kcatalogprint.8	\
	man/keymgr.8		\
	man/kjournalprint.8	\
	man/kzonecheck.1	\
	man/kzonesign.1
endif # HAVE_DAEMON

man_MANS += \
	man/kdig.1		\
	man/khost.1		\
	man/knsupdate.1		\
	man/knsec3hash.1

if ENABLE_XDP
man_MANS += man/kxdpgun.8
endif # ENABLE_XDP
endif # HAVE_UTILS

man/knot.conf.5:	man/knot.conf.5in
man/knotc.8:		man/knotc.8in
man/knotd.8:		man/knotd.8in
man/kcatalogprint.8:	man/kcatalogprint.8in
man/keymgr.8:		man/keymgr.8in
man/kjournalprint.8:	man/kjournalprint.8in
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
man/kzonesign.1:	man/kzonesign.1in
man/kxdpgun.8:		man/kxdpgun.8in

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),' \
            $< > $@

.1in.1:
	$(man_SUBST)

.5in.5:
	$(man_SUBST)

.8in.8:
	$(man_SUBST)

if HAVE_DOCS

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

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/

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

install-singlehtml: singlehtml
	$(INSTALL) -d $(DESTDIR)/$(docdir) $(DESTDIR)/$(docdir)/_static
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/*.html $(DESTDIR)/$(docdir)/
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/singlehtml/_static/* $(DESTDIR)/$(docdir)/_static/

epub:
	$(AM_V_SPHINX)$(SPHINXBUILD) -b epub -A today=$(RELEASE_DATE) -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/epub
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The EPUB file is in $(SPHINXBUILDDIR)/epub/."

install-epub:
	$(INSTALL) -d $(DESTDIR)/$(docdir)
	$(INSTALL_DATA) $(SPHINXBUILDDIR)/epub/KnotDNS.epub $(DESTDIR)/$(docdir)/

if HAVE_PDFLATEX
pdf-local:
	$(AM_V_SPHINX)$(SPHINXBUILD) -b latex -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/latex
	$(MAKE) -C $(SPHINXBUILDDIR)/latex all-pdf
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The PDF file is in $(SPHINXBUILDDIR)/latex/."

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

else
pdf-local install-pdf-local:
	$(AM_V_ECHO) "You need to install pdflatex and re-run configure to be"
	$(AM_V_ECHO) "able to generate PDF documentation."
endif

if HAVE_MAKEINFO
info-local:
	$(AM_V_SPHINX)$(SPHINXBUILD) -b texinfo -d $(SPHINXBUILDDIR)/doctrees $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/texinfo
	$(MAKE) -C $(SPHINXBUILDDIR)/texinfo info
	$(AM_V_ECHO)
	$(AM_V_ECHO) "Build finished. The Info file is in $(SPHINXBUILDDIR)/texinfo/."

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

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

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

else
html-local singlehtml pdf-local info-local epub man install-html-local install-singlehtml install-pdf-local install-info-local install-epub:
	$(AM_V_ECHO) "Please install sphinx (python-sphinx) to generate Knot DNS documentation."
endif # HAVE_SPHINXBUILD

endif # HAVE_DOCS

clean-local:
	-rm -rf $(SPHINXBUILDDIR)
	-rm -f man/*.1 man/*.5 man/*.8