summaryrefslogtreecommitdiffstats
path: root/doc/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'doc/meson.build')
-rw-r--r--doc/meson.build36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 000000000..aca73d8a9
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,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