From e33cc1782a01cb96ecbbfdf913047b52ab429984 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 11 Jul 2022 18:08:47 +0800 Subject: [PATCH] doc/meson: provide a full-path version of api_files We currently expand api_files into their full paths when constructing the manpage build rules. However, we'll want to use this same set of paths for a future change, so provide an expanded version of the array globally. Signed-off-by: Jeremy Kerr --- doc/meson.build | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index c580b1a4..ff637447 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -20,6 +20,11 @@ api_files = [ 'util.h' ] +api_paths = [] +foreach f: api_files + api_paths += files('../src/nvme/' + f) +endforeach + sphinx_sources = [ 'conf.py', 'api.rst', @@ -51,29 +56,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@.subst', - 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: file, + output: '@BASENAME@.subst', + 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 endforeach else -- 2.50.1