]>
Commit | Line | Data |
---|---|---|
bb5c7707 DM |
1 | include ../defines.mk |
2 | ||
4bf0cc3b DM |
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 \ | |
45cc157f | 9 | reader-protocol-api.rst |
bb5c7707 | 10 | |
7ef486ae | 11 | MANUAL_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 | |
19 | SPHINXOPTS = | |
20 | SPHINXBUILD = sphinx-build | |
7ef486ae DM |
21 | BUILDDIR = output |
22 | ||
3a998863 TL |
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 | ||
7ef486ae | 31 | # Sphinx internal variables. |
c5ff1241 | 32 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . |
7ef486ae DM |
33 | |
34 | all: ${MANUAL_PAGES} | |
35 | ||
177db84b DM |
36 | # Extract backup protocol docs |
37 | backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api | |
38 | ${COMPILEDIR}/dump-backup-api >$@ | |
39 | ||
45cc157f DM |
40 | # Extract reader protocol docs |
41 | reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api | |
42 | ${COMPILEDIR}/dump-backup-api >$@ | |
43 | ||
7ef486ae DM |
44 | # Build manual pages using rst2man |
45 | ||
e4a5ab8d DM |
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 | ||
7ef486ae | 52 | proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client |
bb5c7707 | 53 | ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst |
7ef486ae | 54 | |
4bf0cc3b DM |
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 | |
bb5c7707 DM |
59 | rst2man $< >$@ |
60 | ||
028bd254 DM |
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 | ||
b933ed7f DM |
67 | proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst |
68 | rst2man $< >$@ | |
69 | ||
49df8ac1 OB |
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 | ||
7ef486ae DM |
76 | .PHONY: html |
77 | html: ${GENERATED_SYNOPSIS} | |
78 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html | |
79 | @echo | |
80 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | |
81 | ||
82 | .PHONY: latexpdf | |
177db84b | 83 | latexpdf: ${GENERATED_SYNOPSIS} |
fc598cdb | 84 | @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra" |
7ef486ae | 85 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
15d74eaa | 86 | @echo "Running LaTeX files through xelatex..." |
7ef486ae | 87 | $(MAKE) -C $(BUILDDIR)/latex all-pdf |
15d74eaa | 88 | @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." |
bb5c7707 | 89 | |
7ef486ae | 90 | .PHONY: epub3 |
177db84b | 91 | epub3: ${GENERATED_SYNOPSIS} |
7ef486ae DM |
92 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 |
93 | @echo | |
94 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." | |
bb5c7707 DM |
95 | |
96 | clean: | |
45cc157f | 97 | rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS} |
bb5c7707 | 98 | |
720776b8 DM |
99 | |
100 | install_manual_pages: ${MANUAL_PAGES} | |
bb5c7707 | 101 | install -dm755 $(DESTDIR)$(MAN1DIR) |
b933ed7f | 102 | for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done |
720776b8 DM |
103 | |
104 | install_html: html | |
105 | install -dm755 $(DESTDIR)$(DOCDIR) | |
da0e1e40 | 106 | rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR) |
720776b8 DM |
107 | |
108 | install_pdf: latexpdf | |
109 | install -dm755 $(DESTDIR)$(DOCDIR) | |
110 | install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf | |
111 | ||
112 | ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) | |
113 | ||
114 | install: install_manual_pages | |
115 | ||
116 | else | |
117 | ||
118 | install: install_manual_pages install_html install_pdf | |
119 | ||
120 | endif |