diff options
-rw-r--r-- | Makefile-man.am | 3 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | make-man-rules.py | 18 | ||||
-rw-r--r-- | man/.gitignore | 1 | ||||
-rw-r--r-- | man/systemd.unit.xml.in (renamed from man/systemd.unit.xml) | 0 |
5 files changed, 19 insertions, 5 deletions
diff --git a/Makefile-man.am b/Makefile-man.am index d54d67cf11..ee9a952765 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -477,3 +477,6 @@ MANPAGES_ALIAS += \ # endif + +CLEANFILES += \ + man/systemd.unit.xml diff --git a/Makefile.am b/Makefile.am index f73e8a6e74..6e5f5af9ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -503,7 +503,7 @@ CLEANFILES += \ if HAVE_PYTHON NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES)) -XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml) +XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_srcdir)/man/*.xml.in) update-man-list: make-man-rules.py $(XML_GLOB) $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am 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='') diff --git a/man/.gitignore b/man/.gitignore index 9c5a7db1cc..18767949c1 100644 --- a/man/.gitignore +++ b/man/.gitignore @@ -1,3 +1,4 @@ /systemd.directives.xml /systemd.index.xml +/systemd.unit.xml /*.[13578] diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml.in index 7c3a6c75f8..7c3a6c75f8 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml.in |