1 # Makefile for amanda man-pages
5 AMPLOT_MAN_PAGES = amplot.8
7 COMMON_MAN_PAGES = amanda.8 \
11 amanda-archive-format.5 \
17 amanda-applications.7 \
57 RECOVER_MAN_PAGES = amrecover.8
59 RESTORE_MAN_PAGES = amrestore.8 \
62 ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \
66 $(RECOVER_MAN_PAGES) \
69 WANTED_MAN_PAGES = $(COMMON_MAN_PAGES)
71 WANTED_MAN_PAGES += $(AMPLOT_MAN_PAGES)
74 WANTED_MAN_PAGES += $(CLIENT_MAN_PAGES)
77 WANTED_MAN_PAGES += $(SERVER_MAN_PAGES)
80 WANTED_MAN_PAGES += $(RECOVER_MAN_PAGES)
83 WANTED_MAN_PAGES += $(RESTORE_MAN_PAGES)
86 SRCMANPAGEDIR = $(srcdir)/xml-source
88 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
90 EXTRA_XML = xslt/expand-sambadoc.xsl \
94 entities/global.entities.in \
97 EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_HTML) $(EXTRA_XML)
99 GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
101 MOSTLYCLEANFILES = $(GEN_XML)
102 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
104 # some of the XSL needs to know what docbook-xsl version we've selected
105 %.xsl: %.xsl.in $(top_builddir)/config.status
106 $(top_builddir)/config.status --file=$@:$<
109 entities/global.entities: entities/global.entities.in $(top_builddir)/config.status
110 $(top_builddir)/config.status --file=$@:$<
113 if ENABLE_MANPAGE_BUILD
114 # phase one of the documentation build expands some macros.
115 xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl entities/global.entities
116 $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
118 # phase two generates a manpage from the resulting "expanded" docbook XML
119 %: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl entities/global.entities
120 $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/man.xsl $<
122 %.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl entities/global.entities
123 $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/html.xsl $<
125 else !ENABLE_MANPAGE_BUILD
127 %: $(SRCMANPAGEDIR)/%.xml
128 @echo WARNING: Not building needed $@ because building manpages is disabled.
131 # (no rule to build HTML without ENABLE_MANPAGE_BUILD)
143 ALL_MAN_HTMLS = $(ALL_MAN_PAGES:%=%.html)
145 # toplevel rule to build HTML manpages and tar them up
146 html: amanda.css index.php $(ALL_MAN_HTMLS)
147 tar -zcf html.tar.gz $(ALL_MAN_HTMLS) amanda.css index.php
149 # double-check that we don't ship dummy manpages
151 for f in $(WANTED_MAN_PAGES); do \
152 if sed -e 1q $(distdir)/$$f | $(GREP) '^DUMMY$$' >/dev/null 2>/dev/null; then \
153 echo "$(distdir)/$$f is a dummy manpage; cannot create distribution"; \
158 man_MANS = $(WANTED_MAN_PAGES)