summaryrefslogtreecommitdiffstats
path: root/doc/meson.build
blob: aca73d8a906c3604deee1879fe96186c00f18f5a (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
35
36

sphinx = find_program('sphinx-build', native : true, required : get_option('man-pages').enabled() or get_option('documentation').enabled())

man_pages = [
  'flashrom.8'
]

if sphinx.found()
  if get_option('man-pages').auto() or get_option('man-pages').enabled()
    man_outputs = []
    foreach page : man_pages
      man_outputs += 'man' + page.substring(-1)
    endforeach

    custom_target(
      'man-pages',
      command : [sphinx, '-b', 'man', '-q', '-d', '@PRIVATE_DIR@', '-Drelease=' + flashrom_version,'@CURRENT_SOURCE_DIR@', '@OUTDIR@'],
      build_always_stale : true, # sphinx handles rebuilds
      output  : man_outputs,
      install : true,
      install_dir : get_option('mandir'),
    )
  endif

  if get_option('documentation').auto() or get_option('documentation').enabled()
    custom_target(
      'documentation',
      command : [sphinx, '-b', 'html', '-q', '-d', '@PRIVATE_DIR@', '-Drelease=' + flashrom_version,'@CURRENT_SOURCE_DIR@', '@OUTDIR@/html'],
      build_always_stale : true, # sphinx handles rebuilds
      output  : 'html',
      install : true,
      install_dir : get_option('datadir') + '/doc/flashrom'
    )
  endif

endif