]> git.proxmox.com Git - proxmox-backup.git/blame - docs/Makefile
d/control: add proper rust build-dependencies
[proxmox-backup.git] / docs / Makefile
CommitLineData
bb5c7707
DM
1include ../defines.mk
2
3ifeq ($(BUILD_MODE), release)
4COMPILEDIR := ../target/release
5else
6COMPILEDIR := ../target/debug
7endif
8
4bf0cc3b
DM
9GENERATED_SYNOPSIS := \
10 proxmox-backup-client/synopsis.rst \
11 proxmox-backup-client/catalog-shell-synopsis.rst \
12 proxmox-backup-manager/synopsis.rst \
13 pxar/synopsis.rst \
14 backup-protocol-api.rst \
45cc157f 15 reader-protocol-api.rst
bb5c7707 16
7ef486ae 17MANUAL_PAGES := \
e4a5ab8d 18 pxar.1 \
b933ed7f 19 proxmox-backup-proxy.1 \
028bd254
DM
20 proxmox-backup-client.1 \
21 proxmox-backup-manager.1
7ef486ae
DM
22
23
24# Sphinx documentation setup
25SPHINXOPTS =
26SPHINXBUILD = sphinx-build
7ef486ae
DM
27BUILDDIR = output
28
29# Sphinx internal variables.
c5ff1241 30ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
7ef486ae
DM
31
32all: ${MANUAL_PAGES}
33
177db84b
DM
34# Extract backup protocol docs
35backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api
36 ${COMPILEDIR}/dump-backup-api >$@
37
45cc157f
DM
38# Extract reader protocol docs
39reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api
40 ${COMPILEDIR}/dump-backup-api >$@
41
7ef486ae
DM
42# Build manual pages using rst2man
43
e4a5ab8d
DM
44pxar/synopsis.rst: ${COMPILEDIR}/pxar
45 ${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst
46
47pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst
48 rst2man $< >$@
49
7ef486ae 50proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
bb5c7707 51 ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
7ef486ae 52
4bf0cc3b
DM
53proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli
54 ${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst
55
56proxmox-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
57 rst2man $< >$@
58
028bd254
DM
59proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
60 ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
61
62proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
63 rst2man $< >$@
64
b933ed7f
DM
65proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
66 rst2man $< >$@
67
7ef486ae
DM
68.PHONY: html
69html: ${GENERATED_SYNOPSIS}
70 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
71 @echo
72 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
73
74.PHONY: latexpdf
177db84b 75latexpdf: ${GENERATED_SYNOPSIS}
7ef486ae
DM
76 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
77 @echo "Running LaTeX files through pdflatex..."
78 $(MAKE) -C $(BUILDDIR)/latex all-pdf
79 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
bb5c7707 80
7ef486ae 81.PHONY: epub3
177db84b 82epub3: ${GENERATED_SYNOPSIS}
7ef486ae
DM
83 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
84 @echo
85 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
bb5c7707
DM
86
87clean:
45cc157f 88 rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
bb5c7707 89
720776b8
DM
90
91install_manual_pages: ${MANUAL_PAGES}
bb5c7707 92 install -dm755 $(DESTDIR)$(MAN1DIR)
b933ed7f 93 for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done
720776b8
DM
94
95install_html: html
96 install -dm755 $(DESTDIR)$(DOCDIR)
97 rsync -a output/html $(DESTDIR)$(DOCDIR)
98
99install_pdf: latexpdf
100 install -dm755 $(DESTDIR)$(DOCDIR)
101 install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf
102
103ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
104
105install: install_manual_pages
106
107else
108
109install: install_manual_pages install_html install_pdf
110
111endif