simplify makefile
[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
7f8858a2
DM
46QM_MAN1_SOURCES= \
47 qm.adoc \
48 qm.1-synopsis.adoc \
49 ${PVE_COMMON_DOC_SOURCES}
50
a5bb4c40
DM
51QMRESTORE_MAN1_SOURCES= \
52 qmrestore.adoc \
53 qmrestore.1-synopsis.adoc \
54 ${PVE_COMMON_DOC_SOURCES}
55
d7810cdb
DM
56PVEUM_MAN1_SOURCES= \
57 pveum.adoc \
58 pveum.1-synopsis.adoc \
59 ${PVE_COMMON_DOC_SOURCES}
60
e26d2ff0
DM
61HA_MANAGER_MAN1_SOURCES= \
62 ha-manager.adoc \
63 ha-manager.1-synopsis.adoc \
64 ${PVE_COMMON_DOC_SOURCES}
65
47e1b0c6
DM
66PVE_HA_CRM_MAN8_SOURCES= \
67 pve-ha-crm.adoc \
68 pve-ha-crm.8-synopsis.adoc \
69 ${PVE_COMMON_DOC_SOURCES}
70
954a26fd
DM
71PVE_HA_LRM_MAN8_SOURCES= \
72 pve-ha-lrm.adoc \
73 pve-ha-lrm.8-synopsis.adoc \
74 ${PVE_COMMON_DOC_SOURCES}
75
9344ee0d
DM
76attributes.txt docinfo.xml:
77 cp ${DGDIR}/$@ $@.tmp
78 mv $@.tmp $@
79
80%-opts.adoc: ${DGDIR}/gen-%-opts.pl
f6b81378 81 ${DGDIR}/gen-$*-opts.pl >$@.tmp
9344ee0d
DM
82 mv $@.tmp $@
83
84%.adoc: ${DGDIR}/gen-%-adoc.pl
f6b81378 85 ${DGDIR}/gen-$*-adoc.pl >$@.tmp
9344ee0d
DM
86 mv $@.tmp $@
87
88%.1-synopsis.adoc:
89 perl -I. -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
90 mv $@.tmp $@
91
92%.8-synopsis.adoc:
93 perl -I. -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
94 mv $@.tmp $@
95
f6b81378 96ifneq (${DGDIR},.)
9344ee0d
DM
97%.adoc: ${DGDIR}/%.adoc
98 cp $< $@.tmp
99 mv $@.tmp $@
f6b81378 100endif
9344ee0d 101
872bbc1b
DM
102A2X_MAN_COMMON_OPTIONS=-a docinfo1 -a "manversion=Release ${DOCRELEASE}" -f manpage
103A2X_MAN1_OPTIONS=${A2X_MAN_COMMON_OPTIONS} -a "manvolnum=1"
104A2X_MAN5_OPTIONS=${A2X_MAN_COMMON_OPTIONS} -a "manvolnum=5"
105A2X_MAN8_OPTIONS=${A2X_MAN_COMMON_OPTIONS} -a "manvolnum=8"
106
9344ee0d 107pve-firewall.8: ${PVE_FIREWALL_MAN8_SOURCES}
872bbc1b 108 a2x ${A2X_MAN8_OPTIONS} pve-firewall.adoc
9344ee0d
DM
109 test -n "$${NOVIEW}" || man -l $@
110
828a27f5 111pvesm.1: ${PVESM_MAN1_SOURCES}
872bbc1b 112 a2x ${A2X_MAN1_OPTIONS} pvesm.adoc
828a27f5
DM
113 test -n "$${NOVIEW}" || man -l $@
114
f6b81378 115pct.1: ${PCT_MAN1_SOURCES}
872bbc1b 116 a2x ${A2X_MAN1_OPTIONS} pct.adoc
f6b81378
DM
117 test -n "$${NOVIEW}" || man -l $@
118
7f8858a2 119qm.1: ${QM_MAN1_SOURCES}
872bbc1b 120 a2x ${A2X_MAN1_OPTIONS} qm.adoc
7f8858a2
DM
121 test -n "$${NOVIEW}" || man -l $@
122
a5bb4c40 123qmrestore.1: ${QMRESTORE_MAN1_SOURCES}
872bbc1b 124 a2x ${A2X_MAN1_OPTIONS} qmrestore.adoc
a5bb4c40
DM
125 test -n "$${NOVIEW}" || man -l $@
126
d8742b0c 127pvecm.1: ${PVECM_MAN1_SOURCES}
872bbc1b 128 a2x ${A2X_MAN1_OPTIONS} pvecm.adoc
d8742b0c
DM
129 test -n "$${NOVIEW}" || man -l $@
130
d7810cdb 131pveum.1: ${PVEUM_MAN1_SOURCES}
872bbc1b 132 a2x ${A2X_MAN1_OPTIONS} pveum.adoc
d7810cdb
DM
133 test -n "$${NOVIEW}" || man -l $@
134
e26d2ff0 135ha-manager.1: ${HA_MANAGER_MAN1_SOURCES}
872bbc1b 136 a2x ${A2X_MAN1_OPTIONS} ha-manager.adoc
e26d2ff0
DM
137 test -n "$${NOVIEW}" || man -l $@
138
47e1b0c6 139pve-ha-crm.8: ${PVE_HA_CRM_MAN8_SOURCES}
872bbc1b 140 a2x ${A2X_MAN8_OPTIONS} manpage pve-ha-crm.adoc
47e1b0c6
DM
141 test -n "$${NOVIEW}" || man -l $@
142
954a26fd 143pve-ha-lrm.8: ${PVE_HA_LRM_MAN8_SOURCES}
872bbc1b 144 a2x ${A2X_MAN8_OPTIONS} pve-ha-lrm.adoc
954a26fd
DM
145 test -n "$${NOVIEW}" || man -l $@
146
b0f56e11 147%.5: %.adoc %.5-opts.adoc ${PVE_COMMON_DOC_SOURCES}
872bbc1b 148 a2x ${A2X_MAN5_OPTIONS} $*.adoc
f6b81378 149 test -n "$${NOVIEW}" || man -l $@
9344ee0d
DM
150
151.PHONY: cleanup-docgen
152cleanup-docgen:
153 rm -f *.1 *.8 *.adoc attributes.txt docinfo.xml