root/juggler/branches/2.0_alpha_4/doc/docbook.mk

Revision 14533, 9.9 kB (checked in by patrickh, 5 years ago)

Updated to version 1.65.1 of DocBook XSL.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 # ************** <auto-copyright.pl BEGIN do not edit this line> **************
2 #
3 # VR Juggler is (C) Copyright 1998-2003 by Iowa State University
4 #
5 # Original Authors:
6 #   Allen Bierbaum, Christopher Just,
7 #   Patrick Hartling, Kevin Meinert,
8 #   Carolina Cruz-Neira, Albert Baker
9 #
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Library General Public
12 # License as published by the Free Software Foundation; either
13 # version 2 of the License, or (at your option) any later version.
14 #
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # Library General Public License for more details.
19 #
20 # You should have received a copy of the GNU Library General Public
21 # License along with this library; if not, write to the
22 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 # Boston, MA 02111-1307, USA.
24 #
25 # -----------------------------------------------------------------
26 # File:          $RCSfile$
27 # Date modified: $Date$
28 # Version:       $Revision$
29 # -----------------------------------------------------------------
30 #
31 # *************** <auto-copyright.pl END do not edit this line> ***************
32
33 # -----------------------------------------------------------------------------
34 # This file provides all the settings and targets needed to generate HTML and
35 # PDF documents from DocBook XML and SGML input.  It requires GNU make 3.78 or
36 # newer.
37 #
38 # This makefile uses many paths that are specific to the computer systems at
39 # the Virtual Reality Applications Center, but it can be customized for local
40 # installations.  Editing the version numbers and base directory paths below
41 # should be sufficient.
42 # -----------------------------------------------------------------------------
43
44 .SUFFIXES: .html .xml .pdf .tex .fo .txt
45
46 # Software and stylesheet versions.
47 DOCBOOK_XSL_VERSION?=   1.65.1
48 XALAN_VERSION?=         2_4_1
49 SAXON_VERSION?=         6.5.2
50
51 # Installation paths.
52 DOCBOOK_ROOT?=  /home/vr/Juggler/docbook
53 SGML_ROOT?=     /usr/share/sgml/docbook
54 TEX_DIR?=       $(DOCBOOK_ROOT)/TeX
55 TEX_BINDIR?=    $(TEX_DIR)/bin/i386-linux
56
57 # Application paths.
58 DVIPDF?=        dvipdf
59 DVIPS?=         dvips
60 FOP?=           sh $(DOCBOOK_ROOT)/fop/fop.sh
61 HTML2TXT?=      /usr/bin/links
62 HTML2TXTOPTS?=  -dump
63 JADE?=          openjade -V tex-backend
64 JADEPROC?=      $(DOCBOOK_ROOT)/jadeproc.pl
65 JADETEX?=       $(TEX_BINDIR)/jadetex
66 PDFJADETEX?=    $(TEX_BINDIR)/pdfjadetex
67 PDFLATEX?=      $(TEX_BINDIR)/pdflatex
68 PDFTEX?=        $(TEX_BINDIR)/pdftex
69 PDFXMLTEX?=     $(TEX_BINDIR)/pdfxmltex
70 RASTERIZER?=    $(DOCBOOK_ROOT)/batik-1.5/svgrasterizer
71 RM=             rm -f
72 SAXON_DIR?=     $(DOCBOOK_ROOT)/saxon-$(SAXON_VERSION)
73 SAXON?=         $(SAXON_DIR)/saxon.sh
74 TEX_ENV?=       PATH=$(TEX_BINDIR):$(PATH) VARTEXMF=$(TEX_DIR)/texmf-var
75 XALAN_DIR?=     $(DOCBOOK_ROOT)/xalan-j_$(XALAN_VERSION)
76 XALAN?=         $(XALAN_DIR)/bin/xalan.sh
77 XEP?=           sh $(DOCBOOK_ROOT)/XEP/run.sh
78 XSLTPROC?=      /usr/bin/xsltproc
79
80 FO_VERSION?=    FOP
81 XSLT_TOOL?=     Xalan
82
83 # Use one of the following depending on what will be processing the generated
84 # FO.  The default is to use FOP.  XEP or Passive TeX can be used instead by
85 # defining $(USE_XEP) or $(USE_PASSIVE_TEX) respectively.
86 ifeq ($(FO_VERSION), FOP)
87    XALAN_FO_PARAMS=     -PARAM fop.extensions "1" -PARAM alignment "start"
88    SAXON_FO_PARAMS=     fop.extensions=1 alignment="start"
89 else
90 ifeq ($(FO_VERSION), XEP)
91    XALAN_FO_PARAMS=     -PARAM xep.extensions "1"
92    SAXON_FO_PARAMS=     xep.extensions=1
93 else
94 ifeq ($(FO_VERSION), PASSIVE_TEX)
95    XALAN_FO_PARAMS=     -PARAM passivetex.extensions "1"                \
96                         -PARAM tex.math.in.alt "latex"
97    SAXON_FO_PARAMS=     passivetex.extensions=1 tex.math.in.alt=latex
98 endif # PASSIVE_TEX
99 endif # XEP
100 endif # FOP
101
102 SAXON_HTML_PARAMS=      html.stylesheet=base_style.css
103 XALAN_HTML_PARAMS=      -PARAM html.stylesheet "base_style.css"
104
105 XALAN_TXT_PARAMS=       -PARAM page.margin.bottom "0in" \
106                         -PARAM page.margin.inner "0in"  \
107                         -PARAM page.margin.outer "0in"  \
108                         -PARAM page.margin.top "0in"    \
109                         -PARAM paper.type "A5"
110
111 DB_SGML_DTD?=   $(DOCBOOK_ROOT)/docbook-sgml-4.1.dtd
112 DSSSL_DIR?=     $(DOCBOOK_ROOT)/docbook-dsssl-1.76
113 XSL_DIR=        $(DOCBOOK_ROOT)/docbook-xsl-$(DOCBOOK_XSL_VERSION)
114
115 HTML_XSL?=              $(XSL_DIR)/html/docbook.xsl
116 CHUNK_HTML_XSL?=        $(XSL_DIR)/html/chunk.xsl
117 FO_XSL?=                $(XSL_DIR)/fo/docbook.xsl
118
119 ENV=            DOCBOOK_XSL=$(XSL_DIR) DOCBOOK_ROOT=$(DOCBOOK_ROOT)     \
120                 SAXON_DIR=$(SAXON_DIR) XALAN_DIR=$(XALAN_DIR)           \
121                 DOCBOOK_XSL_VERSION=$(DOCBOOK_XSL_VERSION)              \
122                 SAXON_VERSION=$(SAXON_VERSION)
123
124 ifdef NEED_DB_IMAGES
125 LINK_DEPS=      images
126 endif
127
128 txt: $(TXT_FILES)
129
130 html: $(LINK_DEPS) $(HTML_FILES)
131
132 chunk-html:
133         for file in $(XML_FILES) ; do \
134             dir=`echo $$file | sed -e 's/\.xml//'` ; \
135             if [ ! -d $$dir ] ; then mkdir $$dir ; fi ; \
136             cur_dir=`pwd` ; \
137             cd $$dir ; \
138             $(ENV) $(SAXON) -i $$cur_dir/$$file -xsl $(CHUNK_HTML_XSL) \
139               $(SAXON_HTML_PARAMS) $(EXTRA_SAXON_HTML_PARAMS) ; \
140             cd $$cur_dir ; \
141             if [ ! -z "$(INSTALL_FILES)" ]; then \
142                 cp $(INSTALL_FILES) $$dir ; \
143             fi ; \
144             if [ ! -z "$(INSTALL_DIRS)" ]; then \
145                 cp -r $(INSTALL_DIRS) $$dir ; \
146             fi ; \
147           done
148
149 pdf: $(LINK_DEPS) $(PDF_FILES)
150
151 # The method for specifying a path to the images that come with the DocBook
152 # XSL stylesheets sucks.  It requires a path relative to the current directory,
153 # and we do not necessarily know how to get to $(XSL_DIR) relative to the
154 # current directory.  This hack with a symlink works around that problem.
155 images:
156         ln -s $(XSL_DIR)/images ./
157
158 install-txt: $(TXT_FILES)
159 ifndef prefix
160         $(error "No prefix set!")
161 else
162         if [ ! -d "$(prefix)" ]; then mkdir -p $(prefix); fi
163         cp $(TXT_FILES) $(prefix)/
164 endif
165
166 install-html: $(LINK_DEPS) $(HTML_FILES)
167 ifndef prefix
168         $(error "No prefix set!")
169 else
170         if [ ! -d "$(prefix)" ]; then mkdir -p $(prefix); fi
171         cp $(HTML_FILES) $(prefix)/
172 ifdef INSTALL_FILES
173         cp $(INSTALL_FILES) $(prefix)/
174 endif
175 ifdef INSTALL_DIRS
176         cp -r $(INSTALL_DIRS) $(prefix)
177 endif
178 ifdef NEED_DB_IMAGES
179         cp -rH images $(prefix)/
180 endif
181 endif
182
183 install-chunk-html:
184 ifndef prefix
185         $(error "No prefix set!")
186 else
187         if [ ! -d "$(prefix)" ]; then mkdir -p $(prefix); fi
188         for file in $(XML_FILES) ; do \
189             dir=`echo $$file | sed -e 's/\.xml//'` ; \
190             cp -r $$dir $(prefix)/ ; \
191             if [ ! -z "$(INSTALL_FILES)" ]; then \
192                 cp $(INSTALL_FILES) $(prefix)/$$dir ; \
193             fi ; \
194             if [ ! -z "$(NEED_DB_IMAGES)" ]; then \
195                 cp -rH images $(prefix)/$$dir ; \
196             fi ; \
197             if [ ! -z "$(INSTALL_DIRS)" ]; then \
198                 cp -r $(INSTALL_DIRS) $(prefix)/$$dir ; \
199             fi ; \
200           done
201 endif
202
203 install-pdf: $(PDF_FILES)
204 ifndef prefix
205         $(error "No prefix set!")
206 else
207         cp $(PDF_FILES) $(prefix)/
208 endif
209
210 install install-all:
211         $(MAKE) install-html
212         $(MAKE) install-chunk-html
213         $(MAKE) install-pdf
214
215 # Image conversions -----------------------------------------------------------
216
217 %.png: %.svg
218         $(RASTERIZER) -bg 255.255.255.255 -m png $<
219
220 %.jpg %.jpeg: %.svg
221         $(RASTERIZER) -q .75 -bg 255.255.255.255 -m jpg $<
222
223 # Basic XSL conversions -------------------------------------------------------
224
225 .xml.html:
226 ifeq ($(XSLT_TOOL), Xalan)
227         $(ENV) $(XALAN) -in $< -xsl $(HTML_XSL) -out $@         \
228           $(XALAN_HTML_PARAMS) $(EXTRA_XALAN_HTML_PARAMS)
229 else
230         $(ENV) $(SAXON) -i $< -xsl $(HTML_XSL) -o $@            \
231           $(SAXON_HTML_PARAMS) $(EXTRA_SAXON_HTML_PARAMS)
232 endif
233
234 .xml.fo:
235 ifeq ($(XSLT_TOOL), Xalan)
236         $(ENV) $(XALAN) -in $< -xsl $(FO_XSL) -out $@           \
237           $(XALAN_FO_PARAMS) $(EXTRA_XALAN_FO_PARAMS)
238 else
239         $(ENV) $(SAXON) -i $< -xsl $(FO_XSL) -o $@              \
240           $(SAXON_FO_PARAMS) $(EXTRA_SAXON_FO_PARAMS)
241 endif
242
243 .html.txt:
244         $(HTML2TXT) $(HTML2TXTOPTS) $(EXTRA_HTML2TXTOPTS) $< > $@
245
246 #.xml.txt:
247 #ifeq ($(XSLT_TOOL), Xalan)
248 #       $(ENV) $(XALAN) -in $< -xsl $(FO_XSL) -out $@           \
249 #          $(XALAN_TXT_PARAMS) $(EXTRA_XALAN_TXT_PARAMS)
250 #else
251 #       $(ENV) $(SAXON) -i $< -xsl $(FO_XSL) -o $@              \
252 #          $(SAXON_TXT_PARAMS) $(EXTRA_SAXON_TXT_PARAMS)
253 #endif
254 #       $(FOP) -fo $< -txt $@
255
256 # Generate a PDF file from an FO file using FOP.
257 ifeq ($(FO_VERSION), FOP)
258 .fo.pdf:
259         $(FOP) $< $@
260
261 .fo.txt:
262         $(FOP) -fo $< -txt $@
263 endif
264
265 # Generate a PDF file from an XML file using FOP.
266 #.xml.pdf:
267 #       $(FOP) -xml $< -xsl $(FO_XSL) -pdf $@
268
269 # -----------------------------------------------------------------------------
270
271 # Jade/JadeTex conversions ----------------------------------------------------
272
273 # Generate a TeX file using Jade.
274 ifdef USE_JADEPROC
275 .xml.pdf:
276         $(TEX_ENV) $(JADEPROC) -i $< -o $@ -d $(DB_SGML_DTD)            \
277           -s $(DSSSL_DIR)/print/docbook.dsl
278          
279 else
280 .xml.tex:
281         $(JADE) -t tex -d $(DSSSL_DIR)/print/docbook.dsl $<
282
283 # $(PDFJADETEX) has to be run twice for page references to be calculated.  :(
284 .tex.pdf:
285         -$(TEX_ENV) $(PDFJADETEX) $<
286 endif
287
288 # -----------------------------------------------------------------------------
289
290 # PassiveTeX conversions ------------------------------------------------------
291
292 # Generate a PDF file from an XML file using PassiveTeX.  This one requires
293 # that a simple TeX file be generated from the XML first (see below).
294 ifeq ($(FO_VERSION), PASSIVE_TEX)
295 .fo.pdf:
296         $(TEX_ENV) $(PDFXMLTEX) $*.fo
297 #       $(TEX_ENV) $(PDFXMLTEX) $*.fo
298
299 # Generate a TeX file for use with PassiveTeX.
300 #.xml.tex:
301 #       @echo "Generating $*.tex from $<"
302 #       @echo '\def\xmlfile{$*.fo}' >$*.tex
303 #       @echo '\input xmltex' >>$*.tex
304 endif
305
306 # -----------------------------------------------------------------------------
307
308 # RenderX XEP conversions -----------------------------------------------------
309
310 # Generate a PDF file using XEP from RenderX.  This requires that an FO file
311 # be generated first.
312 ifeq ($(FO_VERSION), XEP)
313 .fo.pdf:
314         $(XEP) $*.fo
315 endif
316
317 # -----------------------------------------------------------------------------
318
319 clean:
320         $(RM) *.aux *.out *.tex *.log *.fo *~ $(CLEAN_FILES)
321 ifneq ($(CLEAN_DIRS), )
322         $(RM) -r $(CLEAN_DIRS)
323 endif
324
325 clobber:
326         @$(MAKE) clean
327         $(RM) *.html *.pdf $(LINK_DEPS) $(CLOBBER_FILES)
328 ifneq ($(CLOBBER_DIRS), )
329         $(RM) -r $(CLOBBER_DIRS)
330 endif
Note: See TracBrowser for help on using the browser.