]>
Commit | Line | Data |
---|---|---|
bb5c7707 DM |
1 | include ../defines.mk |
2 | ||
4bf0cc3b | 3 | GENERATED_SYNOPSIS := \ |
bebd4a7c | 4 | proxmox-tape/synopsis.rst \ |
4bf0cc3b DM |
5 | proxmox-backup-client/synopsis.rst \ |
6 | proxmox-backup-client/catalog-shell-synopsis.rst \ | |
7 | proxmox-backup-manager/synopsis.rst \ | |
df12c9ec | 8 | proxmox-backup-debug/synopsis.rst \ |
76425d84 | 9 | proxmox-file-restore/synopsis.rst \ |
4bf0cc3b | 10 | pxar/synopsis.rst \ |
c9727044 | 11 | pmtx/synopsis.rst \ |
4c209d6b | 12 | pmt/synopsis.rst \ |
167e5406 | 13 | config/media-pool/config.rst \ |
c111c9a9 | 14 | config/tape/config.rst \ |
7ca0ba45 | 15 | config/tape-job/config.rst \ |
67cc79ec | 16 | config/user/config.rst \ |
d8dae160 DM |
17 | config/remote/config.rst \ |
18 | config/sync/config.rst \ | |
5b7f4455 | 19 | config/verification/config.rst \ |
2ca396c0 | 20 | config/acl/roles.rst \ |
b9d67b01 LW |
21 | config/datastore/config.rst \ |
22 | config/domains/config.rst | |
bb5c7707 | 23 | |
4a0d3a3e | 24 | MAN1_PAGES := \ |
e4a5ab8d | 25 | pxar.1 \ |
c9727044 | 26 | pmtx.1 \ |
4c209d6b | 27 | pmt.1 \ |
bebd4a7c | 28 | proxmox-tape.1 \ |
b933ed7f | 29 | proxmox-backup-proxy.1 \ |
028bd254 | 30 | proxmox-backup-client.1 \ |
76425d84 | 31 | proxmox-backup-manager.1 \ |
df12c9ec | 32 | proxmox-file-restore.1 \ |
7f64a620 TL |
33 | proxmox-backup-debug.1 \ |
34 | pbs2to3.1 \ | |
7ef486ae | 35 | |
4a0d3a3e | 36 | MAN5_PAGES := \ |
bb71e3a0 | 37 | media-pool.cfg.5 \ |
c111c9a9 | 38 | tape.cfg.5 \ |
7ca0ba45 | 39 | tape-job.cfg.5 \ |
2ca396c0 | 40 | acl.cfg.5 \ |
67cc79ec | 41 | user.cfg.5 \ |
6279b8f5 | 42 | remote.cfg.5 \ |
d8dae160 | 43 | sync.cfg.5 \ |
5b7f4455 | 44 | verification.cfg.5 \ |
b9d67b01 LW |
45 | datastore.cfg.5 \ |
46 | domains.cfg.5 | |
4a0d3a3e | 47 | |
3323798b FE |
48 | PRUNE_SIMULATOR_FILES := \ |
49 | prune-simulator/index.html \ | |
50 | prune-simulator/documentation.html \ | |
21b55284 | 51 | prune-simulator/clear-trigger.png \ |
3323798b | 52 | prune-simulator/prune-simulator.js |
7ef486ae | 53 | |
442d6da8 DC |
54 | PRUNE_SIMULATOR_JS_SOURCE := \ |
55 | /usr/share/javascript/proxmox-widget-toolkit-dev/Toolkit.js \ | |
56 | prune-simulator/prune-simulator_source.js | |
57 | ||
d7386690 DC |
58 | LTO_BARCODE_JS_SOURCE := \ |
59 | /usr/share/javascript/proxmox-widget-toolkit-dev/Toolkit.js \ | |
60 | lto-barcode/code39.js \ | |
61 | lto-barcode/prefix-field.js \ | |
62 | lto-barcode/label-style.js \ | |
63 | lto-barcode/tape-type.js \ | |
64 | lto-barcode/paper-size.js \ | |
65 | lto-barcode/page-layout.js \ | |
66 | lto-barcode/page-calibration.js \ | |
67 | lto-barcode/label-list.js \ | |
68 | lto-barcode/label-setup.js \ | |
69 | lto-barcode/lto-barcode.js | |
70 | ||
4a227b54 DM |
71 | LTO_BARCODE_FILES := \ |
72 | lto-barcode/index.html \ | |
d7386690 | 73 | lto-barcode/lto-barcode-generator.js |
4a227b54 | 74 | |
1adbc7c1 DM |
75 | API_VIEWER_SOURCES= \ |
76 | api-viewer/index.html \ | |
77 | api-viewer/apidoc.js | |
78 | ||
85417b2a DC |
79 | API_VIEWER_FILES := \ |
80 | api-viewer/apidata.js \ | |
81 | /usr/share/javascript/proxmox-widget-toolkit-dev/APIViewer.js \ | |
82 | ||
7ef486ae DM |
83 | # Sphinx documentation setup |
84 | SPHINXOPTS = | |
85 | SPHINXBUILD = sphinx-build | |
7ef486ae DM |
86 | BUILDDIR = output |
87 | ||
3a998863 TL |
88 | ifeq ($(BUILD_MODE), release) |
89 | COMPILEDIR := ../target/release | |
90 | SPHINXOPTS += -t release | |
91 | else | |
92 | COMPILEDIR := ../target/debug | |
93 | SPHINXOPTS += -t devbuild | |
94 | endif | |
95 | ||
7ef486ae | 96 | # Sphinx internal variables. |
c5ff1241 | 97 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . |
7ef486ae | 98 | |
4a0d3a3e | 99 | all: ${MAN1_PAGES} ${MAN5_PAGES} |
7ef486ae | 100 | |
ffe7f581 TL |
101 | config/%/config.rst: ${COMPILEDIR}/docgen |
102 | ${COMPILEDIR}/docgen $*.cfg >$@ | |
5b7f4455 | 103 | |
2ca396c0 DM |
104 | config/acl/roles.rst: ${COMPILEDIR}/docgen |
105 | ${COMPILEDIR}/docgen "config::acl::Role" >$@ | |
106 | ||
075add9b TL |
107 | %/synopsis.rst: ${COMPILEDIR}/% |
108 | $< printdoc > $@ | |
7ef486ae | 109 | |
4bf0cc3b DM |
110 | proxmox-backup-client/catalog-shell-synopsis.rst: ${COMPILEDIR}/dump-catalog-shell-cli |
111 | ${COMPILEDIR}/dump-catalog-shell-cli > proxmox-backup-client/catalog-shell-synopsis.rst | |
112 | ||
ed873dc6 TL |
113 | ${MAN1_PAGES} ${MAN5_PAGES}: man-pages |
114 | ||
115 | .PHONY: man-pages | |
116 | man-pages: ${GENERATED_SYNOPSIS} | |
117 | ${SPHINXBUILD} ${SPHINXOPTS} -b man ./ ${BUILDDIR}/man | |
df12c9ec | 118 | |
49df8ac1 OB |
119 | .PHONY: onlinehelpinfo |
120 | onlinehelpinfo: | |
121 | @echo "Generating OnlineHelpInfo.js..." | |
3c06eba1 | 122 | $(SPHINXBUILD) -b proxmox-scanrefs -Q $(ALLSPHINXOPTS) $(BUILDDIR)/scanrefs |
49df8ac1 OB |
123 | @echo "Build finished. OnlineHelpInfo.js is in $(BUILDDIR)/scanrefs." |
124 | ||
1adbc7c1 DM |
125 | api-viewer/apidata.js: ${COMPILEDIR}/docgen |
126 | ${COMPILEDIR}/docgen apidata.js >$@ | |
127 | ||
85417b2a DC |
128 | api-viewer/apidoc.js: ${API_VIEWER_FILES} |
129 | cat ${API_VIEWER_FILES} >$@.tmp | |
130 | mv $@.tmp $@ | |
1adbc7c1 | 131 | |
442d6da8 DC |
132 | prune-simulator/prune-simulator.js: ${PRUNE_SIMULATOR_JS_SOURCE} |
133 | cat ${PRUNE_SIMULATOR_JS_SOURCE} >$@.tmp | |
134 | mv $@.tmp $@ | |
135 | ||
d7386690 DC |
136 | lto-barcode/lto-barcode-generator.js: ${LTO_BARCODE_JS_SOURCE} |
137 | cat ${LTO_BARCODE_JS_SOURCE} >$@.tmp | |
138 | mv $@.tmp $@ | |
139 | ||
7ef486ae | 140 | .PHONY: html |
b57d3a92 | 141 | html: ${GENERATED_SYNOPSIS} images/proxmox-logo.svg _static/custom.css conf.py ${PRUNE_SIMULATOR_FILES} ${LTO_BARCODE_FILES} ${API_VIEWER_SOURCES} |
7ef486ae | 142 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
b57d3a92 | 143 | install -m 0644 _static/custom.js _static/custom.css images/proxmox-logo.svg $(BUILDDIR)/html/_static/ |
3323798b FE |
144 | install -dm 0755 $(BUILDDIR)/html/prune-simulator |
145 | install -m 0644 ${PRUNE_SIMULATOR_FILES} $(BUILDDIR)/html/prune-simulator | |
4a227b54 DM |
146 | install -dm 0755 $(BUILDDIR)/html/lto-barcode |
147 | install -m 0644 ${LTO_BARCODE_FILES} $(BUILDDIR)/html/lto-barcode | |
1adbc7c1 DM |
148 | install -dm 0755 $(BUILDDIR)/html/api-viewer |
149 | install -m 0644 ${API_VIEWER_SOURCES} $(BUILDDIR)/html/api-viewer | |
7ef486ae DM |
150 | @echo |
151 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | |
152 | ||
153 | .PHONY: latexpdf | |
177db84b | 154 | latexpdf: ${GENERATED_SYNOPSIS} |
fc598cdb | 155 | @echo "Requires python3-sphinx, texlive-xetex, xindy and texlive-fonts-extra" |
7ef486ae | 156 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
15d74eaa | 157 | @echo "Running LaTeX files through xelatex..." |
7ef486ae | 158 | $(MAKE) -C $(BUILDDIR)/latex all-pdf |
15d74eaa | 159 | @echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex." |
bb5c7707 | 160 | |
7ef486ae | 161 | .PHONY: epub3 |
177db84b | 162 | epub3: ${GENERATED_SYNOPSIS} |
7ef486ae DM |
163 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 |
164 | @echo | |
165 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." | |
bb5c7707 DM |
166 | |
167 | clean: | |
1adbc7c1 | 168 | rm -r -f *~ *.1 ${BUILDDIR} ${GENERATED_SYNOPSIS} api-viewer/apidata.js |
13a24457 | 169 | rm -f api-viewer/apidoc.js lto-barcode/lto-barcode-generator.js prune-simulator/prune-simulator.js |
bb5c7707 | 170 | |
ed873dc6 | 171 | install_manual_pages: man-pages |
bb5c7707 | 172 | install -dm755 $(DESTDIR)$(MAN1DIR) |
ed873dc6 | 173 | for i in ${MAN1_PAGES}; do install -m755 ${BUILDDIR}/man/$$i $(DESTDIR)$(MAN1DIR)/ ; done |
4a0d3a3e | 174 | install -dm755 $(DESTDIR)$(MAN5DIR) |
ed873dc6 | 175 | for i in ${MAN5_PAGES}; do install -m755 ${BUILDDIR}/man/$$i $(DESTDIR)$(MAN5DIR)/ ; done |
720776b8 DM |
176 | |
177 | install_html: html | |
178 | install -dm755 $(DESTDIR)$(DOCDIR) | |
da0e1e40 | 179 | rsync -a ${BUILDDIR}/html $(DESTDIR)$(DOCDIR) |
720776b8 DM |
180 | |
181 | install_pdf: latexpdf | |
182 | install -dm755 $(DESTDIR)$(DOCDIR) | |
183 | install -m 0644 output/latex/ProxmoxBackup.pdf $(DESTDIR)$(DOCDIR)/proxmox-backup.pdf | |
184 | ||
185 | ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) | |
186 | ||
187 | install: install_manual_pages | |
188 | ||
189 | else | |
190 | ||
191 | install: install_manual_pages install_html install_pdf | |
192 | ||
193 | endif |