2019-02-24 09:51:10 +01:00
i n c l u d e . . / d e f i n e s . m k
2019-12-06 10:08:11 +01:00
GENERATED_SYNOPSIS := \
2021-02-12 18:00:01 +01:00
proxmox-tape/synopsis.rst \
2019-12-06 10:08:11 +01:00
proxmox-backup-client/synopsis.rst \
proxmox-backup-client/catalog-shell-synopsis.rst \
proxmox-backup-manager/synopsis.rst \
2021-03-31 12:21:48 +02:00
proxmox-file-restore/synopsis.rst \
2019-12-06 10:08:11 +01:00
pxar/synopsis.rst \
2021-01-27 11:31:26 +01:00
pmtx/synopsis.rst \
2021-02-05 11:12:52 +01:00
pmt/synopsis.rst \
2021-02-12 12:18:25 +01:00
config/media-pool/config.rst \
2021-02-12 12:09:08 +01:00
config/tape/config.rst \
2021-02-15 06:57:48 +01:00
config/tape-job/config.rst \
2021-02-10 16:37:27 +01:00
config/user/config.rst \
2021-02-11 11:52:37 +01:00
config/remote/config.rst \
config/sync/config.rst \
2021-02-11 13:40:11 +01:00
config/verification/config.rst \
2021-02-11 13:13:34 +01:00
config/acl/roles.rst \
2021-02-10 10:33:30 +01:00
config/datastore/config.rst
2019-02-24 09:51:10 +01:00
2021-02-10 10:33:30 +01:00
MAN1_PAGES := \
2019-11-17 17:12:41 +01:00
pxar.1 \
2021-01-27 11:31:26 +01:00
pmtx.1 \
2021-02-05 11:12:52 +01:00
pmt.1 \
2021-02-12 18:00:01 +01:00
proxmox-tape.1 \
2019-03-05 18:09:37 +01:00
proxmox-backup-proxy.1 \
2019-11-11 09:14:18 +01:00
proxmox-backup-client.1 \
2021-03-31 12:21:48 +02:00
proxmox-backup-manager.1 \
proxmox-file-restore.1
2019-02-27 17:42:31 +01:00
2021-02-10 10:33:30 +01:00
MAN5_PAGES := \
2021-02-12 11:50:56 +01:00
media-pool.cfg.5 \
2021-02-12 12:09:08 +01:00
tape.cfg.5 \
2021-02-15 06:57:48 +01:00
tape-job.cfg.5 \
2021-02-11 13:13:34 +01:00
acl.cfg.5 \
2021-02-10 16:37:27 +01:00
user.cfg.5 \
2021-02-11 11:25:15 +01:00
remote.cfg.5 \
2021-02-11 11:52:37 +01:00
sync.cfg.5 \
2021-02-11 13:40:11 +01:00
verification.cfg.5 \
2021-02-10 10:33:30 +01:00
datastore.cfg.5
2020-11-03 15:28:42 +01:00
PRUNE_SIMULATOR_FILES := \
prune-simulator/index.html \
prune-simulator/documentation.html \
2020-11-11 10:07:03 +01:00
prune-simulator/clear-trigger.png \
2020-11-03 15:28:42 +01:00
prune-simulator/prune-simulator.js
2019-02-27 17:42:31 +01:00
2021-06-04 14:35:28 +02:00
PRUNE_SIMULATOR_JS_SOURCE := \
/usr/share/javascript/proxmox-widget-toolkit-dev/Toolkit.js \
prune-simulator/prune-simulator_source.js
2020-12-19 17:39:48 +01: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
2021-02-21 09:00:13 +01:00
API_VIEWER_SOURCES = \
api-viewer/index.html \
api-viewer/apidoc.js
2019-02-27 17:42:31 +01:00
# Sphinx documentation setup
SPHINXOPTS =
SPHINXBUILD = sphinx-build
BUILDDIR = output
2020-07-06 14:40:58 +02: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 17:42:31 +01:00
# Sphinx internal variables.
2019-12-03 16:51:43 +01:00
ALLSPHINXOPTS = -d $( BUILDDIR) /doctrees $( SPHINXOPTS) .
2019-02-27 17:42:31 +01:00
2021-02-10 10:33:30 +01:00
all : ${MAN 1_PAGES } ${MAN 5_PAGES }
2019-02-27 17:42:31 +01:00
# Build manual pages using rst2man
2019-11-17 17:12:41 +01: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 $< >$@
2021-01-27 11:31:26 +01:00
pmtx/synopsis.rst : ${COMPILEDIR }/pmtx
${ COMPILEDIR } /pmtx printdoc > pmtx/synopsis.rst
pmtx.1 : pmtx /man 1.rst pmtx /description .rst pmtx /synopsis .rst
rst2man $< >$@
2021-02-05 11:12:52 +01:00
pmt/synopsis.rst : ${COMPILEDIR }/pmt
${ COMPILEDIR } /pmt printdoc > pmt/synopsis.rst
2021-02-12 18:00:01 +01:00
pmt.1 : pmt /man 1.rst pmt /description .rst pmt /options .rst pmt /synopsis .rst
2021-02-05 11:12:52 +01:00
rst2man $< >$@
2021-02-10 10:33:30 +01:00
config/datastore/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen datastore.cfg >$@
2021-02-11 11:25:15 +01:00
datastore.cfg.5 : config /datastore /man 5.rst config /datastore /config .rst config /datastore /format .rst
2021-02-10 10:33:30 +01:00
rst2man $< >$@
2021-02-05 11:12:52 +01:00
2021-02-10 16:37:27 +01:00
config/user/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen user.cfg >$@
2021-02-11 11:25:15 +01:00
user.cfg.5 : config /user /man 5.rst config /user /config .rst config /user /format .rst
rst2man $< >$@
config/remote/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen remote.cfg >$@
remote.cfg.5 : config /remote /man 5.rst config /remote /config .rst config /remote /format .rst
2021-02-10 16:37:27 +01:00
rst2man $< >$@
2021-02-11 11:52:37 +01:00
config/sync/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen sync.cfg >$@
sync.cfg.5 : config /sync /man 5.rst config /sync /config .rst config /sync /format .rst
rst2man $< >$@
2021-02-11 13:40:11 +01:00
config/verification/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen verification.cfg >$@
verification.cfg.5 : config /verification /man 5.rst config /verification /config .rst config /verification /format .rst
rst2man $< >$@
2021-02-11 13:13:34 +01:00
config/acl/roles.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen "config::acl::Role" >$@
acl.cfg.5 : config /acl /man 5.rst config /acl /roles .rst config /acl /format .rst
rst2man $< >$@
2021-02-12 11:50:56 +01:00
config/media-pool/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen media-pool.cfg >$@
media-pool.cfg.5 : config /media -pool /man 5.rst config /media -pool /config .rst config /media -pool /format .rst
rst2man $< >$@
2021-02-12 12:09:08 +01:00
config/tape/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen tape.cfg >$@
tape.cfg.5 : config /tape /man 5.rst config /tape /config .rst config /tape /format .rst
rst2man $< >$@
2021-02-15 06:57:48 +01:00
config/tape-job/config.rst : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen tape-job.cfg >$@
tape-job.cfg.5 : config /tape -job /man 5.rst config /tape -job /config .rst config /tape -job /format .rst
rst2man $< >$@
2021-02-12 18:00:01 +01:00
proxmox-tape/synopsis.rst : ${COMPILEDIR }/proxmox -tape
${ COMPILEDIR } /proxmox-tape printdoc > proxmox-tape/synopsis.rst
proxmox-tape.1 : proxmox -tape /man 1.rst proxmox -tape /description .rst proxmox -tape /synopsis .rst
rst2man $< >$@
2019-02-27 17:42:31 +01:00
proxmox-backup-client/synopsis.rst : ${COMPILEDIR }/proxmox -backup -client
2019-02-24 09:51:10 +01:00
${ COMPILEDIR } /proxmox-backup-client printdoc > proxmox-backup-client/synopsis.rst
2019-02-27 17:42:31 +01:00
2019-12-06 10:08:11 +01: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 09:51:10 +01:00
rst2man $< >$@
2019-11-11 09:14:18 +01: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 18:09:37 +01:00
proxmox-backup-proxy.1 : proxmox -backup -proxy /man 1.rst proxmox -backup -proxy /description .rst
rst2man $< >$@
2021-03-31 12:21:48 +02:00
proxmox-file-restore/synopsis.rst : ${COMPILEDIR }/proxmox -file -restore
${ COMPILEDIR } /proxmox-file-restore printdoc > proxmox-file-restore/synopsis.rst
proxmox-file-restore.1 : proxmox -file -restore /man 1.rst proxmox -file -restore /description .rst proxmox -file -restore /synopsis .rst
rst2man $< >$@
2020-09-02 14:22:36 +02:00
.PHONY : onlinehelpinfo
onlinehelpinfo :
@echo "Generating OnlineHelpInfo.js..."
2021-05-07 11:50:29 +02:00
$( SPHINXBUILD) -b proxmox-scanrefs -Q $( ALLSPHINXOPTS) $( BUILDDIR) /scanrefs
2020-09-02 14:22:36 +02:00
@echo " Build finished. OnlineHelpInfo.js is in $( BUILDDIR) /scanrefs. "
2021-02-21 09:00:13 +01:00
api-viewer/apidata.js : ${COMPILEDIR }/docgen
${ COMPILEDIR } /docgen apidata.js >$@
api-viewer/apidoc.js : api -viewer /apidata .js api -viewer /PBSAPI .js
cat api-viewer/apidata.js api-viewer/PBSAPI.js >$@
2021-06-04 14:35:28 +02:00
prune-simulator/prune-simulator.js : ${PRUNE_SIMULATOR_JS_SOURCE }
cat ${ PRUNE_SIMULATOR_JS_SOURCE } >$@ .tmp
mv $@ .tmp $@
2019-02-27 17:42:31 +01:00
.PHONY : html
2021-02-21 09:00:13 +01:00
html : ${GENERATED_SYNOPSIS } images /proxmox -logo .svg custom .css conf .py ${PRUNE_SIMULATOR_FILES } ${LTO_BARCODE_FILES } ${API_VIEWER_SOURCES }
2019-02-27 17:42:31 +01:00
$( SPHINXBUILD) -b html $( ALLSPHINXOPTS) $( BUILDDIR) /html
2020-11-08 13:28:57 +01:00
install -m 0644 custom.js custom.css images/proxmox-logo.svg $( BUILDDIR) /html/_static/
2020-11-03 15:28:42 +01:00
install -dm 0755 $( BUILDDIR) /html/prune-simulator
install -m 0644 ${ PRUNE_SIMULATOR_FILES } $( BUILDDIR) /html/prune-simulator
2020-12-19 17:39:48 +01:00
install -dm 0755 $( BUILDDIR) /html/lto-barcode
install -m 0644 ${ LTO_BARCODE_FILES } $( BUILDDIR) /html/lto-barcode
2021-02-21 09:00:13 +01:00
install -dm 0755 $( BUILDDIR) /html/api-viewer
install -m 0644 ${ API_VIEWER_SOURCES } $( BUILDDIR) /html/api-viewer
2019-02-27 17:42:31 +01:00
@echo
@echo " Build finished. The HTML pages are in $( BUILDDIR) /html. "
.PHONY : latexpdf
2019-06-04 17:33:12 +02:00
latexpdf : ${GENERATED_SYNOPSIS }
2020-05-04 10:15:27 +02:00
@echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra"
2019-02-27 17:42:31 +01:00
$( SPHINXBUILD) -b latex $( ALLSPHINXOPTS) $( BUILDDIR) /latex
2020-05-03 07:47:03 +02:00
@echo "Running LaTeX files through xelatex..."
2019-02-27 17:42:31 +01:00
$( MAKE) -C $( BUILDDIR) /latex all-pdf
2020-05-03 07:47:03 +02:00
@echo " xelatex finished; the PDF files are in $( BUILDDIR) /latex. "
2019-02-24 09:51:10 +01:00
2019-02-27 17:42:31 +01:00
.PHONY : epub 3
2019-06-04 17:33:12 +02:00
epub3 : ${GENERATED_SYNOPSIS }
2019-02-27 17:42:31 +01:00
$( SPHINXBUILD) -b epub3 $( ALLSPHINXOPTS) $( BUILDDIR) /epub3
@echo
@echo " Build finished. The epub3 file is in $( BUILDDIR) /epub3. "
2019-02-24 09:51:10 +01:00
clean :
2021-02-21 09:00:13 +01:00
rm -r -f *~ *.1 ${ BUILDDIR } ${ GENERATED_SYNOPSIS } api-viewer/apidata.js
2019-02-24 09:51:10 +01:00
2019-12-13 14:14:28 +01:00
2021-02-10 10:33:30 +01:00
install_manual_pages : ${MAN 1_PAGES } ${MAN 5_PAGES }
2019-02-24 09:51:10 +01:00
install -dm755 $( DESTDIR) $( MAN1DIR)
2021-02-10 10:33:30 +01:00
for i in ${ MAN1_PAGES } ; do install -m755 $$ i $( DESTDIR) $( MAN1DIR) / ; done
install -dm755 $( DESTDIR) $( MAN5DIR)
for i in ${ MAN5_PAGES } ; do install -m755 $$ i $( DESTDIR) $( MAN5DIR) / ; done
2019-12-13 14:14:28 +01:00
install_html : html
install -dm755 $( DESTDIR) $( DOCDIR)
2019-12-20 09:34:14 +01:00
rsync -a ${ BUILDDIR } /html $( DESTDIR) $( DOCDIR)
2019-12-13 14:14:28 +01: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