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