aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
Diffstat (limited to 'man')
-rw-r--r--man/meson.build37
1 files changed, 24 insertions, 13 deletions
diff --git a/man/meson.build b/man/meson.build
index 2e346ec..130c8ec 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -18,20 +18,31 @@ pages = [
'dumpelf.docbook', 'pspax.docbook', 'scanelf.docbook', 'scanmacho.docbook'
]
+fs = import('fs')
+
out_pages = []
+generated_man_pages_exist = true
foreach page : pages
- out_pages += page.replace('.docbook', '.1')
+ man_page_name = page.replace('.docbook', '.1')
+ out_pages += man_page_name
+ if not fs.exists(man_page_name)
+ generated_man_pages_exist = false
+ endif
endforeach
-custom_target('docbook_to_man',
- command : [
- xmlto, '-x', files('custom.xsl'), '--skip-validation',
- '-o', meson.current_build_dir(), 'man', book
- ],
- input : [
- 'pax-utils.docbook.in', 'custom.xsl', 'fragment/reftail',
- ] + pages,
- output : out_pages,
- install : true,
- install_dir : get_option('mandir') / 'man1'
-)
+if generated_man_pages_exist
+ install_man(out_pages)
+else
+ custom_target('docbook_to_man',
+ command : [
+ xmlto, '-x', files('custom.xsl'), '--skip-validation',
+ '-o', meson.current_build_dir(), 'man', book
+ ],
+ input : [
+ 'pax-utils.docbook.in', 'custom.xsl', 'fragment/reftail',
+ ] + pages,
+ output : out_pages,
+ install : true,
+ install_dir : get_option('mandir') / 'man1'
+ )
+endif