# Makefile for DocBook XML directories # $Revision: 1.8 $ $Date: 2011/04/14 03:47:22 $ #================================================================ # Definitions: #---------------------------------------------------------------- # BASENAME: The base file name of the input & output document # SOURCE: XML source file # WEB_DIR: Where generated .html lives # WEB_TARGET: Top-level generated HTML page name. # FO_TARGET: Intermediate file for generated PDF. # PDF_TARGET: Generated PDF file name. # INDEX_BASE: Base name for index of section id values. # INDEX_FO: Intermediate file for section index. # INDEX_PDF: Section index PDF file name. # CODE_TARGETS: Files to be extracted by 'litsource'. #---------------------------------------------------------------- BASENAME = tccstyle SOURCE = $(BASENAME).xml WEB_DIR = web/ WEB_TARGET = $(WEB_DIR)index.html FO_TARGET = $(BASENAME).fo PDF_TARGET = $(BASENAME).pdf INDEX_BASE = toc INDEX_FO = $(INDEX_BASE).fo INDEX_PDF = $(INDEX_BASE).pdf #-- # Four files are extracted from the DocBook-XML source file: # tcc_html.xsl: Main HTML stylesheet, invokes html-titlepage.xsl. # html-titlepage.xml: Describes HTML title page, is transformed # by ../mss/template/titlepage.xsl to produce html-titlepage.xsl. # tcc_fo.xsl: Main PDF stylesheet, invokes fo-titlepage.xsl. # fo-titlepage.xml: Describes HTML title page, is transformed # by ../mss/template/titlepage.xsl to produce fo-titlepage.xsl. #-- MAIN_SHEETS = tcc_html.xsl tcc_fo.xsl docbook.css TITLE_XML = html-titlepage.xml fo-titlepage.xml TITLE_SHEETS = ${TITLE_XML:.xml=.xsl} CODE_TARGETS = $(TITLE_SHEETS) $(MAIN_SHEETS) #---------------------------------------------------------------- # TCC_XSL: Where our customization layer lives # XSLT_HTML_OPT passes options to xsltproc to build the HTML form. # To push chunking down to subsections: # --stringparam chunk.section.depth 2 # To move the first subsection to its own chunk: # --stringparam chunk.first.sections 1 # XSLT_FO_OPT: Options for hardcopy. # To push URLs down to footnotes: # --stringparam ulink.footnotes 1 # XEP_OPT: Options to xep #---------------------------------------------------------------- TCC_XSL = /u/www/docs/tcc/doc/docbook43/ TITLE_TRANSFORM = $(TCC_XSL)mss/template/titlepage.xsl HTML_TRANSFORM = $(TCC_XSL)tcc_html.xsl FO_TRANSFORM = $(TCC_XSL)tcc_fo.xsl XSLT_HTML_OPT = --stringparam chunk.section.depth 3 \ --stringparam toc.section.depth 3 XSLT_FO_OPT = --stringparam toc.section.depth 3 XEP_OPT = -quiet #-- # Add the suffixes that we are interested in #-- # .fo XSL-FO output # .html HTML web pages # .pdf Page Description Format (Abode) # .xml Input files in DocBook XML format #-- .SUFFIXES: .fo .html .pdf .xml #================================================================ # Default suffix rules #---------------------------------------------------------------- .xml.html: xsltproc -o $@ $(XSLT_HTML_OPT) $(HTML_TRANSFORM) $< .xml.fo: xsltproc -o $@ $(XSLT_FO_OPT) $(FO_TRANSFORM) $< .fo.pdf: xep $(XEP_OPT) $< $@ #================================================================ # Targets #---------------------------------------------------------------- all: web pdf index code web: $(WEB_TARGET) $(WEB_TARGET): $(SOURCE) xsltproc -o $@ $(XSLT_HTML_OPT) $(HTML_TRANSFORM) $< pdf: $(PDF_TARGET) $(PDF_TARGET): $(SOURCE) index: $(INDEX_PDF) $(INDEX_PDF): $(INDEX_FO) $(INDEX_FO): $(SOURCE) rm -f $(INDEX_FO); \ docbookindex $(SOURCE) code: $(CODE_TARGETS) $(MAIN_SHEETS) $(TITLE_XML): $(SOURCE) litlxml $< $(TITLE_SHEETS): $(TITLE_XML) xsltproc -o $@ $(TITLE_TRANSFORM) $< clean: rm -f *.fo $(PDF_TARGET).pdf $(WEB_DIR)*.html $(CODE_TARGETS)