From: Adam Di Carlo Date: Sun, 19 Jan 2003 21:34:42 +0000 (+0000) Subject: tester can set the MODE, xsl or dsssl X-Git-Tag: release/1.79.1~6^2~4907 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22d9b9708f69fe3f8863240a4d811aad9e3ea668;p=docbook-dsssl tester can set the MODE, xsl or dsssl DSSSL tests supported for html output start on index tests, DSSSL only (I don't have any expertise in indexes using XSL) default rule is no longer clean; default should run all tests but I haven't done that yet DELETE_ON_ERROR ensures we don't produce bad files use PHONY in some places as appopriate --- diff --git a/testdocs/.cvsignore b/testdocs/.cvsignore index fac1391c8..7150c8d43 100644 --- a/testdocs/.cvsignore +++ b/testdocs/.cvsignore @@ -1,7 +1,12 @@ *.html +WhatsNew +focustom.xsl +htmlcustom.xsl +*.htm +*.index +*.index.xml +*.fo +mlang.fo mlang.sgm mlang.xml -mlang.fo -WhatsNew mtest -focustom.xsl htmlcustom.xsl diff --git a/testdocs/Makefile b/testdocs/Makefile index 94f38ae51..bd852134e 100644 --- a/testdocs/Makefile +++ b/testdocs/Makefile @@ -3,54 +3,93 @@ include ../cvstools/Makefile.incl VPATH=.:tests/ -.SUFFIXES: .html .fo .xml .pdf +.SUFFIXES: .html .fo .xml .pdf .index +# testing mode, either dsssl or xsl +MODE=xsl + +# stylesheets to use XSLHTML=../xsl/html/docbook.xsl XSLFO=../xsl/fo/docbook.xsl XSLCHUNK=../xsl/html/chunk.xsl +DSSSLHTML=../dsssl/html/docbook.dsl +DSSSLPRINT=../dsssl/print/docbook.dsl +# whether to do chunking CHUNK=0 -USETIDY=1 -XSLPARAM= -VALIDATE=1 +# whether to run tidy on resulting HTML output +USETIDY=0 +# whether to run validation before running the test +VALIDATE=0 -FORMATTER=xep +# how to make DSSSL indexes +DSSSLINDEXER ?= perl $(DSSSLROOT)/bin/collateindex.pl -# ====================================================================== +# additional XSL parameters, if any +XSLPARAM= + +# can be xep, fop, or tex +# fixme: should be in Makefile.incl ? +FO_FORMATTER=xep -clean: - rm -f *.html *.htm *.fo *.pdf *.ps *.rtf - rm -f *.log *.aux *.out *.tex *.dvi - rm -f toc.hhc htmlhelp.hhp htmlhelp.chm Index.hhk - rm -f HTML.index - rm -f jhelpidx.xml jhelpmap.jhm jhelpset.hs jhelptoc.xml # ====================================================================== +# default rule, run all tests +.PHONY: test +test: + .xml.html: ifeq ($(VALIDATE),1) $(XJPARSE) $< endif +ifeq ($(MODE),xsl) ifeq ($(CHUNK),1) $(XSLT) $< $(XSLCHUNK) $@ $(XSLPARAM) -ifeq ($(USETIDY),1) - $(TIDY) -iq -n -ascii -mn *.html -endif else $(XSLT) $< $(XSLHTML) $@ $(XSLPARAM) +endif # chunk +else # mode is DSSSL +ifeq ($(CHUNK),1) + $(JADE) sgml $(DSSSLHTML) $< -V%html-ext%=.html +else + $(JADE) sgml $(DSSSLHTML) $< -V%html-ext%=.html -Vnochunks > $@ +endif +endif ifeq ($(USETIDY),1) +ifeq ($(CHUNK),1) + $(TIDY) -iq -n -ascii -mn *.html +else $(TIDY) -iq -n -ascii -mn $@ endif endif +.xml.index: +ifeq ($(MODE),xsl) + @echo "don't know how to create XSL indexes" + exit 1 +else + @test -f $*.index.xml || ( echo $(DSSSLINDEXER) -N -o $*.index.xml ; $(DSSSLINDEXER) -N -o $*.index.xml ) + $(JADE) sgml $(DSSSLHTML) $< -Vhtml-index -Vhtml-index-filename=$*.index.xml + @test ! -f HTML.index || test HTML.index -ot $@ || ( echo mv HTML.index $@ ; mv HTML.index $@ ) +endif + +%.index.xml: %.index + $(DSSSLINDEXER) -o $@ $< + + .xml.fo: ifeq ($(VALIDATE),1) $(XJPARSE) $< endif - $(XSLT) $< $(XSLFO) $@ $(FORMATTER).extensions=1 $(XSLPARAM) +ifeq ($(MODE),xsl) + $(XSLT) $< $(XSLFO) $@ $(FO_FORMATTER).extensions=1 $(XSLPARAM) +else + $(JADE) fo $(DSSSLPRINT) $< -o $@ +endif .fo.pdf: -ifeq ($(FORMATTER),tex) +ifeq ($(FO_FORMATTER),tex) pdftex "&pdfxmltex" $< @if [ `grep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \ pdftex "&pdfxmltex" $< ; \ @@ -59,10 +98,10 @@ ifeq ($(FORMATTER),tex) pdftex "&pdfxmltex" $< ; \ fi else -ifeq ($(FORMATTER),fop) +ifeq ($(FO_FORMATTER),fop) fop $< $@ else -ifeq ($(FORMATTER),xep) +ifeq ($(FO_FORMATTER),xep) xep $< else echo No formatter specified. How would you like me to make the PDF file? @@ -70,6 +109,17 @@ endif endif endif +# ====================================================================== + +.PHONY: clean +clean: + rm -f *.html *.htm *.fo *.pdf *.ps *.rtf + rm -f *.log *.aux *.out *.tex *.dvi *.index *.index.xml + rm -f toc.hhc htmlhelp.hhp htmlhelp.chm Index.hhk + rm -f HTML.index + rm -f jhelpidx.xml jhelpmap.jhm jhelpset.hs jhelptoc.xml + +.PHONY: distrib distrib: $(CVS2LOG) -w ifeq ($(DIFFVER),) @@ -78,6 +128,7 @@ else $(MERGELOGS) -v $(DIFFVER) > WhatsNew endif +.PHONY: newversion newversion: ifeq ($(NEXTVER),) $(NEXTVERSION) @@ -86,6 +137,7 @@ else endif make DIFFVER=$(DIFFVER) distrib +.PHONY: zip zip: ifeq ($(ZIPVER),) @echo You must specify ZIPVER for the zip target @@ -111,4 +163,7 @@ else rm -f tar.exclude endif +# remove target if error in the rule +.DELETE_ON_ERROR: + # EOF