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