]>
Commit | Line | Data |
---|---|---|
f8aa24ea PB |
1 | if build_docs |
2 | configure_file(output: 'index.html', | |
3 | input: files('index.html.in'), | |
4 | configuration: {'VERSION': meson.project_version()}, | |
491e74c1 | 5 | install_dir: qemu_docdir) |
f8aa24ea PB |
6 | manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ] |
7 | man_pages = { | |
8 | 'interop' : { | |
9 | 'qemu-ga.8': (have_tools ? 'man8' : ''), | |
db16115f | 10 | 'qemu-ga-ref.7': 'man7', |
4ac2ee19 | 11 | 'qemu-qmp-ref.7': 'man7', |
f8aa24ea PB |
12 | }, |
13 | 'tools': { | |
14 | 'qemu-img.1': (have_tools ? 'man1' : ''), | |
15 | 'qemu-nbd.8': (have_tools ? 'man8' : ''), | |
16 | 'qemu-trace-stap.1': (config_host.has_key('CONFIG_TRACE_SYSTEMTAP') ? 'man1' : ''), | |
17 | 'virtfs-proxy-helper.1': (have_virtfs_proxy_helper ? 'man1' : ''), | |
18 | 'virtiofsd.1': (have_virtiofsd ? 'man1' : ''), | |
19 | }, | |
20 | 'system': { | |
21 | 'qemu.1': 'man1', | |
22 | 'qemu-block-drivers.7': 'man7', | |
23 | 'qemu-cpu-models.7': 'man7' | |
24 | }, | |
25 | } | |
26 | ||
27 | sphinxdocs = [] | |
28 | sphinxmans = [] | |
29 | foreach manual : manuals | |
30 | private_dir = meson.current_build_dir() / (manual + '.p') | |
bac35bf5 | 31 | output_dir = meson.current_build_dir() / manual |
f8aa24ea | 32 | input_dir = meson.current_source_dir() / manual |
bac35bf5 PB |
33 | |
34 | this_manual = custom_target(manual + ' manual', | |
f8aa24ea | 35 | build_by_default: build_docs, |
bac35bf5 PB |
36 | output: [manual + '.stamp'], |
37 | input: [files('conf.py'), files(manual / 'conf.py')], | |
38 | depfile: manual + '.d', | |
b3f4830a | 39 | depend_files: sphinx_extn_depends, |
bac35bf5 PB |
40 | command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@', |
41 | '-Ddepfile_stamp=@OUTPUT0@', | |
42 | '-b', 'html', '-d', private_dir, | |
43 | input_dir, output_dir]) | |
44 | sphinxdocs += this_manual | |
f8aa24ea | 45 | if build_docs and manual != 'devel' |
491e74c1 | 46 | install_subdir(output_dir, install_dir: qemu_docdir) |
f8aa24ea PB |
47 | endif |
48 | ||
49 | these_man_pages = [] | |
50 | install_dirs = [] | |
51 | foreach page, section : man_pages.get(manual, {}) | |
52 | these_man_pages += page | |
53 | install_dirs += section == '' ? false : get_option('mandir') / section | |
54 | endforeach | |
55 | if these_man_pages.length() > 0 | |
56 | sphinxmans += custom_target(manual + ' man pages', | |
f8aa24ea PB |
57 | build_by_default: build_docs, |
58 | output: these_man_pages, | |
bac35bf5 | 59 | input: this_manual, |
f8aa24ea PB |
60 | install: build_docs, |
61 | install_dir: install_dirs, | |
62 | command: [SPHINX_ARGS, '-b', 'man', '-d', private_dir, | |
63 | input_dir, meson.current_build_dir()]) | |
64 | endif | |
65 | endforeach | |
66 | alias_target('sphinxdocs', sphinxdocs) | |
4ac2ee19 | 67 | alias_target('html', sphinxdocs) |
f8aa24ea PB |
68 | alias_target('man', sphinxmans) |
69 | endif |