]> git.proxmox.com Git - proxmox-backup.git/blame - docs/Makefile
Restructure docs (more first level headings)
[proxmox-backup.git] / docs / Makefile
CommitLineData
bb5c7707
DM
1include ../defines.mk
2
4bf0cc3b
DM
3GENERATED_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 \
45cc157f 9 reader-protocol-api.rst
bb5c7707 10
7ef486ae 11MANUAL_PAGES := \
e4a5ab8d 12 pxar.1 \
b933ed7f 13 proxmox-backup-proxy.1 \
028bd254
DM
14 proxmox-backup-client.1 \
15 proxmox-backup-manager.1
7ef486ae
DM
16
17
18# Sphinx documentation setup
19SPHINXOPTS =
20SPHINXBUILD = sphinx-build
7ef486ae
DM
21BUILDDIR = output
22
3a998863
TL
23ifeq ($(BUILD_MODE), release)
24COMPILEDIR := ../target/release
25SPHINXOPTS += -t release
26else
27COMPILEDIR := ../target/debug
28SPHINXOPTS += -t devbuild
29endif
30
7ef486ae 31# Sphinx internal variables.
c5ff1241 32ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
7ef486ae
DM
33
34all: ${MANUAL_PAGES}
35
177db84b
DM
36# Extract backup protocol docs
37backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api
38 ${COMPILEDIR}/dump-backup-api >$@
39
45cc157f
DM
40# Extract reader protocol docs
41reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api
42 ${COMPILEDIR}/dump-backup-api >$@
43
7ef486ae
DM
44# Build manual pages using rst2man
45
e4a5ab8d
DM
46pxar/synopsis.rst: ${COMPILEDIR}/pxar
47 ${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst
48
49pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst
50 rst2man $< >$@
51
7ef486ae 52proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
bb5c7707 53 ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
7ef486ae 54
4bf0cc3b
DM
55proxmox-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
58proxmox-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
bb5c7707
DM
59 rst2man $< >$@
60
028bd254
DM
61proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
62 ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
63
64proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
65 rst2man $< >$@
66
b933ed7f
DM
67proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
68 rst2man $< >$@
69
49df8ac1
OB
70.PHONY: onlinehelpinfo
71onlinehelpinfo:
72 @echo "Generating OnlineHelpInfo.js..."
73 $(SPHINXBUILD) -b proxmox-scanrefs $(ALLSPHINXOPTS) $(BUILDDIR)/scanrefs
74 @echo "Build finished. OnlineHelpInfo.js is in $(BUILDDIR)/scanrefs."
75
7ef486ae 76.PHONY: html
0d7e61f0 77html: ${GENERATED_SYNOPSIS} images/proxmox-logo.svg custom.css conf.py
7ef486ae 78 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
05c16a6e
TL
79 cp images/proxmox-logo.svg $(BUILDDIR)/html/_static/
80 cp custom.css $(BUILDDIR)/html/_static/
7ef486ae
DM
81 @echo
82 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
83
84.PHONY: latexpdf
177db84b 85latexpdf: ${GENERATED_SYNOPSIS}
fc598cdb 86 @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
7ef486ae 87 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
15d74eaa 88 @echo "Running LaTeX files through xelatex..."
7ef486ae 89 $(MAKE) -C $(BUILDDIR)/latex all-pdf
15d74eaa 90 @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
bb5c7707 91
7ef486ae 92.PHONY: epub3
177db84b 93epub3: ${GENERATED_SYNOPSIS}
7ef486ae
DM
94 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
95 @echo
96 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
bb5c7707
DM
97
98clean:
45cc157f 99 rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
bb5c7707 100
720776b8
DM
101
102install_manual_pages: ${MANUAL_PAGES}
bb5c7707 103 install -dm755 $(DESTDIR)$(MAN1DIR)
b933ed7f 104 for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done
720776b8
DM
105
106install_html: html
107 install -dm755 $(DESTDIR)$(DOCDIR)
da0e1e40 108 rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR)
720776b8
DM
109
110install_pdf: latexpdf
111 install -dm755 $(DESTDIR)$(DOCDIR)
112 install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf
113
114ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
115
116install: install_manual_pages
117
118else
119
120install: install_manual_pages install_html install_pdf
121
122endif