define DOCRELEASE=4.1 inside 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_FIREWALL_MAN8_SOURCES= \
9 pve-firewall.adoc \
10 pve-firewall.8-synopsis.adoc \
11 pve-firewall-cluster-opts.adoc \
12 pve-firewall-host-opts.adoc \
13 pve-firewall-vm-opts.adoc \
14 pve-firewall-rules-opts.adoc \
15 pve-firewall-macros.adoc \
16 attributes.txt \
17 docinfo.xml
18
19 attributes.txt docinfo.xml:
20 cp ${DGDIR}/$@ $@.tmp
21 mv $@.tmp $@
22
23 %-opts.adoc: ${DGDIR}/gen-%-opts.pl
24 $< >$@.tmp
25 mv $@.tmp $@
26
27 %.adoc: ${DGDIR}/gen-%-adoc.pl
28 $< >$@.tmp
29 mv $@.tmp $@
30
31 %.1-synopsis.adoc:
32 perl -I. -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
33 mv $@.tmp $@
34
35 %.8-synopsis.adoc:
36 perl -I. -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
37 mv $@.tmp $@
38
39 %.adoc: ${DGDIR}/%.adoc
40 cp $< $@.tmp
41 mv $@.tmp $@
42
43 pve-firewall.8: ${PVE_FIREWALL_MAN8_SOURCES}
44 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${DOCRELEASE}" -f manpage pve-firewall.adoc
45 test -n "$${NOVIEW}" || man -l $@
46
47
48 .PHONY: cleanup-docgen
49 cleanup-docgen:
50 rm -f *.1 *.8 *.adoc attributes.txt docinfo.xml