2019-02-24 11:51:10 +03:00
i n c l u d e . . / d e f i n e s . m k
i f e q ( $( BUILD_MODE ) , r e l e a s e )
COMPILEDIR := ../target/release
e l s e
COMPILEDIR := ../target/debug
e n d i f
2019-02-27 19:42:31 +03:00
GENERATED_SYNOPSIS := \
2019-06-04 18:33:12 +03:00
proxmox-backup-client/synopsis.rst \
2019-11-11 11:14:18 +03:00
proxmox-backup-manager/synopsis.rst \
2019-06-04 18:33:12 +03:00
backup-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
PAPER =
BUILDDIR = output
# Sphinx internal variables.
PAPEROPT_a4 = -D latex_paper_size = a4
PAPEROPT_letter = -D latex_paper_size = letter
ALLSPHINXOPTS = -d $( BUILDDIR) /doctrees $( PAPEROPT_$( PAPER) ) $( SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $( PAPEROPT_$( PAPER) ) $( SPHINXOPTS) .
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-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
proxmox-backup-client.1 : proxmox -backup -client /man 1.rst proxmox -backup -client /description .rst proxmox -backup -client /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 $< >$@
2019-02-27 19:42:31 +03: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
2019-06-04 18:33:12 +03:00
latexpdf : ${GENERATED_SYNOPSIS }
2019-02-27 19:42:31 +03: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-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-06-04 18:33:12 +03:00
rm -r -f *~ *.1 */synopsis.rst ${ BUILDDIR } backup-protocol-api.rst
2019-02-24 11:51:10 +03:00
2019-02-27 19:42:31 +03:00
install : ${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