d636fb6085354feab7b1588f5bfd284338c51ae8
[pve-docs.git] / Makefile
1 RELEASE=4.1
2
3 PVESM_SOURCES=attributes.txt pvesm.adoc pvesm.1-synopsis.adoc $(shell ls pve-storage-*.adoc)
4 PVEUM_SOURCES=attributes.txt pveum.adoc pveum.1-synopsis.adoc
5 VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
6 PVEFW_SOURCES=attributes.txt pve-firewall.adoc pve-firewall.8-synopsis.adoc
7 QM_SOURCES=attributes.txt qm.adoc qm.1-synopsis.adoc
8 PCT_SOURCES=attributes.txt pct.adoc pct.1-synopsis.adoc
9 HA_SOURCES=attributes.txt ha-manager.1-synopsis.adoc ha-manager.adoc
10
11 SYSADMIN_SOURCES= \
12 getting-help.adoc \
13 pve-package-repos.adoc \
14 pve-installation.adoc \
15 system-software-updates.adoc \
16 sysadmin.adoc
17
18 PVE_ADMIN_GUIDE_SOURCES= \
19 ${SYSADMIN_SOURCES} \
20 pve-admin-guide.adoc \
21 pve-intro.adoc \
22 pmxcfs.adoc \
23 pve-faq.adoc \
24 ${QM_SOURCES} \
25 ${PCT_SOURCES} \
26 ${PVEFW_SOURCES} \
27 ${PVEUM_SOURCES} \
28 ${PVESM_SOURCES} \
29 ${VZDUMP_SOURCES} \
30 ${HA_SOURCES} \
31 images/cluster-nwdiag.svg \
32 images/node-nwdiag.svg \
33 pve-bibliography.adoc \
34 GFDL.adoc \
35 attributes.txt
36
37 ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
38 ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${RELEASE}"
39 ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${RELEASE}"
40
41 BROWSER=xdg-open
42
43 %-nwdiag.svg: %.nwdiag
44 nwdiag -T svg $*.nwdiag -o $@;
45
46 %.1-synopsis.adoc:
47 perl -e "use PVE::CLI::$(subst -,_,$*);print PVE::CLI::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
48 mv $@.tmp $@
49
50 %.1: %.adoc %.1-synopsis.adoc docinfo.xml
51 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc
52 test -z "$${NOVIEW}" && man -l $@
53
54 %.1.html: %.adoc %.1-synopsis.adoc docinfo.xml
55 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
56 test -z "$${NOVIEW}" && $(BROWSER) $@ &
57
58
59 %.8-synopsis.adoc:
60 perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
61 mv $@.tmp $@
62
63 %.8: %.adoc %.8-synopsis.adoc docinfo.xml
64 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${RELEASE}" -f manpage $*.adoc
65 test -z "$${NOVIEW}" && man -l $@
66
67 %.8.html: %.adoc %.8-synopsis.adoc docinfo.xml
68 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
69 test -z "$${NOVIEW}" && $(BROWSER) $@ &
70
71
72 all: pve-admin-guide.html
73
74 index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
75 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
76 $(MAKE) NOVIEW=1 qm.1.html pct.1.html pvesm.1.html pveum.1.html vzdump.1.html pve-firewall.8.html ha-manager.1.html
77 asciidoc -a "date=$(shell date)" -a "revnumber=${RELEASE}" index.adoc
78 $(BROWSER) index.html &
79
80 pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
81 asciidoc -a "revnumber=${RELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
82 test -z "$${NOVIEW}" && $(BROWSER) $@ &
83
84 pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
85 grep ">Release ${RELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
86 a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" pve-admin-guide.adoc
87 test -z "$${NOVIEW}" && $(BROWSER) $@ &
88
89 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
90 a2x -f epub pve-admin-guide.adoc
91 test -z "$${NOVIEW}" && $(BROWSER) $@ &
92
93
94 clean:
95 rm -rf *~ *.html *.pdf *.epub *.1 *.8