summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-02 20:22:35 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-18 10:04:44 -0400
commit0689f766dca5b83443fe0990846478059244d123 (patch)
tree90061691c2d701aa21306729a9b4a4042ab6e1cf
parent72cdb3e783174dcf9223a49f03e3b0e2ca95ddb8 (diff)
downloadsystemd-0689f766dca5b83443fe0990846478059244d123.tar.gz
build-sys: drop support for generation of Makefile-man.am
-rw-r--r--man/meson.build2
-rwxr-xr-xtools/make-man-rules.py71
2 files changed, 5 insertions, 68 deletions
diff --git a/man/meson.build b/man/meson.build
index 4f2ddad31a..a93693c43c 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -198,7 +198,7 @@ if git.found()
# 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()) +
+ 'python3 @0@/tools/make-man-rules.py `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
diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py
index e9e39f10af..da94d3eabe 100755
--- a/tools/make-man-rules.py
+++ b/tools/make-man-rules.py
@@ -25,55 +25,11 @@ import os.path
import pprint
from xml_helper import *
-SECTION = '''\
-MANPAGES += \\
- {manpages}
-MANPAGES_ALIAS += \\
- {aliases}
-{rules}
-{htmlrules}
-'''
-
-CONDITIONAL = '''\
-if {conditional}
-''' \
-+ SECTION + \
-'''\
-endif
-'''
-
-HEADER = '''\
-# Do not edit. Generated by make-man-rules.py.
-# To regenerate:
-# 1. Create, update, or remove source .xml files in man/
-# 2. Run 'make update-man-list'
-# 3. Run 'make man' to generate manpages
-#
-# To make a man page conditional on a configure switch add
-# attribute conditional="ENABLE_WHAT" or conditional="WITH_WHAT"
-# to <refentry> element.
-'''
-
-HTML_ALIAS_RULE = '''\
-{}.html: {}.html
- $(html-alias)
-'''
-
-FOOTER = '''\
-
-# Really, do not edit this file.
-
-EXTRA_DIST += \\
- {dist_files}
-'''
-
-meson = False
-
def man(page, number):
- return ('man/' if not meson else '') + '{}.{}'.format(page, number)
+ return '{}.{}'.format(page, number)
def xml(file):
- return ('man/' if not meson else '') + os.path.basename(file)
+ return os.path.basename(file)
def add_rules(rules, name):
xml = xml_parse(name)
@@ -110,21 +66,6 @@ def create_rules(xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
-def make_makefile(rules, dist_files):
- return HEADER + '\n'.join(
- (CONDITIONAL if conditional else SECTION).format(
- manpages=mjoin(set(rulegroup.values())),
- aliases=mjoin(k for k,v in rulegroup.items() if k != v),
- rules='\n'.join('{}: {}'.format(k,v)
- for k,v in sorted(rulegroup.items())
- if k != v),
- htmlrules='\n'.join(HTML_ALIAS_RULE.format(k[:-2],v[:-2])
- for k,v in sorted(rulegroup.items())
- if k != v),
- conditional=conditional)
- for conditional,rulegroup in sorted(rules.items())
- ) + FOOTER.format(dist_files=mjoin(sorted(dist_files)))
-
MESON_HEADER = '''\
# Do not edit. Generated by make-man-rules.py.
manpages = ['''
@@ -151,14 +92,10 @@ def make_mesonfile(rules, dist_files):
return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER))
if __name__ == '__main__':
- meson = sys.argv[1] == '--meson'
- pages = sys.argv[1+meson:]
+ pages = sys.argv[1:]
rules = create_rules(pages)
dist_files = (xml(file) for file in pages
if not file.endswith(".directives.xml") and
not file.endswith(".index.xml"))
- if meson:
- print(make_mesonfile(rules, dist_files))
- else:
- print(make_makefile(rules, dist_files), end='')
+ print(make_mesonfile(rules, dist_files))