export pvesm.1 with pve-doc-generator.mk
[pve-docs.git] / pve-doc-generator.mk
1 # also update debian/changelog
2 DOCRELEASE=4.1
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 PVE_FIREWALL_MAN8_SOURCES= \
14 pve-firewall.adoc \
15 pve-firewall.8-synopsis.adoc \
16 pve-firewall-cluster-opts.adoc \
17 pve-firewall-host-opts.adoc \
18 pve-firewall-vm-opts.adoc \
19 pve-firewall-rules-opts.adoc \
20 pve-firewall-macros.adoc \
21 ${PVE_COMMON_DOC_SOURCES}
22
23 PVESM_MAN1_SOURCES= \
24 pvesm.adoc \
25 pvesm.1-synopsis.adoc \
26 pve-storage-dir.adoc \
27 pve-storage-glusterfs.adoc \
28 pve-storage-iscsi.adoc \
29 pve-storage-iscsidirect.adoc \
30 pve-storage-lvm.adoc \
31 pve-storage-nfs.adoc \
32 pve-storage-rbd.adoc \
33 pve-storage-zfspool.adoc \
34 ${PVE_COMMON_DOC_SOURCES}
35
36 attributes.txt docinfo.xml:
37 cp ${DGDIR}/$@ $@.tmp
38 mv $@.tmp $@
39
40 %-opts.adoc: ${DGDIR}/gen-%-opts.pl
41 $< >$@.tmp
42 mv $@.tmp $@
43
44 %.adoc: ${DGDIR}/gen-%-adoc.pl
45 $< >$@.tmp
46 mv $@.tmp $@
47
48 %.1-synopsis.adoc:
49 perl -I. -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
50 mv $@.tmp $@
51
52 %.8-synopsis.adoc:
53 perl -I. -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
54 mv $@.tmp $@
55
56 %.adoc: ${DGDIR}/%.adoc
57 cp $< $@.tmp
58 mv $@.tmp $@
59
60 pve-firewall.8: ${PVE_FIREWALL_MAN8_SOURCES}
61 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${DOCRELEASE}" -f manpage pve-firewall.adoc
62 test -n "$${NOVIEW}" || man -l $@
63
64 pvesm.1: ${PVESM_MAN1_SOURCES}
65 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage pvesm.adoc
66 test -n "$${NOVIEW}" || man -l $@
67
68
69 .PHONY: cleanup-docgen
70 cleanup-docgen:
71 rm -f *.1 *.8 *.adoc attributes.txt docinfo.xml