summaryrefslogtreecommitdiff
path: root/build-aux/Makefile.each.tail/70-sdman.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/Makefile.each.tail/70-sdman.mk')
-rw-r--r--build-aux/Makefile.each.tail/70-sdman.mk113
1 files changed, 32 insertions, 81 deletions
diff --git a/build-aux/Makefile.each.tail/70-sdman.mk b/build-aux/Makefile.each.tail/70-sdman.mk
index 2e7e0d4e39..ccbb1bd4e1 100644
--- a/build-aux/Makefile.each.tail/70-sdman.mk
+++ b/build-aux/Makefile.each.tail/70-sdman.mk
@@ -20,103 +20,54 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
-include $(topsrcdir)/build-aux/Makefile.head.mk
+_sdman.man_xml = $(foreach _sdman.tmp,$(filter %.xml,$(files.src.src)),$(if $(findstring /,$(_sdman.tmp)),,$(_sdman.tmp)))
-MANPAGES =
-MANPAGES_ALIAS =
+ifneq ($(_sdman.man_xml),)
-include Makefile-man.am
+$(srcdir)/Makefile-man.mk: $(topsrcdir)/tools/make-man-rules.py $(topsrcdir)/tools/xml_helper.py $(topsrcdir)/man/custom-entities.ent.in $(outdir)/.var._sdman.man_xml $(call at.addprefix,$(srcdir),$(_sdman.man_xml))
+ $(AM_V_GEN)$(PYTHON) $< $(filter %.xml,$^) | $(WRITE_ATOMIC) $@
+files.src.gen += Makefile-man.mk
-.PHONY: man update-man-list
-man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
+sdman.MANPAGES =
+sdman.MANPAGES_ALIAS =
+#-include $(srcdir)/Makefile-man.mk
-XML_FILES = \
- ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
-HTML_FILES = \
- ${XML_FILES:.xml=.html}
-HTML_ALIAS = \
- ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
+_sdman.XML_FILES = \
+ ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(sdman.MANPAGES)}}}}}
+_sdman.HTML_FILES = \
+ ${_sdman.XML_FILES:.xml=.html}
+_sdman.HTML_ALIAS = \
+ ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(sdman.MANPAGES_ALIAS)}}}}}
ifneq ($(ENABLE_MANPAGES),)
man_MANS = \
- $(MANPAGES) \
- $(MANPAGES_ALIAS)
+ $(sdman.MANPAGES) \
+ $(sdman.MANPAGES_ALIAS)
noinst_DATA += \
- $(HTML_FILES) \
- $(HTML_ALIAS) \
- docs/html/man
+ $(_sdman.HTML_FILES) \
+ $(_sdman.HTML_ALIAS)
endif # ENABLE_MANPAGES
-CLEANFILES += \
- $(man_MANS) \
- $(HTML_FILES) \
- $(HTML_ALIAS) \
- docs/html/man
+at.subdirs += $(abspath $(topoutdir)/man)
-$(outdir)/man:
- $(AM_V_LN)$(LN_S) -f ../../man $@
+$(outdir)/%.1: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(_sdman.XSLTPROC_PROCESS_MAN)
-$(outdir)/index.html: man/systemd.index.html
- $(AM_V_LN)$(LN_S) -f systemd.index.html $@
+$(outdir)/%.3: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(_sdman.XSLTPROC_PROCESS_MAN)
-ifneq ($(HAVE_PYTHON),)
-noinst_DATA += \
- man/index.html
-endif # HAVE_PYTHON
-
-CLEANFILES += \
- man/index.html
-
-XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
-NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
-SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))}
-
-# This target should only be run manually. It recreates Makefile-man.am
-# file in the source directory based on all man/*.xml files. Run it after
-# adding, removing, or changing the conditional in a man page.
-update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) man/custom-entities.ent
- $(AM_V_GEN)$(PYTHON) $< $(XML_GLOB) > $(top_srcdir)/Makefile-man.tmp
- $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
- @echo "Makefile-man.am has been regenerated"
-
-$(outdir)/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
- $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
-
-$(outdir)/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
- $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
-
-CLEANFILES += \
- man/systemd.index.xml \
- man/systemd.directives.xml
-
-EXTRA_DIST += \
- $(filter-out man/systemd.directives.xml man/systemd.index.xml,$(XML_FILES)) \
- tools/make-man-index.py \
- tools/make-man-rules.py \
- tools/make-directive-index.py \
- tools/xml_helper.py \
- man/glib-event-glue.c
-
-$(outdir)/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-$(outdir)/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-$(outdir)/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-$(outdir)/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
+$(outdir)/%.5: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(_sdman.XSLTPROC_PROCESS_MAN)
-$(outdir)/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
+$(outdir)/%.7: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(_sdman.XSLTPROC_PROCESS_MAN)
-$(outdir)/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_HTML)
+$(outdir)/%.8: $(srcdir)/%.xml $(topsrcdir)/man/custom-man.xsl $(topoutdir)/man/custom-entities.ent
+ $(_sdman.XSLTPROC_PROCESS_MAN)
+$(outdir)/%.html: $(srcdir)/%.xml $(topsrcdir)/man/custom-html.xsl $(topoutdir)/man/custom-entities.ent
+ $(_sdman.XSLTPROC_PROCESS_HTML)
-include $(topsrcdir)/build-aux/Makefile.tail.mk
+endif # _sdman.man_xml