]> git.proxmox.com Git - proxmox-backup.git/blob - docs/Makefile
fix build: install proxmox-tape man page
[proxmox-backup.git] / docs / Makefile
1 include ../defines.mk
2
3 GENERATED_SYNOPSIS := \
4 proxmox-tape/synopsis.rst \
5 proxmox-backup-client/synopsis.rst \
6 proxmox-backup-client/catalog-shell-synopsis.rst \
7 proxmox-backup-manager/synopsis.rst \
8 pxar/synopsis.rst \
9 pmtx/synopsis.rst \
10 pmt/synopsis.rst \
11 backup-protocol-api.rst \
12 reader-protocol-api.rst \
13 config/media-pool/config.rst \
14 config/tape/config.rst \
15 config/user/config.rst \
16 config/remote/config.rst \
17 config/sync/config.rst \
18 config/verification/config.rst \
19 config/acl/roles.rst \
20 config/datastore/config.rst
21
22 MAN1_PAGES := \
23 pxar.1 \
24 pmtx.1 \
25 pmt.1 \
26 proxmox-tape.1 \
27 proxmox-backup-proxy.1 \
28 proxmox-backup-client.1 \
29 proxmox-backup-manager.1
30
31 MAN5_PAGES := \
32 media-pool.cfg.5 \
33 tape.cfg.5 \
34 acl.cfg.5 \
35 user.cfg.5 \
36 remote.cfg.5 \
37 sync.cfg.5 \
38 verification.cfg.5 \
39 datastore.cfg.5
40
41 PRUNE_SIMULATOR_FILES := \
42 prune-simulator/index.html \
43 prune-simulator/documentation.html \
44 prune-simulator/clear-trigger.png \
45 prune-simulator/prune-simulator.js
46
47 LTO_BARCODE_FILES := \
48 lto-barcode/index.html \
49 lto-barcode/code39.js \
50 lto-barcode/prefix-field.js \
51 lto-barcode/label-style.js \
52 lto-barcode/tape-type.js \
53 lto-barcode/paper-size.js \
54 lto-barcode/page-layout.js \
55 lto-barcode/page-calibration.js \
56 lto-barcode/label-list.js \
57 lto-barcode/label-setup.js \
58 lto-barcode/lto-barcode.js
59
60 # Sphinx documentation setup
61 SPHINXOPTS =
62 SPHINXBUILD = sphinx-build
63 BUILDDIR = output
64
65 ifeq ($(BUILD_MODE), release)
66 COMPILEDIR := ../target/release
67 SPHINXOPTS += -t release
68 else
69 COMPILEDIR := ../target/debug
70 SPHINXOPTS += -t devbuild
71 endif
72
73 # Sphinx internal variables.
74 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
75
76 all: ${MAN1_PAGES} ${MAN5_PAGES}
77
78 # Extract backup protocol docs
79 backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api
80 ${COMPILEDIR}/dump-backup-api >$@
81
82 # Extract reader protocol docs
83 reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api
84 ${COMPILEDIR}/dump-backup-api >$@
85
86 # Build manual pages using rst2man
87
88 pxar/synopsis.rst: ${COMPILEDIR}/pxar
89 ${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst
90
91 pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst
92 rst2man $< >$@
93
94
95 pmtx/synopsis.rst: ${COMPILEDIR}/pmtx
96 ${COMPILEDIR}/pmtx printdoc > pmtx/synopsis.rst
97
98 pmtx.1: pmtx/man1.rst pmtx/description.rst pmtx/synopsis.rst
99 rst2man $< >$@
100
101
102 pmt/synopsis.rst: ${COMPILEDIR}/pmt
103 ${COMPILEDIR}/pmt printdoc > pmt/synopsis.rst
104
105 pmt.1: pmt/man1.rst pmt/description.rst pmt/options.rst pmt/synopsis.rst
106 rst2man $< >$@
107
108 config/datastore/config.rst: ${COMPILEDIR}/docgen
109 ${COMPILEDIR}/docgen datastore.cfg >$@
110
111 datastore.cfg.5: config/datastore/man5.rst config/datastore/config.rst config/datastore/format.rst
112 rst2man $< >$@
113
114 config/user/config.rst: ${COMPILEDIR}/docgen
115 ${COMPILEDIR}/docgen user.cfg >$@
116
117 user.cfg.5: config/user/man5.rst config/user/config.rst config/user/format.rst
118 rst2man $< >$@
119
120 config/remote/config.rst: ${COMPILEDIR}/docgen
121 ${COMPILEDIR}/docgen remote.cfg >$@
122
123 remote.cfg.5: config/remote/man5.rst config/remote/config.rst config/remote/format.rst
124 rst2man $< >$@
125
126 config/sync/config.rst: ${COMPILEDIR}/docgen
127 ${COMPILEDIR}/docgen sync.cfg >$@
128
129 sync.cfg.5: config/sync/man5.rst config/sync/config.rst config/sync/format.rst
130 rst2man $< >$@
131
132 config/verification/config.rst: ${COMPILEDIR}/docgen
133 ${COMPILEDIR}/docgen verification.cfg >$@
134
135 verification.cfg.5: config/verification/man5.rst config/verification/config.rst config/verification/format.rst
136 rst2man $< >$@
137
138 config/acl/roles.rst: ${COMPILEDIR}/docgen
139 ${COMPILEDIR}/docgen "config::acl::Role" >$@
140
141 acl.cfg.5: config/acl/man5.rst config/acl/roles.rst config/acl/format.rst
142 rst2man $< >$@
143
144 config/media-pool/config.rst: ${COMPILEDIR}/docgen
145 ${COMPILEDIR}/docgen media-pool.cfg >$@
146
147 media-pool.cfg.5: config/media-pool/man5.rst config/media-pool/config.rst config/media-pool/format.rst
148 rst2man $< >$@
149
150 config/tape/config.rst: ${COMPILEDIR}/docgen
151 ${COMPILEDIR}/docgen tape.cfg >$@
152
153 tape.cfg.5: config/tape/man5.rst config/tape/config.rst config/tape/format.rst
154 rst2man $< >$@
155
156 proxmox-tape/synopsis.rst: ${COMPILEDIR}/proxmox-tape
157 ${COMPILEDIR}/proxmox-tape printdoc > proxmox-tape/synopsis.rst
158
159 proxmox-tape.1: proxmox-tape/man1.rst proxmox-tape/description.rst proxmox-tape/synopsis.rst
160 rst2man $< >$@
161
162 proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
163 ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
164
165 proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli
166 ${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst
167
168 proxmox-backup-client.1: proxmox-backup-client/man1.rst proxmox-backup-client/description.rst proxmox-backup-client/synopsis.rst proxmox-backup-client/catalog-shell-synopsis.rst
169 rst2man $< >$@
170
171 proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
172 ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
173
174 proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
175 rst2man $< >$@
176
177 proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
178 rst2man $< >$@
179
180 .PHONY: onlinehelpinfo
181 onlinehelpinfo:
182 @echo "Generating OnlineHelpInfo.js..."
183 $(SPHINXBUILD) -b proxmox-scanrefs $(ALLSPHINXOPTS) $(BUILDDIR)/scanrefs
184 @echo "Build finished. OnlineHelpInfo.js is in $(BUILDDIR)/scanrefs."
185
186 .PHONY: html
187 html: ${GENERATED_SYNOPSIS} images/proxmox-logo.svg custom.css conf.py ${PRUNE_SIMULATOR_FILES} ${LTO_BARCODE_FILES}
188 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
189 install -m 0644 custom.js custom.css images/proxmox-logo.svg $(BUILDDIR)/html/_static/
190 install -dm 0755 $(BUILDDIR)/html/prune-simulator
191 install -m 0644 ${PRUNE_SIMULATOR_FILES} $(BUILDDIR)/html/prune-simulator
192 install -dm 0755 $(BUILDDIR)/html/lto-barcode
193 install -m 0644 ${LTO_BARCODE_FILES} $(BUILDDIR)/html/lto-barcode
194 @echo
195 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
196
197 .PHONY: latexpdf
198 latexpdf: ${GENERATED_SYNOPSIS}
199 @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
200 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
201 @echo "Running LaTeX files through xelatex..."
202 $(MAKE) -C $(BUILDDIR)/latex all-pdf
203 @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
204
205 .PHONY: epub3
206 epub3: ${GENERATED_SYNOPSIS}
207 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
208 @echo
209 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
210
211 clean:
212 rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
213
214
215 install_manual_pages: ${MAN1_PAGES} ${MAN5_PAGES}
216 install -dm755 $(DESTDIR)$(MAN1DIR)
217 for i in ${MAN1_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done
218 install -dm755 $(DESTDIR)$(MAN5DIR)
219 for i in ${MAN5_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN5DIR)/ ; done
220
221 install_html: html
222 install -dm755 $(DESTDIR)$(DOCDIR)
223 rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR)
224
225 install_pdf: latexpdf
226 install -dm755 $(DESTDIR)$(DOCDIR)
227 install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf
228
229 ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
230
231 install: install_manual_pages
232
233 else
234
235 install: install_manual_pages install_html install_pdf
236
237 endif