# Makefile for literate DocBook XML directories, online at: # http://www.nmt.edu/tcc/doc/docbook43/user-kit/lit-Makefile #================================================================ # Definitions: #---------------------------------------------------------------- # The base file name of the input & output document #-- BASENAME = your-document-base-name-here #-- # Non-executable code modules #-- MODULES = #-- # Executable code modules #-- EXECUTABLES = #-- # Product files #-- SOURCE = $(BASENAME).xml HTML_TARGET = $(BASENAME).html FO_TARGET = $(BASENAME).fo PDF_TARGET = $(BASENAME).pdf CODE_TARGETS = $(MODULES) $(EXECUTABLES) INDEX_FO = toc.fo INDEX_TARGET = toc.pdf #---------------------------------------------------------------- # 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 # To reduce the amount of output: # -quiet #---------------------------------------------------------------- TCC_XSL = /u/www/docs/tcc/doc/docbook43 XSLT_HTML_OPT = XSLT_FO_OPT = XEP_OPT = -quiet #-- # Add the suffixes that we are interested in #-- # .xml Input files in DocBook XML format # .fo XSL-FO output # .html HTML web pages # .pdf Page Description Format (Abode) #-- .SUFFIXES: .xml .html .fo .pdf #================================================================ # Default suffix rules #---------------------------------------------------------------- .xml.html: xsltproc -o $@ $(XSLT_HTML_OPT) $(TCC_XSL)/lit_html.xsl $< .xml.fo: xsltproc -o $@ $(XSLT_FO_OPT) $(TCC_XSL)/lit_fo.xsl $< .fo.pdf: xep $(XEP_OPT) $< $@ #================================================================ # Targets #---------------------------------------------------------------- all: web pdf code index web: $(HTML_TARGET) $(HTML_TARGET): $(SOURCE) pdf: $(PDF_TARGET) $(PDF_TARGET): $(SOURCE) code: $(CODE_TARGETS) #-- # If there are no executables, remove 'chmod +x $(EXECUTABLES)' #-- $(CODE_TARGETS): $(SOURCE) litlxml $<; \ chmod +x $(EXECUTABLES) index: $(INDEX_TARGET) $(SOURCE) $(INDEX_TARGET): $(INDEX_FO) $(INDEX_FO): $(SOURCE) code rm -f $(INDEX_FO); \ docbookindex $(SOURCE) clean: rm -f *.html $(FO_TARGET) $(PDF_TARGET) $(CODE_TARGETS); \ ln -s $(HTML_TARGET) index.html