]> git.proxmox.com Git - proxmox-backup.git/blame - docs/Makefile
docs: fix references to changed refs
[proxmox-backup.git] / docs / Makefile
CommitLineData
bb5c7707
DM
1include ../defines.mk
2
4bf0cc3b
DM
3GENERATED_SYNOPSIS := \
4 proxmox-backup-client/synopsis.rst \
5 proxmox-backup-client/catalog-shell-synopsis.rst \
6 proxmox-backup-manager/synopsis.rst \
7 pxar/synopsis.rst \
c9727044 8 pmtx/synopsis.rst \
4c209d6b 9 pmt/synopsis.rst \
4bf0cc3b 10 backup-protocol-api.rst \
45cc157f 11 reader-protocol-api.rst
bb5c7707 12
7ef486ae 13MANUAL_PAGES := \
e4a5ab8d 14 pxar.1 \
c9727044 15 pmtx.1 \
4c209d6b 16 pmt.1 \
b933ed7f 17 proxmox-backup-proxy.1 \
028bd254
DM
18 proxmox-backup-client.1 \
19 proxmox-backup-manager.1
7ef486ae 20
3323798b
FE
21PRUNE_SIMULATOR_FILES := \
22 prune-simulator/index.html \
23 prune-simulator/documentation.html \
21b55284 24 prune-simulator/clear-trigger.png \
3323798b 25 prune-simulator/prune-simulator.js
7ef486ae 26
4a227b54
DM
27LTO_BARCODE_FILES := \
28 lto-barcode/index.html \
29 lto-barcode/code39.js \
30 lto-barcode/prefix-field.js \
31 lto-barcode/label-style.js \
32 lto-barcode/tape-type.js \
33 lto-barcode/paper-size.js \
34 lto-barcode/page-layout.js \
35 lto-barcode/page-calibration.js \
36 lto-barcode/label-list.js \
37 lto-barcode/label-setup.js \
38 lto-barcode/lto-barcode.js
39
7ef486ae
DM
40# Sphinx documentation setup
41SPHINXOPTS =
42SPHINXBUILD = sphinx-build
7ef486ae
DM
43BUILDDIR = output
44
3a998863
TL
45ifeq ($(BUILD_MODE), release)
46COMPILEDIR := ../target/release
47SPHINXOPTS += -t release
48else
49COMPILEDIR := ../target/debug
50SPHINXOPTS += -t devbuild
51endif
52
7ef486ae 53# Sphinx internal variables.
c5ff1241 54ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
7ef486ae
DM
55
56all: ${MANUAL_PAGES}
57
177db84b
DM
58# Extract backup protocol docs
59backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api
60 ${COMPILEDIR}/dump-backup-api >$@
61
45cc157f
DM
62# Extract reader protocol docs
63reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api
64 ${COMPILEDIR}/dump-backup-api >$@
65
7ef486ae
DM
66# Build manual pages using rst2man
67
e4a5ab8d
DM
68pxar/synopsis.rst: ${COMPILEDIR}/pxar
69 ${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst
70
71pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst
72 rst2man $< >$@
73
c9727044
DM
74
75pmtx/synopsis.rst: ${COMPILEDIR}/pmtx
76 ${COMPILEDIR}/pmtx printdoc > pmtx/synopsis.rst
77
78pmtx.1: pmtx/man1.rst pmtx/description.rst pmtx/synopsis.rst
79 rst2man $< >$@
80
81
4c209d6b
DM
82pmt/synopsis.rst: ${COMPILEDIR}/pmt
83 ${COMPILEDIR}/pmt printdoc > pmt/synopsis.rst
84
85pmt.1: pmt/man1.rst pmt/description.rst pmt/synopsis.rst
86 rst2man $< >$@
87
88
7ef486ae 89proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
bb5c7707 90 ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
7ef486ae 91
4bf0cc3b
DM
92proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli
93 ${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst
94
95proxmox-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
bb5c7707
DM
96 rst2man $< >$@
97
028bd254
DM
98proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
99 ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
100
101proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
102 rst2man $< >$@
103
b933ed7f
DM
104proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
105 rst2man $< >$@
106
49df8ac1
OB
107.PHONY: onlinehelpinfo
108onlinehelpinfo:
109 @echo "Generating OnlineHelpInfo.js..."
110 $(SPHINXBUILD) -b proxmox-scanrefs $(ALLSPHINXOPTS) $(BUILDDIR)/scanrefs
111 @echo "Build finished. OnlineHelpInfo.js is in $(BUILDDIR)/scanrefs."
112
7ef486ae 113.PHONY: html
4a227b54 114html: ${GENERATED_SYNOPSIS} images/proxmox-logo.svg custom.css conf.py ${PRUNE_SIMULATOR_FILES} ${LTO_BARCODE_FILES}
7ef486ae 115 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
8a40e226 116 install -m 0644 custom.js custom.css images/proxmox-logo.svg $(BUILDDIR)/html/_static/
3323798b
FE
117 install -dm 0755 $(BUILDDIR)/html/prune-simulator
118 install -m 0644 ${PRUNE_SIMULATOR_FILES} $(BUILDDIR)/html/prune-simulator
4a227b54
DM
119 install -dm 0755 $(BUILDDIR)/html/lto-barcode
120 install -m 0644 ${LTO_BARCODE_FILES} $(BUILDDIR)/html/lto-barcode
7ef486ae
DM
121 @echo
122 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
123
124.PHONY: latexpdf
177db84b 125latexpdf: ${GENERATED_SYNOPSIS}
fc598cdb 126 @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
7ef486ae 127 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
15d74eaa 128 @echo "Running LaTeX files through xelatex..."
7ef486ae 129 $(MAKE) -C $(BUILDDIR)/latex all-pdf
15d74eaa 130 @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
bb5c7707 131
7ef486ae 132.PHONY: epub3
177db84b 133epub3: ${GENERATED_SYNOPSIS}
7ef486ae
DM
134 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
135 @echo
136 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
bb5c7707
DM
137
138clean:
45cc157f 139 rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
bb5c7707 140
720776b8
DM
141
142install_manual_pages: ${MANUAL_PAGES}
bb5c7707 143 install -dm755 $(DESTDIR)$(MAN1DIR)
b933ed7f 144 for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done
720776b8
DM
145
146install_html: html
147 install -dm755 $(DESTDIR)$(DOCDIR)
da0e1e40 148 rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR)
720776b8
DM
149
150install_pdf: latexpdf
151 install -dm755 $(DESTDIR)$(DOCDIR)
152 install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf
153
154ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
155
156install: install_manual_pages
157
158else
159
160install: install_manual_pages install_html install_pdf
161
162endif