summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-05 14:36:21 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-09-08 17:07:07 +0200
commit895236c6ead83ed537d762394c9930b1e82d8dde (patch)
treeaf75538e3e794959272fa27bb33ec8d91beb64ac /man
parentc4614fedd97e0aea3095fac6d66eb977d35f7e42 (diff)
meson: add manpage support
It seems like meson doesn't want you to string together targets like make does, but wants it all in one step. So another little shell script it is. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'man')
-rw-r--r--man/defs.rst.in5
-rw-r--r--man/meson.build45
-rwxr-xr-xman/rst2man.sh16
3 files changed, 66 insertions, 0 deletions
diff --git a/man/defs.rst.in b/man/defs.rst.in
new file mode 100644
index 00000000..54b7eec0
--- /dev/null
+++ b/man/defs.rst.in
@@ -0,0 +1,5 @@
+.. |PACKAGE_NAME| replace:: @PACKAGE_NAME@
+.. |PACKAGE_VERSION| replace:: @PACKAGE_VERSION@
+.. |PACKAGE_STRING| replace:: @PACKAGE_STRING@
+.. |MANUAL_SECTION| replace:: 1
+.. |MANUAL_GROUP| replace:: General Commands Manual
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 00000000..4f9f88e8
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,45 @@
+manpages = [
+ 'intel_aubdump',
+ 'intel_audio_dump',
+ 'intel_bios_dumper',
+ 'intel_error_decode',
+ 'intel_gpu_frequency',
+ 'intel_gpu_top',
+ 'intel_gtt',
+ 'intel_infoframes',
+ 'intel_lid',
+ 'intel_panel_fitter',
+ 'intel_reg',
+ 'intel_stepping',
+ 'intel_upload_blit_large',
+ 'intel_upload_blit_large_gtt',
+ 'intel_upload_blit_large_map',
+ 'intel_upload_blit_small',
+ 'intel_vbt_decode',
+]
+
+man_config = configuration_data()
+
+man_config.set('PACKAGE_NAME', meson.project_name())
+man_config.set('PACKAGE_VERSION', meson.project_version())
+man_config.set('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
+
+defs_rst = configure_file(input : 'defs.rst.in',
+ output : 'defs.rst',
+ configuration : man_config)
+
+rst2man = find_program('rst2man', required : false)
+rst2man_script = find_program('rst2man.sh')
+
+if rst2man.found()
+ foreach manpage : manpages
+ custom_target(manpage + '.1',
+ build_by_default : true,
+ command : [ rst2man_script, '@INPUT@', '@OUTPUT@' ],
+ depend_files : [ defs_rst ],
+ input: manpage + '.rst',
+ output : manpage + '.1.gz',
+ install : true,
+ install_dir : join_paths(get_option('mandir'), 'man1'))
+ endforeach
+endif
diff --git a/man/rst2man.sh b/man/rst2man.sh
new file mode 100755
index 00000000..fc2b5ed8
--- /dev/null
+++ b/man/rst2man.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+input=$1
+output=$2
+
+out_dir=$(dirname ${output})
+in_file=$(basename ${input})
+
+# rst2man doesn't handle multiple source directories well, and since defs.rst is
+# generated we first need to move it all into the build dir
+cp $input $out_dir
+
+rst2man $out_dir/$in_file ${output%.gz}
+
+rm -f ${output}
+gzip ${output%.gz}