3 # This is lame, I know, but meson has no other include mechanism
6 # TODO: add regeneration rule:
7 # python3 tools/make-man-rules.py --meson man/*xml > man/rules/meson.build
9 xsltproc = find_program('xsltproc')
13 '--stringparam', 'man.output.quietly', '1',
14 '--stringparam', 'funcsynopsis.style', 'ansi',
15 '--stringparam', 'man.authors.section.enabled', '0',
16 '--stringparam', 'man.copyright.section.enabled', '0',
17 '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()),
19 '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())]
21 custom_man_xsl = files('custom-man.xsl')
22 custom_html_xsl = files('custom-man.xsl')
24 custom_entities_ent = configure_file(
25 input : 'custom-entities.ent.in',
26 output : 'custom-entities.ent',
29 foreach tuple : manpages
37 man = stem + '.' + section
41 foreach alias : aliases
42 manaliases += [alias + '.' + section]
43 htmlaliases += [alias + '.html']
46 mandirn = get_option('mandir') + '/man' + section
48 install = condition == '' or conf.get(condition, 0) == 1
53 output : [man] + manaliases,
54 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'],
55 depend_files : custom_entities_ent,
57 install_dir : mandirn)
62 output : [html] + htmlaliases,
63 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'],
64 depend_files : custom_entities_ent)
67 message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, install))
71 ############################################################
73 source_xml_files = files()
74 foreach tuple : manpages
75 source_xml_files += files(tuple[0] + '.xml')
78 systemd_directives_xml = custom_target(
79 'systemd.directives.xml',
80 input : source_xml_files,
81 output : 'systemd.directives.xml',
82 command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files)
84 nonindex_xml_files = source_xml_files + [systemd_directives_xml]
85 systemd_index_xml = custom_target(
87 input : nonindex_xml_files,
88 output : 'systemd.index.xml',
89 command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files)
91 foreach tuple : [['systemd.directives', '7', systemd_directives_xml],
92 ['systemd.index', '7', systemd_index_xml]]
98 man = stem + '.' + section
100 mandirn = get_option('mandir') + '/man' + section
106 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'],
108 install_dir : mandirn)
114 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'])