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