update README.adoc
[pve-docs.git] / pve-doc-generator.mk
CommitLineData
bef0c1b4
DM
1# also update debian/changelog
2DOCRELEASE=4.1
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 \
36 pve-storage-nfs.adoc \
37 pve-storage-rbd.adoc \
38 pve-storage-zfspool.adoc \
39 ${PVE_COMMON_DOC_SOURCES}
9344ee0d 40
f6b81378
DM
41PCT_MAN1_SOURCES= \
42 pct.adoc \
43 pct.1-synopsis.adoc \
44 ${PVE_COMMON_DOC_SOURCES}
45
9344ee0d
DM
46attributes.txt docinfo.xml:
47 cp ${DGDIR}/$@ $@.tmp
48 mv $@.tmp $@
49
50%-opts.adoc: ${DGDIR}/gen-%-opts.pl
f6b81378 51 ${DGDIR}/gen-$*-opts.pl >$@.tmp
9344ee0d
DM
52 mv $@.tmp $@
53
54%.adoc: ${DGDIR}/gen-%-adoc.pl
f6b81378 55 ${DGDIR}/gen-$*-adoc.pl >$@.tmp
9344ee0d
DM
56 mv $@.tmp $@
57
58%.1-synopsis.adoc:
59 perl -I. -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
60 mv $@.tmp $@
61
62%.8-synopsis.adoc:
63 perl -I. -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
64 mv $@.tmp $@
65
f6b81378 66ifneq (${DGDIR},.)
9344ee0d
DM
67%.adoc: ${DGDIR}/%.adoc
68 cp $< $@.tmp
69 mv $@.tmp $@
f6b81378 70endif
9344ee0d
DM
71
72pve-firewall.8: ${PVE_FIREWALL_MAN8_SOURCES}
bef0c1b4 73 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${DOCRELEASE}" -f manpage pve-firewall.adoc
9344ee0d
DM
74 test -n "$${NOVIEW}" || man -l $@
75
828a27f5
DM
76pvesm.1: ${PVESM_MAN1_SOURCES}
77 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage pvesm.adoc
78 test -n "$${NOVIEW}" || man -l $@
79
f6b81378
DM
80pct.1: ${PCT_MAN1_SOURCES}
81 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage pct.adoc
82 test -n "$${NOVIEW}" || man -l $@
83
d8742b0c
DM
84pvecm.1: ${PVECM_MAN1_SOURCES}
85 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage pvecm.adoc
86 test -n "$${NOVIEW}" || man -l $@
87
b0f56e11
DM
88%.5: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
89 a2x -a docinfo1 -a "manvolnum=5" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
f6b81378 90 test -n "$${NOVIEW}" || man -l $@
9344ee0d
DM
91
92.PHONY: cleanup-docgen
93cleanup-docgen:
94 rm -f *.1 *.8 *.adoc attributes.txt docinfo.xml