From 9ecff41dd11e920286f9be670a0ec3a668371d1d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 26 Jul 2022 07:25:28 +0200 Subject: Merging upstream version 1.1~rc0. Signed-off-by: Daniel Baumann --- doc/meson.build | 99 +++++++++++++++++++++++++++------------------------------ 1 file changed, 46 insertions(+), 53 deletions(-) (limited to 'doc/meson.build') diff --git a/doc/meson.build b/doc/meson.build index 0f04343..d716c8b 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -13,22 +13,45 @@ api_files = [ 'ioctl.h', 'linux.h', 'log.h', + 'mi.h', 'tree.h', 'types.h', 'fabrics.h', 'util.h' ] +api_paths = [] +foreach f: api_files + api_paths += files('../src/nvme/' + f) +endforeach + sphinx_sources = [ 'conf.py', + 'api.rst', 'index.rst', + 'quickstart.rst', + 'installation.rst', + 'mi.rst', 'config-schema.json' ] +static_sources = [] +foreach file : sphinx_sources + static_sources += configure_file(input: file + '.in', + output: file, + configuration: substs) +endforeach + +subdir('rst') + want_docs = get_option('docs') want_docs_build = get_option('docs-build') +kernel_doc = find_program('kernel-doc') +kernel_doc_check = find_program('kernel-doc-check') + +test('kdoc', kernel_doc_check, args: api_paths) + if want_docs != 'false' - kernel_doc = find_program('kernel-doc') conf = configuration_data() conf.set('SYSCONFDIR', sysconfdir) @@ -37,29 +60,27 @@ if want_docs != 'false' mandir = join_paths(get_option('mandir'), 'man2') list_man_pages = find_program('list-man-pages.sh') if want_docs_build - foreach apif : api_files - foreach file : files('../src/nvme/' + apif) - subst = configure_file( - input: file, - output: '@BASENAME@.msubst', - configuration: conf) - c = run_command(list_man_pages, subst) - man_pages = c.stdout().split() - foreach page : man_pages - custom_target( - page.underscorify() + '_man', - input: subst, - output: page + '.2', - capture: true, - command: [kernel_doc, - '-module', 'libnvme', - '-man', - '-function', - page, - subst], - install: true, - install_dir: mandir) - endforeach + foreach apif : api_paths + subst = configure_file( + input: apif, + output: '@BASENAME@.subst', + configuration: conf) + c = run_command(list_man_pages, subst, check: true) + man_pages = c.stdout().split() + foreach page : man_pages + custom_target( + page.underscorify() + '_man', + input: subst, + output: page + '.2', + capture: true, + command: [kernel_doc, + '-module', 'libnvme', + '-man', + '-function', + page, + subst], + install: true, + install_dir: mandir) endforeach endforeach else @@ -73,37 +94,9 @@ if want_docs != 'false' htmldir = join_paths(get_option('htmldir'), 'nvme') sphinx_build = find_program('sphinx-build-3', 'sphinx-build') if sphinx_build.found() and want_docs_build - cat = find_program('cat') - rsts = [] - foreach apif : api_files - afile = files('../src/nvme/' + apif) - subst = configure_file( - input: afile, - output: '@BASENAME@.hsubst', - configuration: conf) - rst = custom_target( - apif.underscorify() + '_rst', - input: subst, - output: '@BASENAME@._rst', - capture: true, - command: [kernel_doc, - '-rst', - '@INPUT@']) - rsts += rst - endforeach - libnvme = custom_target( - 'libnvme', - command: [ cat, '@INPUT@' ], - capture: true, - input: rsts, - output: 'libnvme.rst') - static_sources = [] - foreach file : sphinx_sources - static_sources += configure_file(input: file, output: file, copy: true) - endforeach custom_target( 'generate_doc_html', - input: [static_sources, libnvme], + input: [static_sources, rst], output: 'html', command: [sphinx_build, '-b', 'html', -- cgit v1.2.3