hgbook

diff en/Makefile @ 558:8631da51309b

Slow progress on XML conversion
author Bryan O'Sullivan <bos@serpentine.com>
date Mon Feb 09 23:25:40 2009 -0800 (2009-02-09)
parents 5cd47f721686
children b90b024729f1
line diff
     1.1 --- a/en/Makefile	Thu Jan 29 22:56:27 2009 -0800
     1.2 +++ b/en/Makefile	Mon Feb 09 23:25:40 2009 -0800
     1.3 @@ -31,6 +31,12 @@
     1.4  	wdir-merge.svg \
     1.5  	wdir-pre-branch.svg
     1.6  
     1.7 +xml-src-files := \
     1.8 +	00book.xml \
     1.9 +	ch01-intro.xml \
    1.10 +	ch02-tour-basic.xml \
    1.11 +	ch12-mq.xml
    1.12 +
    1.13  image-dot := $(filter %.dot,$(image-sources))
    1.14  image-svg := $(filter %.svg,$(image-sources))
    1.15  image-png := $(filter %.png,$(image-sources))
    1.16 @@ -70,6 +76,33 @@
    1.17  	tour \
    1.18  	tour-merge-conflict
    1.19  
    1.20 +xsltproc := xsltproc
    1.21 +xsltproc-opts := --nonet --xinclude --path '$(xml-path)'
    1.22 +
    1.23 +xmllint := xmllint
    1.24 +xmllint-opts := --noout --nonet --valid
    1.25 +
    1.26 +system-xsl-dir := $(firstword $(wildcard \
    1.27 +	/usr/share/sgml/docbook/xsl-stylesheets \
    1.28 +	/usr/share/xml/docbook/stylesheet/nwalsh \
    1.29 +	))
    1.30 +
    1.31 +# Bletcherousness.
    1.32 +
    1.33 +ifneq ($(wildcard /usr/share/sgml/docbook/xml-dtd-4.4-*),)
    1.34 +dtd-dir := $(wildcard /usr/share/sgml/docbook/xml-dtd-4.4-*)
    1.35 +else
    1.36 +ifneq ($(wildcard /usr/share/xml/docbook/schema/dtd/4.4),)
    1.37 +dtd-dir := $(wildcard /usr/share/xml/docbook/schema/dtd/4.4)
    1.38 +else
    1.39 +$(error Do not know where to look for DocBook XML 4.4 DTD)
    1.40 +endif
    1.41 +endif
    1.42 +
    1.43 +ifeq ($(system-xsl-dir),)
    1.44 +$(error add a suitable directory to system-xsl-dir)
    1.45 +endif
    1.46 +
    1.47  example-prereqs := \
    1.48  	/usr/bin/merge
    1.49  
    1.50 @@ -110,6 +143,18 @@
    1.51  
    1.52  html: onepage split
    1.53  
    1.54 +../xsl/system-xsl: $(system-xsl-dir)
    1.55 +	ln -s $< $@
    1.56 +
    1.57 +dbhtml: ../xsl/system-xsl $(xml-src-files) valid
    1.58 +	xsltproc $(xsltproc-opts) ../xsl/chunk-stylesheet.xsl 00book.xml
    1.59 +
    1.60 +valid: .validated-00book.xml
    1.61 +
    1.62 +.validated-00book.xml: $(xml-src-files)
    1.63 +	$(xmllint) --path '$(dtd-dir):$(xml-path)' $(xmllint-opts) $<
    1.64 +	touch $@
    1.65 +
    1.66  onepage: $(htlatex) html/onepage/hgbook.html html/onepage/hgbook.css $(image-html:%=html/onepage/%)
    1.67  
    1.68  html/onepage/%: %