diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-02-05 10:31:20 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-02-06 23:16:17 -0500 |
commit | c78ab91132aab9193f3c17a9a206f8825ff4be84 (patch) | |
tree | 5844ab1f9f3652e9fa5a894b898c5108270cda89 /make-man-rules.py | |
parent | 7ad94c716d6403233d04c4d37cb14df958c9b65d (diff) |
build-sys: substitute strings in systemd.unit(5)
Makefile.am is updated to deal with .xml.in sources. Nothing in the
output is really changed yet, this is just preparation.
Diffstat (limited to 'make-man-rules.py')
-rw-r--r-- | make-man-rules.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/make-man-rules.py b/make-man-rules.py index b88b43ac3d..9c50c8dec2 100644 --- a/make-man-rules.py +++ b/make-man-rules.py @@ -44,6 +44,12 @@ HEADER = '''\ ''' +CLEANFILES = '''\ + +CLEANFILES += \\ + {cleanfiles} +''' + def man(page, number): return 'man/{}.{}'.format(page, number) @@ -76,7 +82,7 @@ def create_rules(*xml_files): def mjoin(files): return ' \\\n\t'.join(sorted(files) or '#') -def make_makefile(rules): +def make_makefile(rules, cleanfiles): return HEADER + '\n'.join( (CONDITIONAL if conditional else SECTION).format( manpages=mjoin(set(rulegroup.values())), @@ -85,8 +91,12 @@ def make_makefile(rules): for k,v in sorted(rulegroup.items()) if k != v), conditional=conditional) - for conditional,rulegroup in sorted(rules.items())) + for conditional,rulegroup in sorted(rules.items())) + \ + CLEANFILES.format(cleanfiles=mjoin(cleanfiles)) if __name__ == '__main__': - rules = create_rules(*sys.argv[1:]) - print(make_makefile(rules), end='') + sources = set(sys.argv[1:]) + spares = set([source for source in sources + if source + '.in' in sources]) + rules = create_rules(*(sources - spares)) + print(make_makefile(rules, spares), end='') |