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 want_man = get_option('man')
10 want_html = get_option('html')
11 xsltproc = find_program('xsltproc',
12 required : want_man == 'yes' or want_html == 'yes')
13 want_man = want_man != 'no' and xsltproc.found()
14 want_html = want_html != 'no' and xsltproc.found()
19 '--stringparam', 'man.output.quietly', '1',
20 '--stringparam', 'funcsynopsis.style', 'ansi',
21 '--stringparam', 'man.authors.section.enabled', '0',
22 '--stringparam', 'man.copyright.section.enabled', '0',
23 '--stringparam', 'systemd.version', '@0@'.format(meson.project_version()),
25 '@0@:@1@'.format(meson.current_build_dir(), meson.current_source_dir())]
27 custom_man_xsl = files('custom-man.xsl')
28 custom_html_xsl = files('custom-html.xsl')
30 custom_entities_ent = configure_file(
31 input : 'custom-entities.ent.in',
32 output : 'custom-entities.ent',
38 foreach tuple : manpages
46 man = stem + '.' + section
50 foreach alias : aliases
51 manaliases += [alias + '.' + section]
52 htmlaliases += [alias + '.html']
55 mandirn = get_option('mandir') + '/man' + section
57 have = condition == '' or conf.get(condition, 0) == 1
63 output : [man] + manaliases,
64 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'],
65 depend_files : custom_entities_ent,
67 install_dir : mandirn)
73 output : [html] + htmlaliases,
74 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'],
75 depend_files : custom_entities_ent,
77 install_dir : docdir + '/html')
80 source_xml_files += files(tuple[0] + '.xml')
82 message('Skipping @0@.@1@ because @2@ is @3@'.format(stem, section, condition, have))
86 ############################################################
88 systemd_directives_xml = custom_target(
89 'systemd.directives.xml',
90 input : source_xml_files,
91 output : 'systemd.directives.xml',
92 command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files)
94 nonindex_xml_files = source_xml_files + [systemd_directives_xml]
95 systemd_index_xml = custom_target(
97 input : nonindex_xml_files,
98 output : 'systemd.index.xml',
99 command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files)
101 foreach tuple : [['systemd.directives', '7', systemd_directives_xml],
102 ['systemd.index', '7', systemd_index_xml]]
107 html = stem + '.html'
108 man = stem + '.' + section
110 mandirn = get_option('mandir') + '/man' + section
116 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_man_xsl, '@INPUT@'],
118 install_dir : mandirn)
125 command : [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags + [custom_html_xsl, '@INPUT@'],
127 install_dir : docdir + '/html')
136 custom_target('html',
137 depends : html_pages,