2019-02-24 08:51:10 +00:00
|
|
|
include ../defines.mk
|
|
|
|
|
2019-12-06 09:08:11 +00:00
|
|
|
GENERATED_SYNOPSIS := \
|
|
|
|
proxmox-backup-client/synopsis.rst \
|
|
|
|
proxmox-backup-client/catalog-shell-synopsis.rst \
|
|
|
|
proxmox-backup-manager/synopsis.rst \
|
|
|
|
pxar/synopsis.rst \
|
2021-01-27 10:31:26 +00:00
|
|
|
pmtx/synopsis.rst \
|
2019-12-06 09:08:11 +00:00
|
|
|
backup-protocol-api.rst \
|
2019-11-22 05:59:37 +00:00
|
|
|
reader-protocol-api.rst
|
2019-02-24 08:51:10 +00:00
|
|
|
|
2019-02-27 16:42:31 +00:00
|
|
|
MANUAL_PAGES := \
|
2019-11-17 16:12:41 +00:00
|
|
|
pxar.1 \
|
2021-01-27 10:31:26 +00:00
|
|
|
pmtx.1 \
|
2019-03-05 17:09:37 +00:00
|
|
|
proxmox-backup-proxy.1 \
|
2019-11-11 08:14:18 +00:00
|
|
|
proxmox-backup-client.1 \
|
|
|
|
proxmox-backup-manager.1
|
2019-02-27 16:42:31 +00:00
|
|
|
|
2020-11-03 14:28:42 +00:00
|
|
|
PRUNE_SIMULATOR_FILES := \
|
|
|
|
prune-simulator/index.html \
|
|
|
|
prune-simulator/documentation.html \
|
2020-11-11 09:07:03 +00:00
|
|
|
prune-simulator/clear-trigger.png \
|
2020-11-03 14:28:42 +00:00
|
|
|
prune-simulator/prune-simulator.js
|
2019-02-27 16:42:31 +00:00
|
|
|
|
2020-12-19 16:39:48 +00:00
|
|
|
LTO_BARCODE_FILES := \
|
|
|
|
lto-barcode/index.html \
|
|
|
|
lto-barcode/code39.js \
|
|
|
|
lto-barcode/prefix-field.js \
|
|
|
|
lto-barcode/label-style.js \
|
|
|
|
lto-barcode/tape-type.js \
|
|
|
|
lto-barcode/paper-size.js \
|
|
|
|
lto-barcode/page-layout.js \
|
|
|
|
lto-barcode/page-calibration.js \
|
|
|
|
lto-barcode/label-list.js \
|
|
|
|
lto-barcode/label-setup.js \
|
|
|
|
lto-barcode/lto-barcode.js
|
|
|
|
|
2019-02-27 16:42:31 +00:00
|
|
|
# Sphinx documentation setup
|
|
|
|
SPHINXOPTS =
|
|
|
|
SPHINXBUILD = sphinx-build
|
|
|
|
BUILDDIR = output
|
|
|
|
|
2020-07-06 12:40:58 +00:00
|
|
|
ifeq ($(BUILD_MODE), release)
|
|
|
|
COMPILEDIR := ../target/release
|
|
|
|
SPHINXOPTS += -t release
|
|
|
|
else
|
|
|
|
COMPILEDIR := ../target/debug
|
|
|
|
SPHINXOPTS += -t devbuild
|
|
|
|
endif
|
|
|
|
|
2019-02-27 16:42:31 +00:00
|
|
|
# Sphinx internal variables.
|
2019-12-03 15:51:43 +00:00
|
|
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
|
2019-02-27 16:42:31 +00:00
|
|
|
|
|
|
|
all: ${MANUAL_PAGES}
|
|
|
|
|
2019-06-04 15:33:12 +00:00
|
|
|
# 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 $< >$@
|
|
|
|
|
2021-01-27 10:31:26 +00:00
|
|
|
|
|
|
|
pmtx/synopsis.rst: ${COMPILEDIR}/pmtx
|
|
|
|
${COMPILEDIR}/pmtx printdoc > pmtx/synopsis.rst
|
|
|
|
|
|
|
|
pmtx.1: pmtx/man1.rst pmtx/description.rst pmtx/synopsis.rst
|
|
|
|
rst2man $< >$@
|
|
|
|
|
|
|
|
|
2019-02-27 16:42:31 +00:00
|
|
|
proxmox-backup-client/synopsis.rst: ${COMPILEDIR}/proxmox-backup-client
|
2019-02-24 08:51:10 +00:00
|
|
|
${COMPILEDIR}/proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
|
2019-02-27 16:42:31 +00:00
|
|
|
|
2019-12-06 09:08:11 +00:00
|
|
|
proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli
|
|
|
|
${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst
|
|
|
|
|
|
|
|
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
|
2019-02-24 08:51:10 +00:00
|
|
|
rst2man $< >$@
|
|
|
|
|
2019-11-11 08:14:18 +00:00
|
|
|
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 $< >$@
|
|
|
|
|
2019-03-05 17:09:37 +00:00
|
|
|
proxmox-backup-proxy.1: proxmox-backup-proxy/man1.rst proxmox-backup-proxy/description.rst
|
|
|
|
rst2man $< >$@
|
|
|
|
|
2020-09-02 12:22:36 +00:00
|
|
|
.PHONY: onlinehelpinfo
|
|
|
|
onlinehelpinfo:
|
|
|
|
@echo "Generating OnlineHelpInfo.js..."
|
|
|
|
$(SPHINXBUILD) -b proxmox-scanrefs $(ALLSPHINXOPTS) $(BUILDDIR)/scanrefs
|
|
|
|
@echo "Build finished. OnlineHelpInfo.js is in $(BUILDDIR)/scanrefs."
|
|
|
|
|
2019-02-27 16:42:31 +00:00
|
|
|
.PHONY: html
|
2020-12-19 16:39:48 +00:00
|
|
|
html: ${GENERATED_SYNOPSIS} images/proxmox-logo.svg custom.css conf.py ${PRUNE_SIMULATOR_FILES} ${LTO_BARCODE_FILES}
|
2019-02-27 16:42:31 +00:00
|
|
|
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
2020-11-08 12:28:57 +00:00
|
|
|
install -m 0644 custom.js custom.css images/proxmox-logo.svg $(BUILDDIR)/html/_static/
|
2020-11-03 14:28:42 +00:00
|
|
|
install -dm 0755 $(BUILDDIR)/html/prune-simulator
|
|
|
|
install -m 0644 ${PRUNE_SIMULATOR_FILES} $(BUILDDIR)/html/prune-simulator
|
2020-12-19 16:39:48 +00:00
|
|
|
install -dm 0755 $(BUILDDIR)/html/lto-barcode
|
|
|
|
install -m 0644 ${LTO_BARCODE_FILES} $(BUILDDIR)/html/lto-barcode
|
2019-02-27 16:42:31 +00:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
|
|
|
|
|
|
.PHONY: latexpdf
|
2019-06-04 15:33:12 +00:00
|
|
|
latexpdf: ${GENERATED_SYNOPSIS}
|
2020-05-04 08:15:27 +00:00
|
|
|
@echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
|
2019-02-27 16:42:31 +00:00
|
|
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
2020-05-03 05:47:03 +00:00
|
|
|
@echo "Running LaTeX files through xelatex..."
|
2019-02-27 16:42:31 +00:00
|
|
|
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
2020-05-03 05:47:03 +00:00
|
|
|
@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
|
2019-02-24 08:51:10 +00:00
|
|
|
|
2019-02-27 16:42:31 +00:00
|
|
|
.PHONY: epub3
|
2019-06-04 15:33:12 +00:00
|
|
|
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."
|
2019-02-24 08:51:10 +00:00
|
|
|
|
|
|
|
clean:
|
2019-11-22 05:59:37 +00:00
|
|
|
rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS}
|
2019-02-24 08:51:10 +00:00
|
|
|
|
2019-12-13 13:14:28 +00:00
|
|
|
|
|
|
|
install_manual_pages: ${MANUAL_PAGES}
|
2019-02-24 08:51:10 +00:00
|
|
|
install -dm755 $(DESTDIR)$(MAN1DIR)
|
2019-03-05 17:09:37 +00:00
|
|
|
for i in ${MANUAL_PAGES}; do install -m755 $$i $(DESTDIR)$(MAN1DIR)/ ; done
|
2019-12-13 13:14:28 +00:00
|
|
|
|
|
|
|
install_html: html
|
|
|
|
install -dm755 $(DESTDIR)$(DOCDIR)
|
2019-12-20 08:34:14 +00:00
|
|
|
rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR)
|
2019-12-13 13:14:28 +00:00
|
|
|
|
|
|
|
install_pdf: latexpdf
|
|
|
|
install -dm755 $(DESTDIR)$(DOCDIR)
|
|
|
|
install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf
|
|
|
|
|
|
|
|
ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
|
|
|
|
|
|
|
|
install: install_manual_pages
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
install: install_manual_pages install_html install_pdf
|
|
|
|
|
|
|
|
endif
|