2019-02-24 11:51:10 +03:00
i n c l u d e . . / d e f i n e s . m k
2019-12-06 12:08:11 +03:00
GENERATED_SYNOPSIS := \
proxmox-backup-client/synopsis.rst \
proxmox-backup-client/catalog-shell-synopsis.rst \
proxmox-backup-manager/synopsis.rst \
pxar/synopsis.rst \
backup-protocol-api.rst \
2019-11-22 08:59:37 +03:00
reader-protocol-api.rst
2019-02-24 11:51:10 +03:00
2019-02-27 19:42:31 +03:00
MANUAL_PAGES := \
2019-11-17 19:12:41 +03:00
pxar.1 \
2019-03-05 20:09:37 +03:00
proxmox-backup-proxy.1 \
2019-11-11 11:14:18 +03:00
proxmox-backup-client.1 \
proxmox-backup-manager.1
2019-02-27 19:42:31 +03:00
# Sphinx documentation setup
SPHINXOPTS =
SPHINXBUILD = sphinx-build
BUILDDIR = output
2020-07-06 15:40:58 +03:00
i f e q ( $( BUILD_MODE ) , r e l e a s e )
COMPILEDIR := ../target/release
SPHINXOPTS += -t release
e l s e
COMPILEDIR := ../target/debug
SPHINXOPTS += -t devbuild
e n d i f
2019-02-27 19:42:31 +03:00
# Sphinx internal variables.
2019-12-03 18:51:43 +03:00
ALLSPHINXOPTS = -d $( BUILDDIR) /doctrees $( SPHINXOPTS) .
2019-02-27 19:42:31 +03:00
all : ${MANUAL_PAGES }
2019-06-04 18:33:12 +03:00
# Extract backup protocol docs
backup-protocol-api.rst : ${COMPILEDIR }/dump -backup -api
${ COMPILEDIR } /dump-backup-api >$@
2019-11-22 08:59:37 +03:00
# Extract reader protocol docs
reader-protocol-api.rst : ${COMPILEDIR }/dump -reader -api
${ COMPILEDIR } /dump-backup-api >$@
2019-02-27 19:42:31 +03:00
# Build manual pages using rst2man
2019-11-17 19:12:41 +03:00
pxar/synopsis.rst : ${COMPILEDIR }/pxar
${ COMPILEDIR } /pxar printdoc > pxar/synopsis.rst
pxar.1 : pxar /man 1.rst pxar /description .rst pxar /synopsis .rst
rst2man $< >$@
2019-02-27 19:42:31 +03:00
proxmox-backup-client/synopsis.rst : ${COMPILEDIR }/proxmox -backup -client
2019-02-24 11:51:10 +03:00
${ COMPILEDIR } /proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
2019-02-27 19:42:31 +03:00
2019-12-06 12:08:11 +03: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 /man 1.rst proxmox -backup -client /description .rst proxmox -backup -client /synopsis .rst proxmox -backup -client /catalog -shell -synopsis .rst
2019-02-24 11:51:10 +03:00
rst2man $< >$@
2019-11-11 11:14:18 +03: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 /man 1.rst proxmox -backup -manager /description .rst proxmox -backup -manager /synopsis .rst
rst2man $< >$@
2019-03-05 20:09:37 +03:00
proxmox-backup-proxy.1 : proxmox -backup -proxy /man 1.rst proxmox -backup -proxy /description .rst
rst2man $< >$@
2020-09-02 15:22:36 +03: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 19:42:31 +03:00
.PHONY : html
html : ${GENERATED_SYNOPSIS }
$( SPHINXBUILD) -b html $( ALLSPHINXOPTS) $( BUILDDIR) /html
2020-09-11 12:05:41 +03:00
cp images/proxmox-logo.svg $( BUILDDIR) /html/_static/
cp custom.css $( BUILDDIR) /html/_static/
2019-02-27 19:42:31 +03:00
@echo
@echo " Build finished. The HTML pages are in $( BUILDDIR) /html. "
.PHONY : latexpdf
2019-06-04 18:33:12 +03:00
latexpdf : ${GENERATED_SYNOPSIS }
2020-05-04 11:15:27 +03:00
@echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
2019-02-27 19:42:31 +03:00
$( SPHINXBUILD) -b latex $( ALLSPHINXOPTS) $( BUILDDIR) /latex
2020-05-03 08:47:03 +03:00
@echo "Running LaTeX files through xelatex..."
2019-02-27 19:42:31 +03:00
$( MAKE) -C $( BUILDDIR) /latex all-pdf
2020-05-03 08:47:03 +03:00
@echo " xelatex finished; the PDF files are in $( BUILDDIR) /latex. "
2019-02-24 11:51:10 +03:00
2019-02-27 19:42:31 +03:00
.PHONY : epub 3
2019-06-04 18:33:12 +03:00
epub3 : ${GENERATED_SYNOPSIS }
2019-02-27 19:42:31 +03:00
$( SPHINXBUILD) -b epub3 $( ALLSPHINXOPTS) $( BUILDDIR) /epub3
@echo
@echo " Build finished. The epub3 file is in $( BUILDDIR) /epub3. "
2019-02-24 11:51:10 +03:00
clean :
2019-11-22 08:59:37 +03:00
rm -r -f *~ *.1 ${ BUILDDIR } ${ GENERATED_SYNOPSIS }
2019-02-24 11:51:10 +03:00
2019-12-13 16:14:28 +03:00
install_manual_pages : ${MANUAL_PAGES }
2019-02-24 11:51:10 +03:00
install -dm755 $( DESTDIR) $( MAN1DIR)
2019-03-05 20:09:37 +03:00
for i in ${ MANUAL_PAGES } ; do install -m755 $$ i $( DESTDIR) $( MAN1DIR) / ; done
2019-12-13 16:14:28 +03:00
install_html : html
install -dm755 $( DESTDIR) $( DOCDIR)
2019-12-20 11:34:14 +03:00
rsync -a ${ BUILDDIR } /html $( DESTDIR) $( DOCDIR)
2019-12-13 16:14:28 +03:00
install_pdf : latexpdf
install -dm755 $( DESTDIR) $( DOCDIR)
install -m 0644 output/latex/ProxmoxBackup.pdf $( DESTDIR) $( DOCDIR) /proxmox-backup.pdf
i f n e q ( $( filter nodoc ,$ ( DEB_BUILD_PROFILES ) ) , )
install : install_manual_pages
e l s e
install : install_manual_pages install_html install_pdf
e n d i f