]> git.proxmox.com Git - pve-docs.git/blame - pve-doc-generator.mk
pve-docs-mediawiki-import: fix syntax error
[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
fcace69a
FG
142PVEPERF_MAN1_SOURCES= \
143 pveperf.adoc \
144 pveperf.1-synopsis.adoc \
145 ${PVE_COMMON_DOC_SOURCES}
146
9344ee0d
DM
147attributes.txt docinfo.xml:
148 cp ${DGDIR}/$@ $@.tmp
149 mv $@.tmp $@
150
151%-opts.adoc: ${DGDIR}/gen-%-opts.pl
f6b81378 152 ${DGDIR}/gen-$*-opts.pl >$@.tmp
9344ee0d
DM
153 mv $@.tmp $@
154
155%.adoc: ${DGDIR}/gen-%-adoc.pl
f6b81378 156 ${DGDIR}/gen-$*-adoc.pl >$@.tmp
9344ee0d
DM
157 mv $@.tmp $@
158
fcace69a
FG
159pveperf.1-synopsis.adoc:
160 echo '*pveperf* `[PATH]`' > pveperf.1-synopsis.adoc
161
9344ee0d 162%.1-synopsis.adoc:
2fcf16df 163 perl -I. -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp
9344ee0d
DM
164 mv $@.tmp $@
165
166%.8-synopsis.adoc:
2fcf16df 167 perl -I. -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsis();" > $@.tmp
9344ee0d
DM
168 mv $@.tmp $@
169
f6b81378 170ifneq (${DGDIR},.)
9344ee0d
DM
171%.adoc: ${DGDIR}/%.adoc
172 cp $< $@.tmp
173 mv $@.tmp $@
f6b81378 174endif
9344ee0d 175
c93c5829
DM
176# asciidoc /etc/asciidoc/docbook-xsl/manpage.xsl skip REFERENCES section
177# like footnotes, so we cannot use a2x. We use xmlto instead.
178#A2MAN_COMMON=a2x -v -k -a docinfo1 -a "manversion=Release ${DOCRELEASE}" -f manpage
179#A2MAN1=${A2MAN_COMMON} -a "manvolnum=1"
180#A2MAN5=${A2MAN_COMMON} -a "manvolnum=5"
181#A2MAN8=${A2MAN_COMMON} -a "manvolnum=8"
182
183A2MAN_COMMON=asciidoc -dmanpage -bdocbook -a docinfo1
184
185define A2MAN1
bca311e4
DM
186${A2MAN_COMMON} -a "manvolnum=1" -o $1.tmp.xml $1.adoc
187xmlto -v man $1.tmp.xml
188@rm -f $1.tmp.xml
c93c5829
DM
189endef
190
191define A2MAN5
bca311e4
DM
192${A2MAN_COMMON} -a "manvolnum=5" -o $1.tmp.xml $1.adoc
193xmlto -v man $1.tmp.xml
194@rm -f $1.tmp.xml
c93c5829
DM
195endef
196
197define A2MAN8
bca311e4
DM
198${A2MAN_COMMON} -a "manvolnum=8" -o $1.tmp.xml $1.adoc
199xmlto -v man $1.tmp.xml
200@rm -f $1.tmp.xml
c93c5829 201endef
872bbc1b 202
9344ee0d 203pve-firewall.8: ${PVE_FIREWALL_MAN8_SOURCES}
c93c5829 204 $(call A2MAN8,pve-firewall)
9344ee0d
DM
205 test -n "$${NOVIEW}" || man -l $@
206
828a27f5 207pvesm.1: ${PVESM_MAN1_SOURCES}
c93c5829 208 $(call A2MAN1,pvesm)
828a27f5
DM
209 test -n "$${NOVIEW}" || man -l $@
210
0840a663 211pveceph.1: ${PVECEPH_MAN1_SOURCES}
c93c5829 212 $(call A2MAN1,pveceph)
0840a663
DM
213 test -n "$${NOVIEW}" || man -l $@
214
f6b81378 215pct.1: ${PCT_MAN1_SOURCES}
c93c5829 216 $(call A2MAN1,pct)
f6b81378
DM
217 test -n "$${NOVIEW}" || man -l $@
218
6198e7c5 219vzdump.1: ${VZDUMP_MAN1_SOURCES}
c93c5829 220 $(call A2MAN1,vzdump)
6198e7c5
DM
221 test -n "$${NOVIEW}" || man -l $@
222
ebd2a7fb 223pvesubscription.1: ${PVESUBSCRIPTION_MAN1_SOURCES}
c93c5829 224 $(call A2MAN1,pvesubscription)
ebd2a7fb
DM
225 test -n "$${NOVIEW}" || man -l $@
226
7f8858a2 227qm.1: ${QM_MAN1_SOURCES}
c93c5829 228 $(call A2MAN1,qm)
7f8858a2
DM
229 test -n "$${NOVIEW}" || man -l $@
230
a5bb4c40 231qmrestore.1: ${QMRESTORE_MAN1_SOURCES}
c93c5829 232 $(call A2MAN1,qmrestore)
a5bb4c40
DM
233 test -n "$${NOVIEW}" || man -l $@
234
d8742b0c 235pvecm.1: ${PVECM_MAN1_SOURCES}
c93c5829 236 $(call A2MAN1,pvecm)
d8742b0c
DM
237 test -n "$${NOVIEW}" || man -l $@
238
d7810cdb 239pveum.1: ${PVEUM_MAN1_SOURCES}
c93c5829 240 $(call A2MAN1,pveum)
d7810cdb
DM
241 test -n "$${NOVIEW}" || man -l $@
242
6198e7c5 243pveam.1: ${PVEAM_MAN1_SOURCES}
c93c5829 244 $(call A2MAN1,pveam)
6198e7c5
DM
245 test -n "$${NOVIEW}" || man -l $@
246
e26d2ff0 247ha-manager.1: ${HA_MANAGER_MAN1_SOURCES}
c93c5829 248 $(call A2MAN1,ha-manager)
e26d2ff0
DM
249 test -n "$${NOVIEW}" || man -l $@
250
47e1b0c6 251pve-ha-crm.8: ${PVE_HA_CRM_MAN8_SOURCES}
c93c5829 252 $(call A2MAN8,pve-ha-crm)
47e1b0c6
DM
253 test -n "$${NOVIEW}" || man -l $@
254
954a26fd 255pve-ha-lrm.8: ${PVE_HA_LRM_MAN8_SOURCES}
c93c5829 256 $(call A2MAN8,pve-ha-lrm)
954a26fd
DM
257 test -n "$${NOVIEW}" || man -l $@
258
4db6a3f3 259pvestatd.8: ${PVESTATD_MAN8_SOURCES}
c93c5829 260 $(call A2MAN8,pvestatd)
4db6a3f3
DM
261 test -n "$${NOVIEW}" || man -l $@
262
9ddb9dc3 263pvedaemon.8: ${PVEDAEMON_MAN8_SOURCES}
c93c5829 264 $(call A2MAN8,pvedaemon)
9ddb9dc3
DM
265 test -n "$${NOVIEW}" || man -l $@
266
96f2beeb 267pveproxy.8: ${PVEPROXY_MAN8_SOURCES}
c93c5829 268 $(call A2MAN8,pveproxy)
96f2beeb
DM
269 test -n "$${NOVIEW}" || man -l $@
270
2d8f1c92 271spiceproxy.8: ${SPICEPROXY_MAN8_SOURCES}
c93c5829 272 $(call A2MAN8,spiceproxy)
2d8f1c92
DM
273 test -n "$${NOVIEW}" || man -l $@
274
bd88f9d9 275pmxcfs.8: ${PMXCFS_MAN8_SOURCES}
c93c5829 276 $(call A2MAN8,pmxcfs)
bd88f9d9
DM
277 test -n "$${NOVIEW}" || man -l $@
278
672abac1
DM
279qm.conf.5: ${QM_CONF_MAN5_SOURCES}
280
281pct.conf.5: ${PCT_CONF_MAN5_SOURCES}
6ec3cd20 282
672abac1 283datacenter.cfg.5: ${DATACENTER_CONF_MAN5_SOURCES}
6ec3cd20 284
b0f56e11 285%.5: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
c93c5829 286 $(call A2MAN5,$*)
f6b81378 287 test -n "$${NOVIEW}" || man -l $@
9344ee0d
DM
288
289.PHONY: cleanup-docgen
290cleanup-docgen:
bca311e4 291 rm -f *.tmp.xml *.1 *.5 *.8 *.adoc attributes.txt docinfo.xml