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