]> git.proxmox.com Git - proxmox-backup.git/blob - docs/Makefile
docs: add backup reader protocol
[proxmox-backup.git] / docs / Makefile
1 include ../defines.mk
2
3 ifeq ($(BUILD_MODE), release)
4 COMPILEDIR := ../target/release
5 else
6 COMPILEDIR := ../target/debug
7 endif
8
9 GENERATED_SYNOPSIS := \
10 proxmox-backup-client/synopsis.rst \
11 proxmox-backup-manager/synopsis.rst \
12 backup-protocol-api.rst \
13 reader-protocol-api.rst
14
15 MANUAL_PAGES := \
16 pxar.1 \
17 proxmox-backup-proxy.1 \
18 proxmox-backup-client.1 \
19 proxmox-backup-manager.1
20
21
22 # Sphinx documentation setup
23 SPHINXOPTS =
24 SPHINXBUILD = sphinx-build
25 PAPER =
26 BUILDDIR = output
27
28 # Sphinx internal variables.
29 PAPEROPT_a4 = -D latex_paper_size=a4
30 PAPEROPT_letter = -D latex_paper_size=letter
31 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
32 # the i18n builder cannot share the environment and doctrees with the others
33 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(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.1: proxmox-backup-client/man1.rst proxmox-backup-client/description.rst proxmox-backup-client/synopsis.rst
57 rst2man $< >$@
58
59 proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
60 ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
61
62 proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
63 rst2man $< >$@
64
65 proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
66 rst2man $< >$@
67
68 .PHONY: html
69 html: ${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
75 latexpdf: ${GENERATED_SYNOPSIS}
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."
80
81 .PHONY: epub3
82 epub3: ${GENERATED_SYNOPSIS}
83 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
84 @echo
85 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
86
87 clean:
88 rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
89
90 install: ${MANUAL_PAGES}
91 install -dm755 $(DESTDIR)$(MAN1DIR)
92 for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done