]>
Commit | Line | Data |
---|---|---|
bb5c7707 DM |
1 | include ../defines.mk |
2 | ||
3 | ifeq ($(BUILD_MODE), release) | |
4 | COMPILEDIR := ../target/release | |
5 | else | |
6 | COMPILEDIR := ../target/debug | |
7 | endif | |
8 | ||
4bf0cc3b DM |
9 | GENERATED_SYNOPSIS := \ |
10 | proxmox-backup-client/synopsis.rst \ | |
11 | proxmox-backup-client/catalog-shell-synopsis.rst \ | |
12 | proxmox-backup-manager/synopsis.rst \ | |
13 | pxar/synopsis.rst \ | |
14 | backup-protocol-api.rst \ | |
45cc157f | 15 | reader-protocol-api.rst |
bb5c7707 | 16 | |
7ef486ae | 17 | MANUAL_PAGES := \ |
e4a5ab8d | 18 | pxar.1 \ |
b933ed7f | 19 | proxmox-backup-proxy.1 \ |
028bd254 DM |
20 | proxmox-backup-client.1 \ |
21 | proxmox-backup-manager.1 | |
7ef486ae DM |
22 | |
23 | ||
24 | # Sphinx documentation setup | |
25 | SPHINXOPTS = | |
26 | SPHINXBUILD = sphinx-build | |
7ef486ae DM |
27 | BUILDDIR = output |
28 | ||
29 | # Sphinx internal variables. | |
c5ff1241 | 30 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . |
7ef486ae DM |
31 | |
32 | all: ${MANUAL_PAGES} | |
33 | ||
177db84b DM |
34 | # Extract backup protocol docs |
35 | backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api | |
36 | ${COMPILEDIR}/dump-backup-api >$@ | |
37 | ||
45cc157f DM |
38 | # Extract reader protocol docs |
39 | reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api | |
40 | ${COMPILEDIR}/dump-backup-api >$@ | |
41 | ||
7ef486ae DM |
42 | # Build manual pages using rst2man |
43 | ||
e4a5ab8d DM |
44 | pxar/synopsis.rst: ${COMPILEDIR}/pxar |
45 | ${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst | |
46 | ||
47 | pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst | |
48 | rst2man $< >$@ | |
49 | ||
7ef486ae | 50 | proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client |
bb5c7707 | 51 | ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst |
7ef486ae | 52 | |
4bf0cc3b DM |
53 | proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli |
54 | ${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst | |
55 | ||
56 | 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 |
57 | rst2man $< >$@ |
58 | ||
028bd254 DM |
59 | proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager |
60 | ${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst | |
61 | ||
62 | proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst | |
63 | rst2man $< >$@ | |
64 | ||
b933ed7f DM |
65 | proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst |
66 | rst2man $< >$@ | |
67 | ||
7ef486ae DM |
68 | .PHONY: html |
69 | html: ${GENERATED_SYNOPSIS} | |
70 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html | |
71 | @echo | |
72 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | |
73 | ||
74 | .PHONY: latexpdf | |
177db84b | 75 | latexpdf: ${GENERATED_SYNOPSIS} |
7ef486ae DM |
76 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
77 | @echo "Running LaTeX files through pdflatex..." | |
78 | $(MAKE) -C $(BUILDDIR)/latex all-pdf | |
79 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | |
bb5c7707 | 80 | |
7ef486ae | 81 | .PHONY: epub3 |
177db84b | 82 | epub3: ${GENERATED_SYNOPSIS} |
7ef486ae DM |
83 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 |
84 | @echo | |
85 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." | |
bb5c7707 DM |
86 | |
87 | clean: | |
45cc157f | 88 | rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS} |
bb5c7707 | 89 | |
720776b8 DM |
90 | |
91 | install_manual_pages: ${MANUAL_PAGES} | |
bb5c7707 | 92 | install -dm755 $(DESTDIR)$(MAN1DIR) |
b933ed7f | 93 | for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done |
720776b8 DM |
94 | |
95 | install_html: html | |
96 | install -dm755 $(DESTDIR)$(DOCDIR) | |
97 | rsync -a output/html $(DESTDIR)$(DOCDIR) | |
98 | ||
99 | install_pdf: latexpdf | |
100 | install -dm755 $(DESTDIR)$(DOCDIR) | |
101 | install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf | |
102 | ||
103 | ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) | |
104 | ||
105 | install: install_manual_pages | |
106 | ||
107 | else | |
108 | ||
109 | install: install_manual_pages install_html install_pdf | |
110 | ||
111 | endif |