# Makefile for http://www.nmt.edu/tcc/help/pubs/python27/ # # $Revision: 1.12 $ $Date: 2011/09/29 00:13:13 $ #================================================================ # BASENAME: Base name of the DocBook .xml file # 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 # To force the table of contents to three levels: # --stringparam toc.section.depth 3 # XSLT_FO_OPT: Options for hardcopy. # XEP_OPT: Options to xep. #---------------------------------------------------------------- BASENAME = python27 SOURCE = $(BASENAME).xml FO_TARGET = $(BASENAME).fo PDF_TARGET = $(BASENAME).pdf #================================================================ # Regardless of the name of the source file, the HTML transform # always builds a file named 'index.html'. In order to move # the web rendering down to a subdirectory web/, the actual # web target is web/index.html, so the default suffix rule won't # work: it would look for source file web/python27.xml. Hence, # we just reproduce the entire build step under the 'web' target. WEB_DIR = web WEB_TARGET = $(WEB_DIR)/index.html TCC_XSL = /u/www/docs/tcc/doc/docbook43 HTML_TRANSFORM = $(TCC_XSL)/lit_html.xsl FO_TRANSFORM = $(TCC_XSL)/lit_fo.xsl XSLT_HTML_OPT = --stringparam chunk.section.depth 3 \ --stringparam chunk.first.sections 1 \ --stringparam toc.section.depth 3 XSLT_FO_OPT = --stringparam toc.section.depth 3 XEP_OPT = -quiet INDEX_FO = toc.fo INDEX_TARGET = toc.pdf #-- # Add the suffixes that we are interested in #-- # .xml Input files in DocBook XML format # .html HTML web pages # .fo XSL-FO output # .pdf Page Description Format (Abode) #-- .SUFFIXES: .xml .html .fo .pdf #================================================================ # 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 web: $(WEB_TARGET) $(WEB_TARGET): $(SOURCE) xsltproc -o $@ $(XSLT_HTML_OPT) $(HTML_TRANSFORM) $< pdf: $(PDF_TARGET) index: $(INDEX_TARGET) $(INDEX_TARGET): $(INDEX_FO) $(INDEX_FO): $(SOURCE) rm -f $(INDEX_FO); \ docbookindex $(SOURCE) clean: rm -f $(WEB_DIR)/*.html $(FO_TARGET) $(PDF_TARGET)