]> git.proxmox.com Git - pve-docs.git/blob - Makefile
define DOCRELEASE=4.1 inside pve-doc-generator.mk
[pve-docs.git] / Makefile
1 DGDIR=.
2
3 include ./pve-doc-generator.mk
4
5 PACKAGE=pve-doc-generator
6
7 # also update debian/changelog
8 PKGREL=1
9
10 DEB=${PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb
11
12
13 DEB_SOURCES= \
14 pve-doc-generator.mk \
15 attributes.txt \
16 pvesm.adoc \
17 pveum.adoc \
18 vzdump.adoc \
19 pve-firewall.adoc \
20 qm.adoc \
21 pct.adoc \
22 pveam.adoc \
23 ha-manager.adoc \
24 pve-copyright.adoc \
25 docinfo.xml
26
27 GEN_SCRIPTS= \
28 gen-datacenter-cfg-opts-adoc.pl \
29 gen-pct-conf-opts-adoc.pl \
30 gen-pve-firewall-cluster-opts.pl \
31 gen-pve-firewall-host-opts.pl \
32 gen-pve-firewall-macros-adoc.pl \
33 gen-pve-firewall-rules-opts.pl \
34 gen-pve-firewall-vm-opts.pl \
35 gen-vm-conf-opts-adoc.pl
36
37 PVESM_SOURCES=attributes.txt pvesm.adoc pvesm.1-synopsis.adoc $(shell ls pve-storage-*.adoc)
38 PVEUM_SOURCES=attributes.txt pveum.adoc pveum.1-synopsis.adoc
39 VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
40 QM_SOURCES=attributes.txt qm.adoc qm.1-synopsis.adoc
41 PCT_SOURCES=attributes.txt pct.adoc pct.1-synopsis.adoc
42 PVEAM_SOURCES=attributes.txt pveam.adoc pveam.1-synopsis.adoc
43 HA_SOURCES=attributes.txt ha-manager.1-synopsis.adoc ha-manager.adoc
44
45 SYSADMIN_SOURCES= \
46 getting-help.adoc \
47 pve-package-repos.adoc \
48 pve-installation.adoc \
49 system-software-updates.adoc \
50 sysadmin.adoc
51
52 PVE_ADMIN_GUIDE_SOURCES= \
53 datacenter.cfg.adoc \
54 datacenter.cfg.5-opts.adoc \
55 vm.conf.adoc \
56 vm.conf.5-opts.adoc \
57 pct.conf.adoc \
58 pct.conf.5-opts.adoc \
59 ${SYSADMIN_SOURCES} \
60 pve-admin-guide.adoc \
61 pve-intro.adoc \
62 pmxcfs.adoc \
63 pve-faq.adoc \
64 ${PVE_FIREWALL_MAN8_SOURCES} \
65 ${QM_SOURCES} \
66 ${PCT_SOURCES} \
67 ${PVEAM_SOURCES} \
68 ${PVEUM_SOURCES} \
69 ${PVESM_SOURCES} \
70 ${VZDUMP_SOURCES} \
71 ${HA_SOURCES} \
72 images/cluster-nwdiag.svg \
73 images/node-nwdiag.svg \
74 pve-bibliography.adoc \
75 GFDL.adoc \
76 attributes.txt
77
78 ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
79 ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
80 ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
81 ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
82
83 BROWSER?=xdg-open
84
85 all: pve-admin-guide.html
86
87 %-nwdiag.svg: %.nwdiag
88 nwdiag -T svg $*.nwdiag -o $@;
89
90 %.1: %.adoc %.1-synopsis.adoc docinfo.xml attributes.txt
91 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
92 test -n "$${NOVIEW}" || man -l $@
93
94 %.1.html: %.adoc %.1-synopsis.adoc docinfo.xml attributes.txt
95 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
96 test -n "$${NOVIEW}" || $(BROWSER) $@ &
97
98
99 %.8-synopsis.adoc:
100 perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
101 mv $@.tmp $@
102
103 %.8: %.adoc %.8-synopsis.adoc docinfo.xml
104 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
105 test -n "$${NOVIEW}" || man -l $@
106
107 %.8.html: %.adoc %.8-synopsis.adoc docinfo.xml
108 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
109 test -n "$${NOVIEW}" || $(BROWSER) $@ &
110
111 %.5: %.adoc %.5-opts.adoc docinfo.xml
112 a2x -a docinfo1 -a "manvolnum=5" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
113 test -n "$${NOVIEW}" || man -l $@
114
115 %.5.html: %.adoc %.5-opts.adoc docinfo.xml
116 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
117 test -n "$${NOVIEW}" || $(BROWSER) $@ &
118
119 index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
120 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
121 $(MAKE) NOVIEW=1 qm.1.html pct.1.html pveam.1.html pvesm.1.html pveum.1.html vzdump.1.html pve-firewall.8.html ha-manager.1.html datacenter.cfg.5.html vm.conf.5.html pct.conf.5.html
122 asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
123 test -n "$${NOVIEW}" || $(BROWSER) index.html &
124
125 pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
126 asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
127 test -n "$${NOVIEW}" || $(BROWSER) $@ &
128
129 pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
130 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
131 a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" pve-admin-guide.adoc
132 test -n "$${NOVIEW}" || $(BROWSER) $@ &
133
134 pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
135 a2x -f epub pve-admin-guide.adoc
136 test -n "$${NOVIEW}" || $(BROWSER) $@ &
137
138 .PHONY: dinstall
139 dinstall: ${DEB}
140 dpkg -i ${DEB}
141
142 .PHONY: deb
143 ${DEB} deb:
144 rm -rf build
145 mkdir build
146 rsync -a debian/ build/debian
147 mkdir -p build/usr/share/${PACKAGE}
148 install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE}
149 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE}
150 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
151 lintian ${DEB}
152
153
154 update: clean
155 rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
156 make all
157
158 clean:
159 rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
160