]>
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 | ||
7ef486ae | 9 | GENERATED_SYNOPSIS := \ |
177db84b DM |
10 | proxmox-backup-client/synopsis.rst \ |
11 | backup-protocol-api.rst | |
bb5c7707 | 12 | |
7ef486ae | 13 | MANUAL_PAGES := \ |
b933ed7f | 14 | proxmox-backup-proxy.1 \ |
7ef486ae DM |
15 | proxmox-backup-client.1 |
16 | ||
17 | ||
18 | # Sphinx documentation setup | |
19 | SPHINXOPTS = | |
20 | SPHINXBUILD = sphinx-build | |
21 | PAPER = | |
22 | BUILDDIR = output | |
23 | ||
24 | # Sphinx internal variables. | |
25 | PAPEROPT_a4 = -D latex_paper_size=a4 | |
26 | PAPEROPT_letter = -D latex_paper_size=letter | |
27 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . | |
28 | # the i18n builder cannot share the environment and doctrees with the others | |
29 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . | |
30 | ||
31 | all: ${MANUAL_PAGES} | |
32 | ||
177db84b DM |
33 | # Extract backup protocol docs |
34 | backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api | |
35 | ${COMPILEDIR}/dump-backup-api >$@ | |
36 | ||
7ef486ae DM |
37 | # Build manual pages using rst2man |
38 | ||
39 | proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client | |
bb5c7707 | 40 | ${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst |
7ef486ae DM |
41 | |
42 | ||
43 | proxmox-backup-client.1: proxmox-backup-client/man1.rst proxmox-backup-client/description.rst proxmox-backup-client/synopsis.rst | |
bb5c7707 DM |
44 | rst2man $< >$@ |
45 | ||
b933ed7f DM |
46 | proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst |
47 | rst2man $< >$@ | |
48 | ||
7ef486ae DM |
49 | .PHONY: html |
50 | html: ${GENERATED_SYNOPSIS} | |
51 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html | |
52 | @echo | |
53 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | |
54 | ||
55 | .PHONY: latexpdf | |
177db84b | 56 | latexpdf: ${GENERATED_SYNOPSIS} |
7ef486ae DM |
57 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
58 | @echo "Running LaTeX files through pdflatex..." | |
59 | $(MAKE) -C $(BUILDDIR)/latex all-pdf | |
60 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | |
bb5c7707 | 61 | |
7ef486ae | 62 | .PHONY: epub3 |
177db84b | 63 | epub3: ${GENERATED_SYNOPSIS} |
7ef486ae DM |
64 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 |
65 | @echo | |
66 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." | |
bb5c7707 DM |
67 | |
68 | clean: | |
177db84b | 69 | rm -r -f *~ *.1 */synopsis.rst ${BUILDDIR} backup-protocol-api.rst |
bb5c7707 | 70 | |
7ef486ae | 71 | install: ${MANUAL_PAGES} |
bb5c7707 | 72 | install -dm755 $(DESTDIR)$(MAN1DIR) |
b933ed7f | 73 | for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done |