summaryrefslogtreecommitdiffstats
path: root/doc/rst/meson.build
blob: ea791155552de102f21e310e604a2683110c4156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
want_docs = get_option('docs')

if want_docs != 'false'
  want_docs_build = get_option('docs-build')
  rstdir = get_option('rstdir')
  if want_docs_build
    kernel_doc = find_program('../kernel-doc')

    conf = configuration_data()
    conf.set('SYSCONFDIR', sysconfdir)

    if want_docs == 'all' or want_docs == 'rst' or want_docs == 'html'
      foreach apif : api_files
        afile = files('../../src/nvme/' + apif)
        subst = configure_file(
            input: afile,
            output: '@BASENAME@.subst',
            configuration: conf)
        rst = custom_target(
          apif.underscorify() + '_rst',
          input: subst,
          output: '@BASENAME@.rst',
          capture: true,
          command: [kernel_doc,
                    '-rst',
                    '@INPUT@'],
          install: true,
          install_dir: rstdir)
      endforeach
    endif
  else
    # no prebuild docs
  endif
endif