]> git.proxmox.com Git - proxmox-backup.git/blob - docs/Makefile
docs: add manual page for proxmox-backup-proxy
[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
12 MANUAL_PAGES := \
13 proxmox-backup-proxy.1 \
14 proxmox-backup-client.1
15
16
17 # Sphinx documentation setup
18 SPHINXOPTS =
19 SPHINXBUILD = sphinx-build
20 PAPER =
21 BUILDDIR = output
22
23 # Sphinx internal variables.
24 PAPEROPT_a4 = -D latex_paper_size=a4
25 PAPEROPT_letter = -D latex_paper_size=letter
26 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
27 # the i18n builder cannot share the environment and doctrees with the others
28 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
29
30 all: ${MANUAL_PAGES}
31
32 # Build manual pages using rst2man
33
34 proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
35 ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
36
37
38 proxmox-backup-client.1: proxmox-backup-client/man1.rst proxmox-backup-client/description.rst proxmox-backup-client/synopsis.rst
39 rst2man $< >$@
40
41 proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
42 rst2man $< >$@
43
44 .PHONY: html
45 html: ${GENERATED_SYNOPSIS}
46 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
47 @echo
48 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
49
50 .PHONY: latexpdf
51 latexpdf:
52 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
53 @echo "Running LaTeX files through pdflatex..."
54 $(MAKE) -C $(BUILDDIR)/latex all-pdf
55 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
56
57 .PHONY: epub3
58 epub3:
59 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
60 @echo
61 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
62
63 clean:
64 rm -r -f *~ *.1 */synopsis.rst ${BUILDDIR}
65
66 install: ${MANUAL_PAGES}
67 install -dm755 $(DESTDIR)$(MAN1DIR)
68 for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done