From 53609de59d9282c3008e1edcbf5f9f4f1e84216e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 31 Mar 2009 19:56:09 +0000 Subject: Hopefully fix building and cleaning of bb-man.xsl. --- docs/Makefile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/Makefile b/docs/Makefile index 7276b589..f337fd86 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -39,7 +39,9 @@ $(HTML_DIR)/instguide/index.html: $(BOOKXSL) $(DOCBOOK_DIR)/instguide.xml $(DOCBOOK_DIR)/ExceptionCodes.xml: ../ExceptionCodes.txt perl tools/generate_except_xml.pl $< $> $@ -manpages: $(MANXSL) man-dirs man-nroff man-html +manpages: man-dirs man-nroff man-html + +xslt: $(MANXSL) $(MANXSL): $(MANXSL).tmpl @if [ -f /usr/local/share/xsl/docbook/manpages/docbook.xsl ]; then \ @@ -82,21 +84,32 @@ man-html: $(HTML_FILES) $(HTML_DIR)/man-html/%.html: $(DOCBOOK_DIR)/%.xml $(NOCHUNKBOOKXSL) $(DBPROC) -o $@ $(NOCHUNKBOOKXSL) $< +# Before running xsltproc to generate manual pages, we need to check +# that $(MANXSL) has been built. We don't want to add it to dependencies, +# because that would cause # the man pages to try to be rebuilt even if +# they already exist if the date of the xslt file changes, and that +# requires xsltproc, which negates the point of precompiling them for +# distribution users. + # GNU make -$(MAN_DIR)/%.8.gz: $(DOCBOOK_DIR)/%.xml $(MANXSL) +$(MAN_DIR)/%.8.gz: $(DOCBOOK_DIR)/%.xml + $(MAKE) xslt $(DBPROC) -o $(@:.gz=) $(MANXSL) $< gzip $(@:.gz=) # GNU make -$(MAN_DIR)/%.5.gz: $(DOCBOOK_DIR)/%.xml $(MANXSL) +$(MAN_DIR)/%.5.gz: $(DOCBOOK_DIR)/%.xml + $(MAKE) xslt $(DBPROC) -o $(@:.gz=) $(MANXSL) $< gzip $(@:.gz=) -# BSD make: the final colon (:) is required to make this line valid syntax -# for a dummy rule in GNU make. It creates a dummy rule in BSD make too. -# Both dummy rules are harmless. +# BSD make: the final colon (:) is required to make the .for and .endfor +# lines valid in GNU make. It creates (different) dummy rules in GNU and +# BSD make. Both dummy rules are harmless. + .for MAN_PAGE in $(NROFF_PAGES) : $(MAN_DIR)/$(MAN_PAGE).gz: $(DOCBOOK_DIR)/$(MAN_PAGE:R).xml + $(MAKE) xslt $(DBPROC) -o $(.TARGET:.gz=) $(MANXSL) $> gzip $(@:.gz=) -- cgit v1.2.3