+# -*- Makefile -*-
include ../cvstools/Makefile.incl
+VPATH=.:tests/
+
+.SUFFIXES: .html .fo .xml .pdf
+
XSLHTML=../xsl/html/docbook.xsl
XSLFO=../xsl/fo/docbook.xsl
XSLCHUNK=../xsl/html/chunk.xsl
CHUNK=0
-STYLEOPT=
+USETIDY=1
+XSLPARAM=
FORMATTER=xep
-RESULT=html
-
-ifeq ($(RESULT),html)
- STYLE=$(XSLHTML)
- USETIDY=1
-else
- STYLE=$(XSLFO)
- USETIDY=0
-endif
-
-all:
- @echo Select a target
-
-mlang.xml : mlang.pl
- perl mlang.pl > $@
-
-no-toc.$(RESULT): toc.xml
- $(XSLT) $< $(STYLE) $@ generate.book.toc=0 process.source.toc=0 process.empty.source.toc=0 $(STYLEOPT)
-ifeq ($(USETIDY),1)
- $(TIDY) -iq -latin1 -mn $@
-endif
-
-auto-toc.$(RESULT): toc.xml
- $(XSLT) $< $(STYLE) $@ generate.book.toc=1 process.source.toc=0 process.empty.source.toc=0 $(STYLEOPT)
-ifeq ($(USETIDY),1)
- $(TIDY) -iq -latin1 -mn $@
-endif
-
-source-toc.$(RESULT): toc.xml
- $(XSLT) $< $(STYLE) $@ generate.book.toc=0 process.source.toc=1 process.empty.source.toc=1 $(STYLEOPT)
-ifeq ($(USETIDY),1)
- $(TIDY) -iq -latin1 -mn $@
-endif
-
-all-toc-dl.$(RESULT): toc.xml
- $(XSLT) $< $(STYLE) $@ generate.book.toc=1 process.source.toc=1 process.empty.source.toc=1 toc.list.type=dl $(STYLEOPT)
-ifeq ($(USETIDY),1)
- $(TIDY) -iq -latin1 -mn $@
-endif
+# ======================================================================
-all-toc-ul.$(RESULT): toc.xml
- $(XSLT) $< $(STYLE) $@ generate.book.toc=1 process.source.toc=1 process.empty.source.toc=1 toc.list.type=ul $(STYLEOPT)
-ifeq ($(USETIDY),1)
- $(TIDY) -iq -latin1 -mn $@
-endif
+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
-test-toc: all-toc-dl.$(RESULT) all-toc-ul.$(RESULT) auto-toc.$(RESULT) no-toc.$(RESULT) source-toc.$(RESULT)
+# ======================================================================
-%.html : %.xml
+.xml.html:
$(XJPARSE) $<
ifeq ($(CHUNK),1)
- $(XSLT) $< $(XSLCHUNK) $@ $(STYLEOPT)
+ $(XSLT) $< $(XSLCHUNK) $@ $(XSLPARAM)
ifeq ($(USETIDY),1)
$(TIDY) -iq -latin1 -mn *.html
endif
else
- $(XSLT) $< $(XSLHTML) $@ $(STYLEOPT)
+ $(XSLT) $< $(XSLHTML) $@ $(XSLPARAM)
ifeq ($(USETIDY),1)
$(TIDY) -iq -latin1 -mn $@
endif
endif
-%.fo : %.xml
+.xml.fo:
ifeq ($(FORMATTER),tex)
- $(XSLT) $< $(XSLFO) $@ passivetex.extensions=1 $(STYLEOPT)
+ $(XSLT) $< $(XSLFO) $@ passivetex.extensions=1 $(XSLPARAM)
else
ifeq ($(FORMATTER),fop)
- $(XSLT) $< $(XSLFO) $@ fop.extensions=1 $(STYLEOPT)
+ $(XSLT) $< $(XSLFO) $@ fop.extensions=1 $(XSLPARAM)
else
ifeq ($(FORMATTER),xep)
- $(XSLT) $< $(XSLFO) $@ xep.extensions=1 $(STYLEOPT)
+ $(XSLT) $< $(XSLFO) $@ xep.extensions=1 $(XSLPARAM)
else
- $(XSLT) $< $(XSLFO) $@ $(STYLEOPT)
+ $(XSLT) $< $(XSLFO) $@ $(XSLPARAM)
endif
endif
endif
-%.pdf : %.fo
+.fo.pdf:
ifeq ($(FORMATTER),tex)
pdftex "&pdfxmltex" $<
@if [ `grep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
ifeq ($(FORMATTER),xep)
xep $<
else
- echo How would you like me to make the PDF file?
+ echo No formatter specified. How would you like me to make the PDF file?
endif
endif
endif
-clean:
- rm -f *.html *.htm *.fo *.pdf *.ps *.rtf
- rm -f *.log *.aux *.out *.tex *.dvi
- rm -f mlang.xml mlang.sgm
- rm -f toc.hhc htmlhelp.hhp htmlhelp.chm Index.hhk
- rm -f HTML.index
- rm -f jhelpidx.xml jhelpmap.jhm jhelpset.hs jhelptoc.xml
+# EOF