call spell-corrected synopsis generator method
[pve-docs.git] / pve-doc-generator.mk
CommitLineData
bef0c1b4 1# also update debian/changelog
05a63379 2DOCRELEASE=4.3
bef0c1b4 3
9344ee0d
DM
4DGDIR?=/usr/share/pve-doc-generator
5
6all:
7
828a27f5
DM
8PVE_COMMON_DOC_SOURCES= \
9 attributes.txt \
10 pve-copyright.adoc \
11 docinfo.xml
12
d8742b0c
DM
13PVECM_MAN1_SOURCES= \
14 pvecm.adoc \
15 pvecm.1-synopsis.adoc \
16 ${PVE_COMMON_DOC_SOURCES}
17
9344ee0d
DM
18PVE_FIREWALL_MAN8_SOURCES= \
19 pve-firewall.adoc \
20 pve-firewall.8-synopsis.adoc \
21 pve-firewall-cluster-opts.adoc \
22 pve-firewall-host-opts.adoc \
23 pve-firewall-vm-opts.adoc \
24 pve-firewall-rules-opts.adoc \
25 pve-firewall-macros.adoc \
828a27f5
DM
26 ${PVE_COMMON_DOC_SOURCES}
27
28PVESM_MAN1_SOURCES= \
29 pvesm.adoc \
30 pvesm.1-synopsis.adoc \
31 pve-storage-dir.adoc \
32 pve-storage-glusterfs.adoc \
33 pve-storage-iscsi.adoc \
34 pve-storage-iscsidirect.adoc \
35 pve-storage-lvm.adoc \
82141a78 36 pve-storage-lvmthin.adoc \
828a27f5
DM
37 pve-storage-nfs.adoc \
38 pve-storage-rbd.adoc \
39 pve-storage-zfspool.adoc \
40 ${PVE_COMMON_DOC_SOURCES}
9344ee0d 41
6198e7c5
DM
42VZDUMP_MAN1_SOURCES= \
43 vzdump.adoc \
44 vzdump.1-synopsis.adoc \
d083d3d3 45 vzdump.conf.5-opts.adoc \
6198e7c5
DM
46 ${PVE_COMMON_DOC_SOURCES}
47
ebd2a7fb
DM
48PVESUBSCRIPTION_MAN1_SOURCES= \
49 pvesubscription.adoc \
50 pvesubscription.1-synopsis.adoc \
51 ${PVE_COMMON_DOC_SOURCES}
52
0840a663
DM
53PVECEPH_MAN1_SOURCES= \
54 pveceph.adoc \
55 pveceph.1-synopsis.adoc \
56 ${PVE_COMMON_DOC_SOURCES}
57
f6b81378
DM
58PCT_MAN1_SOURCES= \
59 pct.adoc \
60 pct.1-synopsis.adoc \
d9da05c2 61 pct.conf.5-opts.adoc \
bac8c385 62 pct-network-opts.adoc \
fe154a4f 63 pct-mountpoint-opts.adoc \
f6b81378
DM
64 ${PVE_COMMON_DOC_SOURCES}
65
672abac1 66PCT_CONF_MAN5_SOURCES= \
6ec3cd20
DM
67 pct.conf.adoc \
68 pct.conf.5-opts.adoc \
69 ${PVE_COMMON_DOC_SOURCES}
70
672abac1
DM
71DATACENTER_CONF_MAN5_SOURCES= \
72 datacenter.cfg.adoc \
73 datacenter.cfg.5-opts.adoc \
74 ${PVE_COMMON_DOC_SOURCES}
75
7f8858a2
DM
76QM_MAN1_SOURCES= \
77 qm.adoc \
78 qm.1-synopsis.adoc \
d9da05c2 79 qm.conf.5-opts.adoc \
7f8858a2
DM
80 ${PVE_COMMON_DOC_SOURCES}
81
672abac1 82QM_CONF_MAN5_SOURCES= \
6ec3cd20
DM
83 qm.conf.adoc \
84 qm.conf.5-opts.adoc \
85 ${PVE_COMMON_DOC_SOURCES}
86
a5bb4c40
DM
87QMRESTORE_MAN1_SOURCES= \
88 qmrestore.adoc \
89 qmrestore.1-synopsis.adoc \
90 ${PVE_COMMON_DOC_SOURCES}
91
d7810cdb
DM
92PVEUM_MAN1_SOURCES= \
93 pveum.adoc \
94 pveum.1-synopsis.adoc \
95 ${PVE_COMMON_DOC_SOURCES}
96
6198e7c5
DM
97PVEAM_MAN1_SOURCES= \
98 pveam.adoc \
99 pveam.1-synopsis.adoc \
100 ${PVE_COMMON_DOC_SOURCES}
101
102HA_MANAGER_MAN1_SOURCES= \
103 ha-manager.adoc \
104 ha-manager.1-synopsis.adoc \
e26d2ff0
DM
105 ${PVE_COMMON_DOC_SOURCES}
106
6198e7c5
DM
107PVE_HA_CRM_MAN8_SOURCES= \
108 pve-ha-crm.adoc \
109 pve-ha-crm.8-synopsis.adoc \
47e1b0c6
DM
110 ${PVE_COMMON_DOC_SOURCES}
111
6198e7c5
DM
112PVE_HA_LRM_MAN8_SOURCES= \
113 pve-ha-lrm.adoc \
114 pve-ha-lrm.8-synopsis.adoc \
954a26fd
DM
115 ${PVE_COMMON_DOC_SOURCES}
116
4db6a3f3
DM
117PVESTATD_MAN8_SOURCES= \
118 pvestatd.adoc \
119 pvestatd.8-synopsis.adoc \
120 ${PVE_COMMON_DOC_SOURCES}
121
9ddb9dc3
DM
122PVEDAEMON_MAN8_SOURCES= \
123 pvedaemon.adoc \
124 pvedaemon.8-synopsis.adoc \
125 ${PVE_COMMON_DOC_SOURCES}
126
96f2beeb
DM
127PVEPROXY_MAN8_SOURCES= \
128 pveproxy.adoc \
129 pveproxy.8-synopsis.adoc \
130 ${PVE_COMMON_DOC_SOURCES}
131
2d8f1c92
DM
132SPICEPROXY_MAN8_SOURCES= \
133 spiceproxy.adoc \
134 spiceproxy.8-synopsis.adoc \
135 ${PVE_COMMON_DOC_SOURCES}
136
bd88f9d9
DM
137PMXCFS_MAN8_SOURCES= \
138 pmxcfs.adoc \
139 pmxcfs.8-cli.adoc \
140 ${PVE_COMMON_DOC_SOURCES}
141
9344ee0d
DM
142attributes.txt docinfo.xml:
143 cp ${DGDIR}/$@ $@.tmp
144 mv $@.tmp $@
145
146%-opts.adoc: ${DGDIR}/gen-%-opts.pl
f6b81378 147 ${DGDIR}/gen-$*-opts.pl >$@.tmp
9344ee0d
DM
148 mv $@.tmp $@
149
150%.adoc: ${DGDIR}/gen-%-adoc.pl
f6b81378 151 ${DGDIR}/gen-$*-adoc.pl >$@.tmp
9344ee0d
DM
152 mv $@.tmp $@
153
154%.1-synopsis.adoc:
2fcf16df 155 perl -I. -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp
9344ee0d
DM
156 mv $@.tmp $@
157
158%.8-synopsis.adoc:
2fcf16df 159 perl -I. -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp
9344ee0d
DM
160 mv $@.tmp $@
161
f6b81378 162ifneq (${DGDIR},.)
9344ee0d
DM
163%.adoc: ${DGDIR}/%.adoc
164 cp $< $@.tmp
165 mv $@.tmp $@
f6b81378 166endif
9344ee0d 167
c93c5829
DM
168# asciidoc /etc/asciidoc/docbook-xsl/manpage.xsl skip REFERENCES section
169# like footnotes, so we cannot use a2x. We use xmlto instead.
170#A2MAN_COMMON=a2x -v -k -a docinfo1 -a "manversion=Release ${DOCRELEASE}" -f manpage
171#A2MAN1=${A2MAN_COMMON} -a "manvolnum=1"
172#A2MAN5=${A2MAN_COMMON} -a "manvolnum=5"
173#A2MAN8=${A2MAN_COMMON} -a "manvolnum=8"
174
175A2MAN_COMMON=asciidoc -dmanpage -bdocbook -a docinfo1
176
177define A2MAN1
bca311e4
DM
178${A2MAN_COMMON} -a "manvolnum=1" -o $1.tmp.xml $1.adoc
179xmlto -v man $1.tmp.xml
180@rm -f $1.tmp.xml
c93c5829
DM
181endef
182
183define A2MAN5
bca311e4
DM
184${A2MAN_COMMON} -a "manvolnum=5" -o $1.tmp.xml $1.adoc
185xmlto -v man $1.tmp.xml
186@rm -f $1.tmp.xml
c93c5829
DM
187endef
188
189define A2MAN8
bca311e4
DM
190${A2MAN_COMMON} -a "manvolnum=8" -o $1.tmp.xml $1.adoc
191xmlto -v man $1.tmp.xml
192@rm -f $1.tmp.xml
c93c5829 193endef
872bbc1b 194
9344ee0d 195pve-firewall.8: ${PVE_FIREWALL_MAN8_SOURCES}
c93c5829 196 $(call A2MAN8,pve-firewall)
9344ee0d
DM
197 test -n "$${NOVIEW}" || man -l $@
198
828a27f5 199pvesm.1: ${PVESM_MAN1_SOURCES}
c93c5829 200 $(call A2MAN1,pvesm)
828a27f5
DM
201 test -n "$${NOVIEW}" || man -l $@
202
0840a663 203pveceph.1: ${PVECEPH_MAN1_SOURCES}
c93c5829 204 $(call A2MAN1,pveceph)
0840a663
DM
205 test -n "$${NOVIEW}" || man -l $@
206
f6b81378 207pct.1: ${PCT_MAN1_SOURCES}
c93c5829 208 $(call A2MAN1,pct)
f6b81378
DM
209 test -n "$${NOVIEW}" || man -l $@
210
6198e7c5 211vzdump.1: ${VZDUMP_MAN1_SOURCES}
c93c5829 212 $(call A2MAN1,vzdump)
6198e7c5
DM
213 test -n "$${NOVIEW}" || man -l $@
214
ebd2a7fb 215pvesubscription.1: ${PVESUBSCRIPTION_MAN1_SOURCES}
c93c5829 216 $(call A2MAN1,pvesubscription)
ebd2a7fb
DM
217 test -n "$${NOVIEW}" || man -l $@
218
7f8858a2 219qm.1: ${QM_MAN1_SOURCES}
c93c5829 220 $(call A2MAN1,qm)
7f8858a2
DM
221 test -n "$${NOVIEW}" || man -l $@
222
a5bb4c40 223qmrestore.1: ${QMRESTORE_MAN1_SOURCES}
c93c5829 224 $(call A2MAN1,qmrestore)
a5bb4c40
DM
225 test -n "$${NOVIEW}" || man -l $@
226
d8742b0c 227pvecm.1: ${PVECM_MAN1_SOURCES}
c93c5829 228 $(call A2MAN1,pvecm)
d8742b0c
DM
229 test -n "$${NOVIEW}" || man -l $@
230
d7810cdb 231pveum.1: ${PVEUM_MAN1_SOURCES}
c93c5829 232 $(call A2MAN1,pveum)
d7810cdb
DM
233 test -n "$${NOVIEW}" || man -l $@
234
6198e7c5 235pveam.1: ${PVEAM_MAN1_SOURCES}
c93c5829 236 $(call A2MAN1,pveam)
6198e7c5
DM
237 test -n "$${NOVIEW}" || man -l $@
238
e26d2ff0 239ha-manager.1: ${HA_MANAGER_MAN1_SOURCES}
c93c5829 240 $(call A2MAN1,ha-manager)
e26d2ff0
DM
241 test -n "$${NOVIEW}" || man -l $@
242
47e1b0c6 243pve-ha-crm.8: ${PVE_HA_CRM_MAN8_SOURCES}
c93c5829 244 $(call A2MAN8,pve-ha-crm)
47e1b0c6
DM
245 test -n "$${NOVIEW}" || man -l $@
246
954a26fd 247pve-ha-lrm.8: ${PVE_HA_LRM_MAN8_SOURCES}
c93c5829 248 $(call A2MAN8,pve-ha-lrm)
954a26fd
DM
249 test -n "$${NOVIEW}" || man -l $@
250
4db6a3f3 251pvestatd.8: ${PVESTATD_MAN8_SOURCES}
c93c5829 252 $(call A2MAN8,pvestatd)
4db6a3f3
DM
253 test -n "$${NOVIEW}" || man -l $@
254
9ddb9dc3 255pvedaemon.8: ${PVEDAEMON_MAN8_SOURCES}
c93c5829 256 $(call A2MAN8,pvedaemon)
9ddb9dc3
DM
257 test -n "$${NOVIEW}" || man -l $@
258
96f2beeb 259pveproxy.8: ${PVEPROXY_MAN8_SOURCES}
c93c5829 260 $(call A2MAN8,pveproxy)
96f2beeb
DM
261 test -n "$${NOVIEW}" || man -l $@
262
2d8f1c92 263spiceproxy.8: ${SPICEPROXY_MAN8_SOURCES}
c93c5829 264 $(call A2MAN8,spiceproxy)
2d8f1c92
DM
265 test -n "$${NOVIEW}" || man -l $@
266
bd88f9d9 267pmxcfs.8: ${PMXCFS_MAN8_SOURCES}
c93c5829 268 $(call A2MAN8,pmxcfs)
bd88f9d9
DM
269 test -n "$${NOVIEW}" || man -l $@
270
672abac1
DM
271qm.conf.5: ${QM_CONF_MAN5_SOURCES}
272
273pct.conf.5: ${PCT_CONF_MAN5_SOURCES}
6ec3cd20 274
672abac1 275datacenter.cfg.5: ${DATACENTER_CONF_MAN5_SOURCES}
6ec3cd20 276
b0f56e11 277%.5: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
c93c5829 278 $(call A2MAN5,$*)
f6b81378 279 test -n "$${NOVIEW}" || man -l $@
9344ee0d
DM
280
281.PHONY: cleanup-docgen
282cleanup-docgen:
bca311e4 283 rm -f *.tmp.xml *.1 *.5 *.8 *.adoc attributes.txt docinfo.xml