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