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 := \
2021-02-12 20:00:01 +03:00
proxmox-tape/synopsis.rst \
2019-12-06 12:08:11 +03:00
proxmox-backup-client/synopsis.rst \
proxmox-backup-client/catalog-shell-synopsis.rst \
proxmox-backup-manager/synopsis.rst \
2021-09-02 11:32:29 +03:00
proxmox-backup-debug/synopsis.rst \
2021-03-31 13:21:48 +03:00
proxmox-file-restore/synopsis.rst \
2019-12-06 12:08:11 +03:00
pxar/synopsis.rst \
2021-01-27 13:31:26 +03:00
pmtx/synopsis.rst \
2021-02-05 13:12:52 +03:00
pmt/synopsis.rst \
2021-02-12 14:18:25 +03:00
config/media-pool/config.rst \
2024-04-23 14:52:27 +03:00
config/notifications/config.rst \
config/notifications-priv/config.rst \
2021-02-12 14:09:08 +03:00
config/tape/config.rst \
2021-02-15 08:57:48 +03:00
config/tape-job/config.rst \
2021-02-10 18:37:27 +03:00
config/user/config.rst \
2021-02-11 13:52:37 +03:00
config/remote/config.rst \
config/sync/config.rst \
2021-02-11 15:40:11 +03:00
config/verification/config.rst \
2021-02-11 15:13:34 +03:00
config/acl/roles.rst \
2023-02-09 16:31:21 +03:00
config/datastore/config.rst \
config/domains/config.rst
2019-02-24 11:51:10 +03:00
2021-02-10 12:33:30 +03:00
MAN1_PAGES := \
2019-11-17 19:12:41 +03:00
pxar.1 \
2021-01-27 13:31:26 +03:00
pmtx.1 \
2021-02-05 13:12:52 +03:00
pmt.1 \
2021-02-12 20:00:01 +03:00
proxmox-tape.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 \
2021-03-31 13:21:48 +03:00
proxmox-backup-manager.1 \
2021-09-02 11:32:29 +03:00
proxmox-file-restore.1 \
2023-07-08 16:06:38 +03:00
proxmox-backup-debug.1 \
pbs2to3.1 \
2019-02-27 19:42:31 +03:00
2021-02-10 12:33:30 +03:00
MAN5_PAGES := \
2021-02-12 13:50:56 +03:00
media-pool.cfg.5 \
2021-02-12 14:09:08 +03:00
tape.cfg.5 \
2021-02-15 08:57:48 +03:00
tape-job.cfg.5 \
2021-02-11 15:13:34 +03:00
acl.cfg.5 \
2021-02-10 18:37:27 +03:00
user.cfg.5 \
2021-02-11 13:25:15 +03:00
remote.cfg.5 \
2021-02-11 13:52:37 +03:00
sync.cfg.5 \
2021-02-11 15:40:11 +03:00
verification.cfg.5 \
2023-02-09 16:31:21 +03:00
datastore.cfg.5 \
2024-04-23 14:52:27 +03:00
domains.cfg.5 \
notifications.cfg.5 \
notifications-priv.cfg.5 \
2021-02-10 12:33:30 +03:00
2020-11-03 17:28:42 +03:00
PRUNE_SIMULATOR_FILES := \
prune-simulator/index.html \
prune-simulator/documentation.html \
2020-11-11 12:07:03 +03:00
prune-simulator/clear-trigger.png \
2020-11-03 17:28:42 +03:00
prune-simulator/prune-simulator.js
2019-02-27 19:42:31 +03:00
2021-06-04 15:35:28 +03:00
PRUNE_SIMULATOR_JS_SOURCE := \
/usr/share/javascript/proxmox-widget-toolkit-dev/Toolkit.js \
prune-simulator/prune-simulator_source.js
2021-06-04 15:35:29 +03:00
LTO_BARCODE_JS_SOURCE := \
/usr/share/javascript/proxmox-widget-toolkit-dev/Toolkit.js \
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
2020-12-19 19:39:48 +03:00
LTO_BARCODE_FILES := \
lto-barcode/index.html \
2021-06-04 15:35:29 +03:00
lto-barcode/lto-barcode-generator.js
2020-12-19 19:39:48 +03:00
2021-02-21 11:00:13 +03:00
API_VIEWER_SOURCES = \
api-viewer/index.html \
api-viewer/apidoc.js
2021-06-04 15:35:30 +03:00
API_VIEWER_FILES := \
api-viewer/apidata.js \
/usr/share/javascript/proxmox-widget-toolkit-dev/APIViewer.js \
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
2021-02-10 12:33:30 +03:00
all : ${MAN 1_PAGES } ${MAN 5_PAGES }
2019-02-27 19:42:31 +03:00
2022-07-14 18:56:18 +03:00
config/%/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen $* .cfg >$@
2021-02-11 15:40:11 +03:00
2021-02-11 15:13:34 +03:00
config/acl/roles.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen "config::acl::Role" >$@
2022-07-14 18:54:16 +03:00
%/synopsis.rst : ${COMPILEDIR }/%
$< printdoc > $@
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
2022-07-14 17:41:43 +03:00
${MAN1_PAGES} ${MAN5_PAGES} : man -pages
.PHONY : man -pages
man-pages : ${GENERATED_SYNOPSIS }
${ SPHINXBUILD } ${ SPHINXOPTS } -b man ./ ${ BUILDDIR } /man
2021-09-02 11:32:29 +03:00
2020-09-02 15:22:36 +03:00
.PHONY : onlinehelpinfo
onlinehelpinfo :
@echo "Generating OnlineHelpInfo.js..."
2021-05-07 12:50:29 +03:00
$( SPHINXBUILD) -b proxmox-scanrefs -Q $( ALLSPHINXOPTS) $( BUILDDIR) /scanrefs
2020-09-02 15:22:36 +03:00
@echo " Build finished. OnlineHelpInfo.js is in $( BUILDDIR) /scanrefs. "
2021-02-21 11:00:13 +03:00
api-viewer/apidata.js : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen apidata.js >$@
2021-06-04 15:35:30 +03:00
api-viewer/apidoc.js : ${API_VIEWER_FILES }
cat ${ API_VIEWER_FILES } >$@ .tmp
mv $@ .tmp $@
2021-02-21 11:00:13 +03:00
2021-06-04 15:35:28 +03:00
prune-simulator/prune-simulator.js : ${PRUNE_SIMULATOR_JS_SOURCE }
cat ${ PRUNE_SIMULATOR_JS_SOURCE } >$@ .tmp
mv $@ .tmp $@
2021-06-04 15:35:29 +03:00
lto-barcode/lto-barcode-generator.js : ${LTO_BARCODE_JS_SOURCE }
cat ${ LTO_BARCODE_JS_SOURCE } >$@ .tmp
mv $@ .tmp $@
2019-02-27 19:42:31 +03:00
.PHONY : html
2024-03-29 18:07:36 +03:00
html : ${GENERATED_SYNOPSIS } images /proxmox -logo .svg _static /custom .css conf .py ${PRUNE_SIMULATOR_FILES } ${LTO_BARCODE_FILES } ${API_VIEWER_SOURCES }
2019-02-27 19:42:31 +03:00
$( SPHINXBUILD) -b html $( ALLSPHINXOPTS) $( BUILDDIR) /html
2024-03-29 18:07:36 +03:00
install -m 0644 _static/custom.js _static/custom.css images/proxmox-logo.svg $( BUILDDIR) /html/_static/
2020-11-03 17:28:42 +03:00
install -dm 0755 $( BUILDDIR) /html/prune-simulator
install -m 0644 ${ PRUNE_SIMULATOR_FILES } $( BUILDDIR) /html/prune-simulator
2020-12-19 19:39:48 +03:00
install -dm 0755 $( BUILDDIR) /html/lto-barcode
install -m 0644 ${ LTO_BARCODE_FILES } $( BUILDDIR) /html/lto-barcode
2021-02-21 11:00:13 +03:00
install -dm 0755 $( BUILDDIR) /html/api-viewer
install -m 0644 ${ API_VIEWER_SOURCES } $( BUILDDIR) /html/api-viewer
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 :
2021-02-21 11:00:13 +03:00
rm -r -f *~ *.1 ${ BUILDDIR } ${ GENERATED_SYNOPSIS } api-viewer/apidata.js
2021-07-03 22:41:09 +03:00
rm -f api-viewer/apidoc.js lto-barcode/lto-barcode-generator.js prune-simulator/prune-simulator.js
2019-02-24 11:51:10 +03:00
2022-07-14 17:41:43 +03:00
install_manual_pages : man -pages
2019-02-24 11:51:10 +03:00
install -dm755 $( DESTDIR) $( MAN1DIR)
2022-07-14 17:41:43 +03:00
for i in ${ MAN1_PAGES } ; do install -m755 ${ BUILDDIR } /man/$$ i $( DESTDIR) $( MAN1DIR) / ; done
2021-02-10 12:33:30 +03:00
install -dm755 $( DESTDIR) $( MAN5DIR)
2022-07-14 17:41:43 +03:00
for i in ${ MAN5_PAGES } ; do install -m755 ${ BUILDDIR } /man/$$ i $( DESTDIR) $( MAN5DIR) / ; 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