proxmox-backup/docs/Makefile

88 lines
2.5 KiB
Makefile
Raw Normal View History

include ../defines.mk
ifeq ($(BUILD_MODE), release)
COMPILEDIR := ../target/release
else
COMPILEDIR := ../target/debug
endif
2019-02-27 16:42:31 +00:00
GENERATED_SYNOPSIS := \
proxmox-backup-client/synopsis.rst \
proxmox-backup-manager/synopsis.rst \
2019-11-22 05:59:37 +00:00
backup-protocol-api.rst \
reader-protocol-api.rst
2019-02-27 16:42:31 +00:00
MANUAL_PAGES := \
2019-11-17 16:12:41 +00:00
pxar.1 \
proxmox-backup-proxy.1 \
proxmox-backup-client.1 \
proxmox-backup-manager.1
2019-02-27 16:42:31 +00:00
# Sphinx documentation setup
SPHINXOPTS =
SPHINXBUILD = sphinx-build
BUILDDIR = output
# Sphinx internal variables.
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
2019-02-27 16:42:31 +00:00
all: ${MANUAL_PAGES}
# Extract backup protocol docs
backup-protocol-api.rst: ${COMPILEDIR}/dump-backup-api
${COMPILEDIR}/dump-backup-api >$@
2019-11-22 05:59:37 +00:00
# Extract reader protocol docs
reader-protocol-api.rst: ${COMPILEDIR}/dump-reader-api
${COMPILEDIR}/dump-backup-api >$@
2019-02-27 16:42:31 +00:00
# Build manual pages using rst2man
2019-11-17 16:12:41 +00:00
pxar/synopsis.rst: ${COMPILEDIR}/pxar
${COMPILEDIR}/pxar printdoc > pxar/synopsis.rst
pxar.1: pxar/man1.rst pxar/description.rst pxar/synopsis.rst
rst2man $< >$@
2019-02-27 16:42:31 +00:00
proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
2019-02-27 16:42:31 +00:00
proxmox-backup-client.1: proxmox-backup-client/man1.rst proxmox-backup-client/description.rst proxmox-backup-client/synopsis.rst
rst2man $< >$@
proxmox-backup-manager/synopsis.rst: ${COMPILEDIR}/proxmox-backup-manager
${COMPILEDIR}/proxmox-backup-manager printdoc > proxmox-backup-manager/synopsis.rst
proxmox-backup-manager.1: proxmox-backup-manager/man1.rst proxmox-backup-manager/description.rst proxmox-backup-manager/synopsis.rst
rst2man $< >$@
proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
rst2man $< >$@
2019-02-27 16:42:31 +00:00
.PHONY: html
html: ${GENERATED_SYNOPSIS}
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: latexpdf
latexpdf: ${GENERATED_SYNOPSIS}
2019-02-27 16:42:31 +00:00
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
2019-02-27 16:42:31 +00:00
.PHONY: epub3
epub3: ${GENERATED_SYNOPSIS}
2019-02-27 16:42:31 +00:00
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
clean:
2019-11-22 05:59:37 +00:00
rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
2019-02-27 16:42:31 +00:00
install: ${MANUAL_PAGES}
install -dm755 $(DESTDIR)$(MAN1DIR)
for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done