summaryrefslogtreecommitdiff
path: root/tools/make-man-rules.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/make-man-rules.py')
-rw-r--r--tools/make-man-rules.py27
1 files changed, 10 insertions, 17 deletions
diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py
index 5e61917d60..4461630341 100644
--- a/tools/make-man-rules.py
+++ b/tools/make-man-rules.py
@@ -24,16 +24,16 @@ import os.path
from xml_helper import *
SECTION = '''\
-MANPAGES += \\
+sd.MANPAGES += \\
{manpages}
-MANPAGES_ALIAS += \\
+sd.MANPAGES_ALIAS += \\
{aliases}
{rules}
{htmlrules}
'''
CONDITIONAL = '''\
-if {conditional}
+ifneq ($({conditional}),)
''' \
+ SECTION + \
'''\
@@ -44,8 +44,7 @@ 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
+# 2. Run 'make at-noop'
#
# To make a man page conditional on a configure switch add
# attribute conditional="ENABLE_WHAT" or conditional="WITH_WHAT"
@@ -54,22 +53,19 @@ HEADER = '''\
HTML_ALIAS_RULE = '''\
{}.html: {}.html
- $(html-alias)
+ $(sd.html-alias)
'''
FOOTER = '''\
# Really, do not edit this file.
-
-EXTRA_DIST += \\
- {dist_files}
'''
def man(page, number):
- return 'man/{}.{}'.format(page, number)
+ return '$(outdir)/{}.{}'.format(page, number)
def xml(file):
- return 'man/{}'.format(os.path.basename(file))
+ return '$(outdir)/{}'.format(os.path.basename(file))
def add_rules(rules, name):
xml = xml_parse(name)
@@ -106,7 +102,7 @@ def create_rules(xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
-def make_makefile(rules, dist_files):
+def make_makefile(rules):
return HEADER + '\n'.join(
(CONDITIONAL if conditional else SECTION).format(
manpages=mjoin(set(rulegroup.values())),
@@ -119,11 +115,8 @@ def make_makefile(rules, dist_files):
if k != v),
conditional=conditional)
for conditional,rulegroup in sorted(rules.items())
- ) + FOOTER.format(dist_files=mjoin(sorted(dist_files)))
+ ) + FOOTER
if __name__ == '__main__':
rules = create_rules(sys.argv[1:])
- dist_files = (xml(file) for file in sys.argv[1:]
- if not file.endswith(".directives.xml") and
- not file.endswith(".index.xml"))
- print(make_makefile(rules, dist_files), end='')
+ print(make_makefile(rules), end='')