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