]> git.proxmox.com Git - proxmox-backup.git/blob - docs/Makefile
docs: conf: fix conf for new alabaster theme version
[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 # Sphinx internal variables.
32 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
33
34 all: ${MANUAL_PAGES}
35
36 # Extract backup protocol docs
37 backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api
38 ${COMPILEDIR}/dump-backup-api >$@
39
40 # Extract reader protocol docs
41 reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api
42 ${COMPILEDIR}/dump-backup-api >$@
43
44 # Build manual pages using rst2man
45
46 pxar/synopsis.rst: ${COMPILEDIR}/pxar
47 ${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst
48
49 pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst
50 rst2man $< >$@
51
52 proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
53 ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
54
55 proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli
56 ${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst
57
58 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
59 rst2man $< >$@
60
61 proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
62 ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
63
64 proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
65 rst2man $< >$@
66
67 proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
68 rst2man $< >$@
69
70 .PHONY: onlinehelpinfo
71 onlinehelpinfo:
72 @echo "Generating OnlineHelpInfo.js..."
73 $(SPHINXBUILD) -b proxmox-scanrefs $(ALLSPHINXOPTS) $(BUILDDIR)/scanrefs
74 @echo "Build finished. OnlineHelpInfo.js is in $(BUILDDIR)/scanrefs."
75
76 .PHONY: html
77 html: ${GENERATED_SYNOPSIS}
78 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
79 cp images/proxmox-logo.svg $(BUILDDIR)/html/_static/
80 cp custom.css $(BUILDDIR)/html/_static/
81 @echo
82 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
83
84 .PHONY: latexpdf
85 latexpdf: ${GENERATED_SYNOPSIS}
86 @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
87 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
88 @echo "Running LaTeX files through xelatex..."
89 $(MAKE) -C $(BUILDDIR)/latex all-pdf
90 @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
91
92 .PHONY: epub3
93 epub3: ${GENERATED_SYNOPSIS}
94 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
95 @echo
96 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
97
98 clean:
99 rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
100
101
102 install_manual_pages: ${MANUAL_PAGES}
103 install -dm755 $(DESTDIR)$(MAN1DIR)
104 for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done
105
106 install_html: html
107 install -dm755 $(DESTDIR)$(DOCDIR)
108 rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR)
109
110 install_pdf: latexpdf
111 install -dm755 $(DESTDIR)$(DOCDIR)
112 install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf
113
114 ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
115
116 install: install_manual_pages
117
118 else
119
120 install: install_manual_pages install_html install_pdf
121
122 endif