]> git.proxmox.com Git - pve-docs.git/blame - Makefile
containers: mountpoint section
[pve-docs.git] / Makefile
CommitLineData
bef0c1b4
DM
1DGDIR=.
2
3include ./pve-doc-generator.mk
deb7f2ea 4
9344ee0d
DM
5PACKAGE=pve-doc-generator
6
7# also update debian/changelog
8PKGREL=1
9
b4f3c18a
DM
10GITVERSION:=$(shell cat .git/refs/heads/master)
11
bef0c1b4 12DEB=${PACKAGE}_${DOCRELEASE}-${PKGREL}_amd64.deb
9344ee0d
DM
13
14
15DEB_SOURCES= \
16 pve-doc-generator.mk \
17 attributes.txt \
18 pvesm.adoc \
828a27f5
DM
19 pve-storage-dir.adoc \
20 pve-storage-glusterfs.adoc \
21 pve-storage-iscsi.adoc \
22 pve-storage-iscsidirect.adoc \
23 pve-storage-lvm.adoc \
24 pve-storage-nfs.adoc \
25 pve-storage-rbd.adoc \
26 pve-storage-zfspool.adoc \
d8742b0c 27 pvecm.adoc \
9344ee0d
DM
28 pveum.adoc \
29 vzdump.adoc \
30 pve-firewall.adoc \
31 qm.adoc \
a516edff 32 qmrestore.adoc \
f6b81378 33 vm.conf.adoc \
9344ee0d 34 pct.adoc \
f6b81378
DM
35 pct.conf.adoc \
36 datacenter.cfg.adoc \
9344ee0d
DM
37 pveam.adoc \
38 ha-manager.adoc \
47e1b0c6 39 pve-ha-crm.adoc \
954a26fd 40 pve-ha-lrm.adoc \
9344ee0d
DM
41 pve-copyright.adoc \
42 docinfo.xml
43
44GEN_SCRIPTS= \
f6b81378
DM
45 gen-datacenter.cfg.5-opts.pl \
46 gen-pct.conf.5-opts.pl \
47 gen-vm.conf.5-opts.pl \
9344ee0d
DM
48 gen-pve-firewall-cluster-opts.pl \
49 gen-pve-firewall-host-opts.pl \
50 gen-pve-firewall-macros-adoc.pl \
51 gen-pve-firewall-rules-opts.pl \
f6b81378 52 gen-pve-firewall-vm-opts.pl
9344ee0d 53
deb7f2ea 54VZDUMP_SOURCES=attributes.txt vzdump.adoc vzdump.1-synopsis.adoc
d61bab51 55PVEAM_SOURCES=attributes.txt pveam.adoc pveam.1-synopsis.adoc
deb7f2ea 56
d91f8c1e
DM
57SYSADMIN_SOURCES= \
58 getting-help.adoc \
59 pve-package-repos.adoc \
60 pve-installation.adoc \
61 system-software-updates.adoc \
62 sysadmin.adoc
63
deb7f2ea 64PVE_ADMIN_GUIDE_SOURCES= \
c016ebb7
DM
65 datacenter.cfg.adoc \
66 datacenter.cfg.5-opts.adoc \
7b2c36ae
DM
67 vm.conf.adoc \
68 vm.conf.5-opts.adoc \
71e16346
DM
69 pct.conf.adoc \
70 pct.conf.5-opts.adoc \
d91f8c1e 71 ${SYSADMIN_SOURCES} \
deb7f2ea
DM
72 pve-admin-guide.adoc \
73 pve-intro.adoc \
74 pmxcfs.adoc \
75 pve-faq.adoc \
9344ee0d 76 ${PVE_FIREWALL_MAN8_SOURCES} \
828a27f5 77 ${PVESM_MAN1_SOURCES} \
f6b81378 78 ${PCT_MAN1_SOURCES} \
d8742b0c 79 ${PVECM_MAN1_SOURCES} \
d7810cdb 80 ${PVEUM_MAN1_SOURCES} \
7f8858a2 81 ${QM_MAN1_SOURCES} \
a5bb4c40 82 ${QMRESTORE_MAN1_SOURCES} \
e26d2ff0 83 ${HA_MANAGER_MAN1_SOURCES} \
47e1b0c6 84 ${PVE_HA_CRM_MAN8_SOURCES} \
954a26fd 85 ${PVE_HA_LRM_MAN8_SOURCES} \
d61bab51 86 ${PVEAM_SOURCES} \
deb7f2ea
DM
87 ${VZDUMP_SOURCES} \
88 images/cluster-nwdiag.svg \
89 images/node-nwdiag.svg \
90 pve-bibliography.adoc \
caf01dfc 91 GFDL.adoc \
deb7f2ea
DM
92 attributes.txt
93
94ADOC_STDARG= -a icons -a data-uri -a "date=$(shell date)"
bef0c1b4
DM
95ADOC_MAN1_HTML_ARGS=-a "manvolnum=1" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
96ADOC_MAN5_HTML_ARGS=-a "manvolnum=5" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
97ADOC_MAN8_HTML_ARGS=-a "manvolnum=8" ${ADOC_STDARG} -a "revnumber=${DOCRELEASE}"
deb7f2ea 98
fc1090ef 99BROWSER?=xdg-open
df41beec 100
7b2c36ae
DM
101all: pve-admin-guide.html
102
deb7f2ea
DM
103%-nwdiag.svg: %.nwdiag
104 nwdiag -T svg $*.nwdiag -o $@;
105
bef0c1b4
DM
106%.1: %.adoc %.1-synopsis.adoc docinfo.xml attributes.txt
107 a2x -a docinfo1 -a "manvolnum=1" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
9344ee0d 108 test -n "$${NOVIEW}" || man -l $@
deb7f2ea 109
bef0c1b4 110%.1.html: %.adoc %.1-synopsis.adoc docinfo.xml attributes.txt
deb7f2ea 111 asciidoc ${ADOC_MAN1_HTML_ARGS} -o $@ $*.adoc
9344ee0d 112 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
113
114
115%.8-synopsis.adoc:
116 perl -e "use PVE::Service::$(subst -,_,$*);print PVE::Service::$(subst -,_,$*)->generate_asciidoc_synopsys();" > $@.tmp
117 mv $@.tmp $@
118
119%.8: %.adoc %.8-synopsis.adoc docinfo.xml
bef0c1b4 120 a2x -a docinfo1 -a "manvolnum=8" -a "manversion=Release ${DOCRELEASE}" -f manpage $*.adoc
9344ee0d 121 test -n "$${NOVIEW}" || man -l $@
deb7f2ea
DM
122
123%.8.html: %.adoc %.8-synopsis.adoc docinfo.xml
124 asciidoc ${ADOC_MAN8_HTML_ARGS} -o $@ $*.adoc
9344ee0d 125 test -n "$${NOVIEW}" || $(BROWSER) $@ &
71e16346 126
c016ebb7
DM
127%.5.html: %.adoc %.5-opts.adoc docinfo.xml
128 asciidoc ${ADOC_MAN5_HTML_ARGS} -o $@ $*.adoc
9344ee0d 129 test -n "$${NOVIEW}" || $(BROWSER) $@ &
c016ebb7 130
deb7f2ea
DM
131index.html: index.adoc ${PVE_ADMIN_GUIDE_SOURCES}
132 $(MAKE) NOVIEW=1 pve-admin-guide.pdf pve-admin-guide.html pve-admin-guide.epub
954a26fd 133 $(MAKE) NOVIEW=1 pvecm.1.html qm.1.html qmrestore.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 pve-ha-crm.8.html pve-ha-lrm.8.html datacenter.cfg.5.html vm.conf.5.html pct.conf.5.html
bef0c1b4 134 asciidoc -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}" index.adoc
9344ee0d 135 test -n "$${NOVIEW}" || $(BROWSER) index.html &
deb7f2ea
DM
136
137pve-admin-guide.html: ${PVE_ADMIN_GUIDE_SOURCES}
bef0c1b4 138 asciidoc -a "revnumber=${DOCRELEASE}" -a "date=$(shell date)" pve-admin-guide.adoc
9344ee0d 139 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea 140
2296c490 141pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml
bef0c1b4 142 grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false);
27125931 143 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
9344ee0d 144 test -n "$${NOVIEW}" || $(BROWSER) $@ &
deb7f2ea
DM
145
146pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES}
147 a2x -f epub pve-admin-guide.adoc
9344ee0d
DM
148 test -n "$${NOVIEW}" || $(BROWSER) $@ &
149
150.PHONY: dinstall
151dinstall: ${DEB}
152 dpkg -i ${DEB}
153
154.PHONY: deb
155${DEB} deb:
156 rm -rf build
157 mkdir build
158 rsync -a debian/ build/debian
159 mkdir -p build/usr/share/${PACKAGE}
b4f3c18a
DM
160 mkdir -p build/usr/share/doc/${PACKAGE}
161 echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build/usr/share/doc/${PACKAGE}/SOURCE
9344ee0d
DM
162 install -m 0644 ${DEB_SOURCES} build/usr/share/${PACKAGE}
163 install -m 0755 ${GEN_SCRIPTS} build/usr/share/${PACKAGE}
164 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
165 lintian ${DEB}
166
89e93b38
DM
167.PHONY: upload
168upload: ${DEB}
169 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o rw
170 mkdir -p /pve/${DOCRELEASE}/extra
171 rm -f /pve/${DOCRELEASE}/extra/${PACKAGE}_*.deb
172 rm -f /pve/${DOCRELEASE}/extra/Packages*
173 cp ${DEB} /pve/${DOCRELEASE}/extra
174 cd /pve/${DOCRELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
175 umount /pve/${DOCRELEASE}; mount /pve/${DOCRELEASE} -o ro
deb7f2ea 176
c016ebb7
DM
177update: clean
178 rm -f *.5-opts.adoc .1-synopsis.adoc .8-synopsis.adoc
179 make all
deb7f2ea
DM
180
181clean:
9344ee0d
DM
182 rm -rf *~ *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build
183