]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
doc/meson: provide a full-path version of api_files
authorJeremy Kerr <jk@codeconstruct.com.au>
Mon, 11 Jul 2022 10:08:47 +0000 (18:08 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Mon, 11 Jul 2022 10:08:47 +0000 (18:08 +0800)
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 <jk@codeconstruct.com.au>
doc/meson.build

index c580b1a4a2aec96712bfc15953e0857308bd8175..ff63744764135af1610c9288b92ae5e0fc9c5a95 100644 (file)
@@ -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