summaryrefslogtreecommitdiff
path: root/man/meson.build
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-18 21:00:46 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-23 21:47:29 -0400
commit18af8932e8f74f776a591caba4dacfea4c6d62bd (patch)
treee13f986df8f6ae22dacdd5b3fb1aff9dfdc679da /man/meson.build
parent1276a9f63a2acddcb8a21d57230f318ae34928bb (diff)
downloadsystemd-18af8932e8f74f776a591caba4dacfea4c6d62bd.tar.gz
meson: add rule to regenerate man/rules/meson.build
Diffstat (limited to 'man/meson.build')
-rw-r--r--man/meson.build18
1 files changed, 15 insertions, 3 deletions
diff --git a/man/meson.build b/man/meson.build
index 79d7710d11..b71bc20509 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -1,9 +1,6 @@
# This is lame, I know, but meson has no other include mechanism
subdir('rules')
-# TODO: add regeneration rule:
-# python3 tools/make-man-rules.py --meson man/*xml > man/rules/meson.build
-
want_man = get_option('man')
want_html = get_option('html')
xsltproc = find_program('xsltproc',
@@ -152,3 +149,18 @@ run_target(
'--omit-dir-times',
meson.current_build_dir(),
get_option('www-target')])
+
+############################################################
+
+if git.found()
+ run_target(
+ 'update-man-rules',
+ # slightly strange syntax because of
+ # https://github.com/mesonbuild/meson/issues/1643
+ # and https://github.com/mesonbuild/meson/issues/1512
+ command : ['sh', '-c',
+ 'cd @0@ && '.format(meson.build_root()) +
+ 'python3 @0@/tools/make-man-rules.py --meson `git ls-files ":/man/*.xml"` >t && '.format(meson.source_root()) +
+ 'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
+ depend_files : custom_entities_ent)
+endif