From: Michael Smith Date: Fri, 8 Apr 2005 11:22:20 +0000 (+0000) Subject: Renamed original Makefile to Makefile-example.txt so that it will X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23a000579140d806c5c5b7bcb89d27584359e586;p=docbook-dsssl Renamed original Makefile to Makefile-example.txt so that it will get included in the release package correctly. Also added support for a new depends-file param, when helps to get "clean" targe in depends.* files set up correctly. Also make change to suppress warnings about depends.* files being missing. --- diff --git a/website/example/Makefile b/website/example/Makefile index cec2d1d2b..f15f5d21a 100644 --- a/website/example/Makefile +++ b/website/example/Makefile @@ -1,169 +1,5 @@ -# Example Makefile for building a site using DocBook Website -# -# $Id$ -# -# ------------------------------------------------------------------ -# The default value DOCBOOK_WEBSITE below is the canonical URI for -# the current DocBook Website distribution. If you have SGML or -# XML catalogs correctly set up for DocBook Website in your -# environment, and have the DocBook Website distribution installed -# locally on your system, the URI will automatically be resolved -# to the appropriate local path on your system. -# ------------------------------------------------------------------ -# IMPORTANT! -# ------------------------------------------------------------------ -# IF YOU DO NOT HAVE SGML OR XML CATALOGS SET UP ON YOUR SYSTEM, -# change the value of DOCBOOK_WEBSITE to the appropricate local -# pathname for your system. OR, run "make" like this: -# -# make DOCBOOK_WEBSITE=/foo/bar/website -# -# Note that DOCBOOK_WEBSITE SHOULD NOT BE THE URI FOR YOUR SITE! -# There is nowhere in this makefile where you need to specify that. -# ------------------------------------------------------------------ -# -DOCBOOK_WEBSITE=http://docbook.sourceforge.net/release/website/current -#DOCBOOK_WEBSITE=/usr/share/xml/docbook/custom/website/current - -# generate non-tabular output instead of tabular? 1=Yes 0=No -MAKENONTAB=0 - -# use HTML Tidy to pretty-print HTML? 1=Yes 0=No -USETIDY=0 -# specifies how to call tidy -TIDY=tidy -# specifies options to feed to tidy -TIDYOPTS=-iq -latin1 -mn - -# specifies command for calling your XSLT engine -XSLT=java \ - -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \ - -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \ - -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl \ - com.icl.saxon.StyleSheet \ - -x org.apache.xml.resolver.tools.ResolvingXMLReader \ - -y org.apache.xml.resolver.tools.ResolvingXMLReader \ - -r org.apache.xml.resolver.tools.CatalogResolver \ - -# to use xsltproc as your XSLT engine, either uncomment the next -# line or just run make like this: "make XSLT=xsltproc" -#XSLT=xsltproc - -# XMLPARSER specifies command for calling your preferred XML -# parser for validating the DocBook XML sources for your site -ifeq ($(notdir $(XSLT)),xsltproc) -XMLPARSER=xmllint --valid --noout -else -XMLPARSER=java \ - -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \ - -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \ - org.apache.xml.resolver.apps.xread -endif - -# the following is empty by default; put any custom DocBook -# stylesheet params you want here; they will be applied globally -# to all HTML transformations from your DocBook XML sources -STYLEOPT= - -# name of directory to use if chunking output with "make chunk" -DESTPATH=. - -# what prefix to use on non-tabular versions HTML files? -NONTABPREFIX=n- - -TABSTYLE = $(DOCBOOK_WEBSITE)/xsl/tabular.xsl -WEBSTYLE = $(DOCBOOK_WEBSITE)/xsl/website.xsl -TABCHUNK = $(DOCBOOK_WEBSITE)/xsl/chunk-tabular.xsl -WEBCHUNK = $(DOCBOOK_WEBSITE)/xsl/chunk-website.xsl -AUTOLAYOUT = $(DOCBOOK_WEBSITE)/xsl/autolayout.xsl -MAKEDEPENDS = $(DOCBOOK_WEBSITE)/xsl/makefile-dep.xsl -MAKETARGETSDB = $(DOCBOOK_WEBSITE)/xsl/website-targets.xsl - -XMLDEPENDS = autolayout.xml website.database.xml - -.PHONY : clean - -all: - $(MAKE) website - $(MAKE) MAKENONTAB=1 website - -ifeq ($(MAKENONTAB),0) -STYLESHEET=$(TABSTYLE) -STYLECHUNK=$(TABCHUNK) -TEXTOPT= -include depends.tabular -else -STYLESHEET=$(WEBSTYLE) -STYLECHUNK=$(WEBCHUNK) -ifeq ($(basename $(XSLT)),xsltproc) -TEXTOPT= --stringparam filename-prefix $(NONTABPREFIX) -else -TEXTOPT= filename-prefix=$(NONTABPREFIX) -endif -include depends.nontabular -endif - -autolayout.xml: layout.xml - $(XMLPARSER) $(filter-out $(XMLDEPENDS),$^) -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) $(AUTOLAYOUT) $< > $@ -else - $(XSLT) $< $(AUTOLAYOUT) use.extensions=1 > $@ -endif - -chunk: autolayout.xml -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) --param output-root $(DESTPATH) $(STYLECHUNK) autolayout.xml -else - $(XSLT) autolayout.xml $(STYLECHUNK) use.extensions=1 output-root=$(DESTPATH) -endif - -%.html: autolayout.xml website.database.xml - $(XMLPARSER) $(filter-out $(XMLDEPENDS),$^) -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) $(TEXTOPT) $(STYLEOPT) $(STYLESHEET) $(filter-out $(XMLDEPENDS),$^) > $@ -else - $(XSLT) $(filter-out $(XMLDEPENDS),$^) $(STYLESHEET) $(TEXTOPT) $(STYLEOPT) use.extensions=1 > $@ -endif -ifeq ($(USETIDY),1) - -$(TIDY) -iq -latin1 -mn $@ -endif - -# RDDL gets its own rule because we never want to call tidy on it -ifeq ($(MAKENONTAB),0) -rddl.html: autolayout.xml -else -$(NONTABPREFIX)rddl.html: autolayout.xml -endif - $(XMLPARSER) $(filter-out $(XMLDEPENDS),$^) -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) $(TEXTOPT) $(STYLEOPT) $(STYLESHEET) $(filter-out $(XMLDEPENDS),$^) > $@ -else - $(XSLT) $(filter-out $(XMLDEPENDS),$^) $(STYLESHEET) $(TEXTOPT) $(STYLEOPT) use.extensions=1 > $@ -endif - -depends.tabular: autolayout.xml -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) $(MAKEDEPENDS) $< > $@ -else - $(XSLT) $< $(MAKEDEPENDS) use.extensions=1 > $@ -endif - -depends.nontabular: autolayout.xml -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) $(TEXTOPT) $(MAKEDEPENDS) $< > $@ -else - $(XSLT) $< $(MAKEDEPENDS) $(TEXTOPT) use.extensions=1 > $@ -endif - -website.database.xml: autolayout.xml -ifeq ($(basename $(XSLT)),xsltproc) - $(XSLT) $(MAKETARGETSDB) $< > $@ -else - $(XSLT) $< $(MAKETARGETSDB) use.extensions=1 > $@ -endif - -depends: autolayout.xml website.database.xml depends.tabular depends.nontabular - -realclean: clean - rm -f autolayout.xml depends.tabular depends.nontabular website.database.xml +# dummy -*- makefile -*- that simply includes the real makefile +# for this directory (this is necessary because the build +# packaging step automatically excludes all files that match the +# "Makefile" or "Makefile.*") +include Makefile-example.txt diff --git a/website/example/Makefile-example.txt b/website/example/Makefile-example.txt new file mode 100644 index 000000000..55f24d82c --- /dev/null +++ b/website/example/Makefile-example.txt @@ -0,0 +1,171 @@ +# Example -*- makefile -*- for building a site using DocBook Website +# +# $Id$ +# +# ------------------------------------------------------------------ +# The default value DOCBOOK_WEBSITE below is the canonical URI for +# the current DocBook Website distribution. If you have SGML or +# XML catalogs correctly set up for DocBook Website in your +# environment, and have the DocBook Website distribution installed +# locally on your system, the URI will automatically be resolved +# to the appropriate local path on your system. +# ------------------------------------------------------------------ +# IMPORTANT! +# ------------------------------------------------------------------ +# IF YOU DO NOT HAVE SGML OR XML CATALOGS SET UP ON YOUR SYSTEM, +# change the value of DOCBOOK_WEBSITE to the appropricate local +# pathname for your system. OR, run "make" like this: +# +# make DOCBOOK_WEBSITE=/foo/bar/website +# +# Note that DOCBOOK_WEBSITE SHOULD NOT BE THE URI FOR YOUR SITE! +# There is nowhere in this makefile where you need to specify that. +# ------------------------------------------------------------------ +# +DOCBOOK_WEBSITE=http://docbook.sourceforge.net/release/website/current +#DOCBOOK_WEBSITE=/usr/share/xml/docbook/custom/website/current + +# generate non-tabular output instead of tabular? 1=Yes 0=No +MAKENONTAB=0 + +# use HTML Tidy to pretty-print HTML? 1=Yes 0=No +USETIDY=0 +# specifies how to call tidy +TIDY=tidy +# specifies options to feed to tidy +TIDYOPTS=-iq -latin1 -mn + +# specifies command for calling your XSLT engine +# (this default uses Saxon) +XSLT=java \ + -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \ + -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \ + -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl \ + com.icl.saxon.StyleSheet \ + -x org.apache.xml.resolver.tools.ResolvingXMLReader \ + -y org.apache.xml.resolver.tools.ResolvingXMLReader \ + -r org.apache.xml.resolver.tools.CatalogResolver \ + +# to use xsltproc as your XSLT engine, either uncomment the next +# line or just run make like this: "make XSLT=xsltproc" +#XSLT=xsltproc + +# XMLPARSER specifies command for calling your preferred XML +# parser for validating the DocBook XML sources for your site +ifeq ($(notdir $(XSLT)),xsltproc) +XMLPARSER=xmllint --valid --noout +else +XMLPARSER=java \ + -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \ + -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \ + org.apache.xml.resolver.apps.xread +endif + +# the following is empty by default; put any custom DocBook +# stylesheet params you want here; they will be applied globally +# to all HTML transformations from your DocBook XML sources +STYLEOPT= + +# name of directory to use if chunking output with "make chunk" +DESTPATH=. + +# what prefix to use on non-tabular versions HTML files? +NONTABPREFIX=n- + +TABSTYLE = $(DOCBOOK_WEBSITE)/xsl/tabular.xsl +WEBSTYLE = $(DOCBOOK_WEBSITE)/xsl/website.xsl +TABCHUNK = $(DOCBOOK_WEBSITE)/xsl/chunk-tabular.xsl +WEBCHUNK = $(DOCBOOK_WEBSITE)/xsl/chunk-website.xsl +AUTOLAYOUT = $(DOCBOOK_WEBSITE)/xsl/autolayout.xsl +MAKEDEPENDS = $(DOCBOOK_WEBSITE)/xsl/makefile-dep.xsl +MAKETARGETSDB = $(DOCBOOK_WEBSITE)/xsl/website-targets.xsl + +XMLDEPENDS = autolayout.xml website.database.xml + +.PHONY : clean + +all: + $(MAKE) website + $(MAKE) MAKENONTAB=1 website + +ifeq ($(MAKENONTAB),0) +STYLESHEET=$(TABSTYLE) +STYLECHUNK=$(TABCHUNK) +NONTAB_OPT= +-include depends.tabular +else +STYLESHEET=$(WEBSTYLE) +STYLECHUNK=$(WEBCHUNK) +ifeq ($(basename $(XSLT)),xsltproc) +NONTAB_OPT= --stringparam filename-prefix $(NONTABPREFIX) +else +NONTAB_OPT= filename-prefix=$(NONTABPREFIX) +endif +-include depends.nontabular +endif + +autolayout.xml: layout.xml + $(XMLPARSER) $(filter-out $(XMLDEPENDS),$^) +ifeq ($(basename $(XSLT)),xsltproc) + $(XSLT) $(AUTOLAYOUT) $< > $@ +else + $(XSLT) $< $(AUTOLAYOUT) use.extensions=1 > $@ +endif + +chunk: autolayout.xml +ifeq ($(basename $(XSLT)),xsltproc) + $(XSLT) --param output-root $(DESTPATH) $(STYLECHUNK) autolayout.xml +else + $(XSLT) autolayout.xml $(STYLECHUNK) use.extensions=1 output-root=$(DESTPATH) +endif + +%.html: autolayout.xml website.database.xml + $(XMLPARSER) $(filter-out $(XMLDEPENDS),$^) +ifeq ($(basename $(XSLT)),xsltproc) + $(XSLT) $(NONTAB_OPT) $(STYLEOPT) $(STYLESHEET) $(filter-out $(XMLDEPENDS),$^) > $@ +else + $(XSLT) $(filter-out $(XMLDEPENDS),$^) $(STYLESHEET) $(NONTAB_OPT) $(STYLEOPT) use.extensions=1 > $@ +endif +ifeq ($(USETIDY),1) + -$(TIDY) -iq -latin1 -mn $@ +endif + +# RDDL gets its own rule because we never want to call tidy on it +ifeq ($(MAKENONTAB),0) +rddl.html: autolayout.xml +else +$(NONTABPREFIX)rddl.html: autolayout.xml +endif + $(XMLPARSER) $(filter-out $(XMLDEPENDS),$^) +ifeq ($(basename $(XSLT)),xsltproc) + $(XSLT) $(NONTAB_OPT) $(STYLEOPT) $(STYLESHEET) $(filter-out $(XMLDEPENDS),$^) > $@ +else + $(XSLT) $(filter-out $(XMLDEPENDS),$^) $(STYLESHEET) $(NONTAB_OPT) $(STYLEOPT) use.extensions=1 > $@ +endif + +depends.tabular depends.nontabular: autolayout.xml +ifeq ($(basename $(XSLT)),xsltproc) + $(XSLT) --stringparam depends-file $@ $(NONTAB_OPT) $(MAKEDEPENDS) $< > $@ +else + $(XSLT) $< $(MAKEDEPENDS) depends-file=$@ $(NONTAB_OPT) use.extensions=1 > $@ +endif + +website.database.xml: autolayout.xml +ifeq ($(basename $(XSLT)),xsltproc) + $(XSLT) $(MAKETARGETSDB) $< > $@ +else + $(XSLT) $< $(MAKETARGETSDB) use.extensions=1 > $@ +endif + +ifeq ($(MAKENONTAB),0) +depends: autolayout.xml website.database.xml depends.tabular +else +depends: autolayout.xml website.database.xml depends.nontabular +endif + +realclean: clean +ifeq ($(MAKENONTAB),0) + rm -f autolayout.xml depends.tabular website.database.xml +else + rm -f autolayout.xml depends.nontabular website.database.xml +endif