d2::align: Change allocation and deallocation of LOD structures so that 0-level certa...
[Ale.git] / doc / Makefile
blobcaca4e60247d4cf4b4673d6219ccf05bef55e971
2 # Makefile modified by David Hilvert to generate ALE documentation.
3 # 24-Sep-2006
6 # $Source$
7 # $Author: xmldoc $
8 # $Date: 2006-09-01 15:47:16 +0900 (Fri, 01 Sep 2006) $
9 # $Revision: 6235 $
10 # vim: number
12 # -----------------------------------------------------------------
13 # ** Makefile.DocBook -- generate output from DocBook sources **
14 # -----------------------------------------------------------------
16 # This file is part of the DocBook Project XSL Stylesheet
17 # distribution.
19 # See http://docbook.sourceforge.net/release/xsl/current/
20 # for copyright and other information.
22 # DOCBOOK_OUTPUT_FORMATS is the default set of targets (output
23 # formats) that get built when you type "make" without any targets
24 # explicitly specified. To generate a different set of output
25 # formats, change the value of DOCBOOK_OUTPUT_FORMATS here or set
26 # it in your environment; for example:
28 # set DOCBOOK_OUTPUT_FORMATS="html pdf"; export DOCBOOK_OUTPUT_FORMATS
30 # Of course by explicitly specifying particular targets when you
31 # invoke "make", you can always override generation of the default
32 # set of targets; for example:
34 # make html txt
36 # That would generate just HTML (unchunked) and plain-text output.
38 DOCBOOK_OUTPUT_FORMATS ?= man chunk txt pdf info
40 # If you want XHTML output instead of HTML, set HTML_OR_XHTML to
41 # 'xhtml' or just specify 'xhtml" in DOCBOOK_OUTPUT_FORMATS.
42 ifeq ($(findstring xhtml,$(DOCBOOK_OUTPUT_FORMATS)),)
43 HTML_OR_XHTML ?= html
44 else
45 HTML_OR_XHTML ?= xhtml
46 endif
48 # -----------------------------------------------------------------
49 # *** TOOLS and other DEPENDENCIES ***
50 # -----------------------------------------------------------------
51 # we use rmdir(1) to remove dirs we create for chunked HTML output
52 RMDIR = rmdir
53 # "-p" causes empty parent dirs to be deleted as well
54 RMDIR_FLAGS = --ignore-fail-on-non-empty -p
56 # possible values for PDF_MAKER are:
57 # dblatex|fop|xep|xmlroff|passivetex
58 PDF_MAKER = fop
60 # possible values for TXT_MAKER are:
61 # links|lynx|w3m|w3mmee
62 TXT_MAKER = links
63 TXT_MAKER_FLAGS = -dump -no-numbering -no-references
65 # xsl
66 XSLT = xsltproc
67 XSLT_FLAGS = --xinclude
69 # http://dblatex.sourceforge.net/
70 DBLATEX = dblatex
71 DBLATEX_FLAGS = -b pdftex -P page.margin.inner=0.8 -P page.margin.outer=0.5 -P double.sided=1 -T db2latex
73 FOP = fop
74 FOP_FLAGS =
76 XEP = xep
77 XEP_FLAGS =
79 # http://xmlroff.sourceforge.net/
80 XMLROFF = xmlroff
81 XMLROFF_FLAGS =
83 PDFTEX = pdftex
84 PDFTEX_FLAGS =
86 # used by PassiveTeX
87 PDFXMLTEX = pdfxmltex
89 # http://docbook2x.sourceforge.net/
90 DB2X_XSLTPROC = db2x_xsltproc
91 DB2X_XSLTPROC_FLAGS = --xinclude
92 DB2X_TEXIXML = db2x_texixml --list-files
93 DB2X_TEXIXML_FLAGS =
95 # we call the man(1) command to generate "foo.N.pdf" and
96 # "foo.N.txt" output (see "man-pdf" & "man-txt" targets)
97 MAN = man
98 MAN_FLAGS =
100 # The "ps2pdf" command is part of GhostSript (gs) distro.
101 # It is just a wrapper script around gs that does this:
103 # gs -dCompatibilityLevel=1.2 -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
104 # "-sOutputFile=$outfile" -dCompatibilityLevel=1.2 -c .setpdfwrite -f "$infile"
106 # Where, for example: $outfile = foo.pdf and $infile = foo.1
107 PS2PDF = ps2pdf
108 PS2PDF_FLAGS =
110 # The "col" command is needed for stripping backspaces and
111 # underscores from man(1) output to get pure plain-text
112 COL = col
113 COL_FLAGS =
115 # The "expand" command is needed for expanding tabs from files
116 # generated from "man foo.1 | col -b" output
117 # output to get pure plain-text
118 EXPAND = expand
119 EXPAND_FLAGS =
121 # value of DOCBOOK_XSL should either be the canonical
122 # (docbook.sourceforge.net) URL for the DocBook Project XSL
123 # stylesheets OR it can be a local system path
124 DOCBOOK_XSL = http://docbook.sourceforge.net/release/xsl/current
126 # -----------------------------------------------------------------
127 # names of some DIRECTORIES and FILES we need
128 # -----------------------------------------------------------------
129 # We create a tmp directory once per make invocation; it's needed
130 # for holding a temporary copy of the custom DBLaTeX stylesheet
131 # (because dblatex currently can't read a stylesheet from stdin)
132 TMP ?= /tmp
133 TMPNUM := $(shell echo $$$$)
134 DOCBOOK_TMP := $(TMP)/docbook-make-$(TMPNUM)
136 # MAN_MANIFEST_EXT is file extension added to individual manifest
137 # files
138 MAN_MANIFEST_EXT = manifest_man
140 # HTML_MANIFEST_EXT is file extension added to HTML manifest files
141 HTML_MANIFEST_EXT = manifest_html
143 # BASEDIR_SUFFIX is a what you need to set if you want a suffix
144 # added to the end of each "base.dir" we create while generating
145 # chunked HTML output
146 #BASEDIR_SUFFIX = -html
147 #BASEDIR_SUFFIX = _html
148 BASEDIR_SUFFIX =
151 # Workaround the fact that we don't calculate dependencies.
154 BROKEN_DEPENDENCIES = package/changelog/index.in $(shell find . -name "*.xml") package/changelog/index.xml make-changelog Makefile
157 # -----------------------------------------------------------------
158 # assorted OPTIONS
159 # -----------------------------------------------------------------
160 # HTML_STYLESHEET -> $html.stylesheet stylesheet param
161 # http://docbook.sourceforge.net/snapshots/xsl/doc/html/html.stylesheet.html
162 HTML_STYLESHEET = style.css
163 # HTML_IMAGES -> $admon.graphics.path
164 # http://docbook.sourceforge.net/snapshots/xsl/doc/html/admon.graphics.path.html
165 HTML_IMAGES = images/
166 # HTML_IMAGES_EXT -> $admon.graphics.extension
167 # http://docbook.sourceforge.net/snapshots/xsl/doc/html/admon.graphics.extension.html
168 HTML_IMAGES_EXT = .png
170 # use these to set params on the command-line
171 # format is, e.g., HTML_PARAMS="--stringparam variablelist.as.table 1..."
172 FO_PARAMS =
173 HTML_PARAMS =
174 MAN_PARAMS =
176 # DBX_PARAMS is for dblatex(1); format uses "-p":
177 # DBX_PARAMS="-p doc.publisher.show 1 -p term.breakline 1...
178 DBX_PARAMS=
180 # What file extension do you use for DocBook source files?
181 DOCBOOK_FILE_EXTENSION = .docbook
182 SOURCE_FILE_EXTENSION = .xml
184 # -----------------------------------------------------------------
185 # make(1) functions for building file lists
186 # -----------------------------------------------------------------
188 # the values of the following are used for determing what needs
189 # to be built and/or cleaned up
191 SOURCE_FILES_DBK = $(wildcard *$(SOURCE_FILE_EXTENSION))
193 FILES_FO = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).fo)
194 FILES_TXT = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).txt)
195 FILES_PDF = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).pdf)
196 FILES_LOG = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).log)
197 FILES_OUT = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).out)
198 FILES_AUX = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).aux)
199 FILES_HTML = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).html)
200 FILES_INFO = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).info)
201 DIRS_CHUNK = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base)$(BASEDIR_SUFFIX))
202 LISTS_HTML = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).$(HTML_MANIFEST_EXT))
203 LISTS_MAN = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).$(MAN_MANIFEST_EXT))
204 FILES_CHNK = $(shell for manifest in $(LISTS_HTML); do if [ -f "$$manifest" ]; then cat $$manifest; fi done)
205 FILES_MAN = $(shell for manifest in $(LISTS_MAN); do if [ -f "$$manifest" ]; then cat $$manifest; fi done)
206 FILES_MANP = $(foreach base,$(FILES_MAN),$(base).pdf)
207 FILES_MANT = $(foreach base,$(FILES_MAN),$(base).txt)
208 DIRS_MAN = $(shell for file in $(FILES_MAN); do dirname $$file; done | uniq)
210 # -----------------------------------------------------------------
211 # ** stylesheet for testing whether a file has a refentry
212 # -----------------------------------------------------------------
213 REFENTRY_CHECK := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
214 version="1.0" \
215 xmlns:db="http://docbook.org/ns/docbook" \
217 <xsl:output method="text"/> \
218 <xsl:template match="/"> \
219 <xsl:if test="//refentry|//db:refentry"> \
220 <xsl:text>true</xsl:text> \
221 </xsl:if> \
222 </xsl:template> \
223 </xsl:stylesheet>
225 # -----------------------------------------------------------------
226 # ** Stylesheet Customization Layers **
227 # -----------------------------------------------------------------
229 # for DBLaTeX
230 DBX_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
231 version="1.0"> \
232 <xsl:param name="co.linkends.show">0</xsl:param> \
233 <xsl:param name="callout.markup.circled">1</xsl:param> \
234 <xsl:param name="callout.linkends.hot">0</xsl:param> \
235 <xsl:param name="doc.publisher.show">1</xsl:param> \
236 <xsl:param name="term.breakline">1</xsl:param> \
237 <xsl:param name="doc.alignment">left</xsl:param> \
238 <xsl:param name="newtbl.use">1</xsl:param> \
239 <xsl:param name="latex.hyperparam"/> \
240 <xsl:param name="latex.style">docbook</xsl:param> \
241 <xsl:param name="latex.biblio.output">all</xsl:param> \
242 <xsl:param name="latex.bibfiles">""</xsl:param> \
243 <xsl:param name="latex.bibwidelabel">WIDELABEL</xsl:param> \
244 <xsl:param name="latex.output.revhistory">0</xsl:param> \
245 <xsl:param name="latex.figure.position">[htbp]</xsl:param> \
246 <xsl:param name="latex.figure.boxed">0</xsl:param> \
247 <xsl:param name="latex.babel.use">1</xsl:param> \
248 <xsl:param name="latex.babel.language"></xsl:param> \
249 <xsl:param name="latex.class.options">twoside</xsl:param> \
250 <xsl:param name="biblioentry.item.separator">, </xsl:param> \
251 <xsl:param name="refentry.xref.manvolnum">1</xsl:param> \
252 <xsl:param name="refsynopsis.title">Synopsis</xsl:param> \
253 <xsl:param name="refnamediv.title"></xsl:param> \
254 <xsl:param name="funcsynopsis.style">ansi</xsl:param> \
255 <xsl:param name="funcsynopsis.decoration">1</xsl:param> \
256 <xsl:param name="function.parens">0</xsl:param> \
257 <xsl:param name="classsynopsis.default.language">java</xsl:param> \
258 <xsl:param name="show.comments">0</xsl:param> \
259 </xsl:stylesheet>
261 # for FO output
264 # NOTE: The following changes may be required to the stock docbook stylesheets
265 # for double-sided output:
267 # In /usr/share/xml/docbook/stylesheet/nwalsh/fo:
269 # o Add '<xsl:attribute name="margin-left">0pc</xsl:attribute>'
270 # to the template 'footer.table'. This fixes number positioning in
271 # double-sided output.
272 # o In the test for generating 'section.head.marker', change
273 # the test '$double-sided != 0' to read '$double-sided > 1'.
274 # This disables section-name headings in favor of chapter-name
275 # headings.
277 # --dhilvert@auricle.dyndns.org, 12-Oct-2006
279 FO_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
280 xmlns:fo="http://www.w3.org/1999/XSL/Format" \
281 version="1.0"> \
282 <xsl:import href="$(DOCBOOK_XSL)/fo/docbook.xsl"/> \
283 <xsl:param name="$(PDF_MAKER).extensions">1</xsl:param> \
284 <xsl:param name="paper.type">Custom</xsl:param> \
285 <xsl:param name="commented.page.height">9.25in</xsl:param> \
286 <xsl:param name="commented.page.width">7.5in</xsl:param> \
287 <xsl:param name="page.height">PAPER_HEIGHT</xsl:param> \
288 <xsl:param name="page.width">PAPER_WIDTH</xsl:param> \
289 <xsl:param name="commented.page.margin.inner">3in</xsl:param> \
290 <xsl:param name="commented.page.margin.outer">3in</xsl:param> \
291 <xsl:param name="chapter.autolabel">1</xsl:param> \
292 <xsl:param name="section.autolabel">1</xsl:param> \
293 <xsl:param name="toc.section.depth">2</xsl:param> \
294 <xsl:param name="commented.toc.max.depth">2</xsl:param> \
295 <xsl:param name="double.sided">DOUBLE_SIDED</xsl:param> \
296 <xsl:param name="draft.watermark.image"></xsl:param> \
297 <xsl:param name="hyphenation">false</xsl:param> \
298 <xsl:param name="hyphenate.verbatim">1</xsl:param> \
299 <xsl:param name="alignment">left</xsl:param> \
300 <xsl:param name="refentry.generate.name">1</xsl:param> \
301 <xsl:param name="refentry.generate.title">0</xsl:param> \
302 <xsl:param name="refentry.pagebreak">1</xsl:param> \
303 <xsl:param name="shade.verbatim">1</xsl:param> \
304 <xsl:param name="variablelist.as.blocks">1</xsl:param> \
305 <xsl:param name="ulink.show">1</xsl:param> \
306 <xsl:param name="ulink.footnotes">1</xsl:param> \
307 <xsl:param name="index.on.type">1</xsl:param> \
308 <xsl:attribute-set name="xref.properties"> \
309 <xsl:attribute name="color">XREF_COLOR</xsl:attribute> \
310 </xsl:attribute-set> \
311 <xsl:template match="section[@tocexclude = 1]" mode="toc" /> \
312 <xsl:template name="commented.page.number.format"> \
313 <xsl:param name="element" select="local-name(.)"/> \
314 <xsl:choose> \
315 <xsl:when test="$element = 'toc'">i</xsl:when> \
316 <xsl:when test="$element = 'preface'">i</xsl:when> \
317 <xsl:when test="$element = 'dedication'">i</xsl:when> \
318 <xsl:when test="$element = 'book'">i</xsl:when> \
319 <xsl:when test="$element = 'set'">i</xsl:when> \
320 <xsl:otherwise>1</xsl:otherwise> \
321 </xsl:choose> \
322 </xsl:template> \
323 <xsl:template match="*" mode="toc.for.set"> \
324 <xsl:call-template name="set.toc"/> \
325 </xsl:template> \
326 <xsl:attribute-set name="shade.verbatim.style"> \
327 <xsl:attribute name="background-color">\#E0E0E0</xsl:attribute> \
328 <xsl:attribute name="padding-left">4pt</xsl:attribute> \
329 <xsl:attribute name="padding-right">4pt</xsl:attribute> \
330 <xsl:attribute name="padding-top">4pt</xsl:attribute> \
331 <xsl:attribute name="padding-bottom">4pt</xsl:attribute> \
332 </xsl:attribute-set> \
333 <xsl:attribute-set name="section.title.level1.properties"> \
334 <xsl:attribute name="font-size"> \
335 <xsl:value-of select="$$body.font.master * 1.5"></xsl:value-of> \
336 <xsl:text>pt</xsl:text> \
337 </xsl:attribute> \
338 </xsl:attribute-set> \
339 <xsl:attribute-set name="section.title.level2.properties"> \
340 <xsl:attribute name="font-size"> \
341 <xsl:value-of select="$$body.font.master * 1.3"></xsl:value-of> \
342 <xsl:text>pt</xsl:text> \
343 </xsl:attribute> \
344 </xsl:attribute-set> \
345 <xsl:attribute-set name="section.title.level3.properties"> \
346 <xsl:attribute name="font-size"> \
347 <xsl:value-of select="$$body.font.master * 1.1"></xsl:value-of> \
348 <xsl:text>pt</xsl:text> \
349 </xsl:attribute> \
350 </xsl:attribute-set> \
351 <xsl:attribute-set name="section.title.level4.properties"> \
352 <xsl:attribute name="font-size"> \
353 <xsl:value-of select="$$body.font.master"></xsl:value-of> \
354 <xsl:text>pt</xsl:text> \
355 </xsl:attribute> \
356 </xsl:attribute-set> \
357 <xsl:attribute-set name="component.title.properties"> \
358 <xsl:attribute name="font-size"> \
359 <xsl:value-of select="$$body.font.master * 1.5"></xsl:value-of> \
360 <xsl:text>pt</xsl:text> \
361 </xsl:attribute> \
362 </xsl:attribute-set> \
363 <xsl:attribute-set name="monospace.verbatim.properties"> \
364 <xsl:attribute name="wrap-option">wrap</xsl:attribute> \
365 <xsl:attribute name="hyphenation-character">\</xsl:attribute> \
366 <xsl:attribute name="font-size"> \
367 <xsl:value-of select="$$body.font.master * 0.8"></xsl:value-of> \
368 <xsl:text>pt</xsl:text> \
369 </xsl:attribute> \
370 </xsl:attribute-set> \
371 </xsl:stylesheet>
373 FO_LETTER_COLOR := $(subst PAPER_WIDTH, 8.5in, \
374 $(subst PAPER_HEIGHT, 11in, \
375 $(subst XREF_COLOR,blue, \
376 $(subst DOUBLE_SIDED, 0, \
377 $(FO_CUSTOM)))))
379 FO_LETTER_MONO := $(subst PAPER_WIDTH, 8.5in, \
380 $(subst PAPER_HEIGHT, 11in, \
381 $(subst XREF_COLOR,black, \
382 $(subst DOUBLE_SIDED, 0, \
383 $(FO_CUSTOM)))))
385 FO_SMALL_COLOR := $(subst PAPER_WIDTH, 7.5in, \
386 $(subst PAPER_HEIGHT, 9.25in, \
387 $(subst XREF_COLOR,blue, \
388 $(subst DOUBLE_SIDED, 1, \
389 $(FO_CUSTOM)))))
391 FO_SMALL_MONO := $(subst PAPER_WIDTH, 7.5in, \
392 $(subst PAPER_HEIGHT, 9.25in, \
393 $(subst XREF_COLOR,black, \
394 $(subst DOUBLE_SIDED, 1, \
395 $(FO_CUSTOM)))))
397 # for single-file (X)HTML outpout
398 HTML_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
399 version="1.0"> \
400 <xsl:import href="$(DOCBOOK_XSL)/$(HTML_OR_XHTML)/docbook.xsl"/> \
401 <xsl:param name="gentext.custom">local.l10n.xml</xsl:param> \
402 <xsl:param name="local.l10n.xml" select="document($$gentext.custom)"/> \
403 <xsl:param name="refentry.generate.name">1</xsl:param> \
404 <xsl:param name="refentry.generate.title">0</xsl:param> \
405 <xsl:param name="root.filename"></xsl:param> \
406 <xsl:param name="variablelist.as.table">0</xsl:param> \
407 <xsl:param name="html.stylesheet">$(HTML_STYLESHEET)</xsl:param> \
408 <xsl:param name="admon.graphics">0</xsl:param> \
409 <xsl:param name="index.on.type">1</xsl:param> \
410 <xsl:param name="chapter.autolabel">1</xsl:param> \
411 <xsl:param name="section.autolabel">1</xsl:param> \
412 <xsl:param name="toc.section.depth">2</xsl:param> \
413 <xsl:param name="commented.toc.max.depth">2</xsl:param> \
414 <xsl:template match="section[@tocexclude = 1]" mode="toc" /> \
415 <xsl:param name="generate.toc"> \
416 appendix toc,title \
417 article/appendix nop \
418 article toc, title \
419 book toc,title,figure,table,example,equation \
420 chapter toc,title \
421 part toc,title \
422 preface toc,title \
423 qandadiv toc \
424 qandaset toc \
425 reference toc,title \
426 sect1 toc \
427 sect2 toc \
428 sect3 toc \
429 sect4 toc \
430 sect5 toc \
431 section toc \
432 set toc,title \
433 </xsl:param> \
434 </xsl:stylesheet>
436 # for chunked (X)HTML output
437 CHNK_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
438 version="1.0"> \
439 <xsl:import href="$(DOCBOOK_XSL)/$(HTML_OR_XHTML)/chunk.xsl"/> \
440 <xsl:param name="refentry.generate.name">0</xsl:param> \
441 <xsl:param name="refentry.generate.title">1</xsl:param> \
442 <xsl:param name="variablelist.as.table">0</xsl:param> \
443 <xsl:param name="html.stylesheet">$(HTML_STYLESHEET)</xsl:param> \
444 <xsl:param name="admon.graphics">1</xsl:param> \
445 <xsl:param name="admon.graphics.path">$(HTML_IMAGES)</xsl:param> \
446 <xsl:param name="admon.graphics.extension">$(HTML_IMAGES_EXT)</xsl:param> \
447 <xsl:param name="root.filename"></xsl:param> \
448 <xsl:param name="generate.manifest">1</xsl:param> \
449 <xsl:param name="use.id.as.filename">1</xsl:param> \
450 <xsl:param name="chunker.output.indent">yes</xsl:param> \
451 <xsl:param name="index.on.type">1</xsl:param> \
452 <xsl:param name="chapter.autolabel">1</xsl:param> \
453 <xsl:param name="section.autolabel">1</xsl:param> \
454 <xsl:param name="toc.section.depth">2</xsl:param> \
455 <xsl:param name="commented.toc.max.depth">2</xsl:param> \
456 <xsl:template match="section[@tocexclude = 1]" mode="toc" /> \
457 <xsl:param name="generate.toc"> \
458 appendix toc,title \
459 article/appendix nop \
460 article toc,title \
461 book toc,title,figure,table,example,equation \
462 chapter toc,title \
463 part toc,title \
464 preface toc,title \
465 qandadiv toc \
466 qandaset toc \
467 reference toc,title \
468 sect1 toc \
469 sect2 toc \
470 sect3 toc \
471 sect4 toc \
472 sect5 toc \
473 section toc \
474 set toc,title \
475 </xsl:param> \
476 </xsl:stylesheet>
478 # for man-page output
479 MAN_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
480 version="1.0"> \
481 <xsl:import href="$(DOCBOOK_XSL)/manpages/docbook.xsl"/> \
482 <xsl:param name="man.output.manifest.enabled" select="1"/> \
483 <xsl:param name="man.output.in.separate.dir" select="1"/> \
484 <xsl:param name="man.output.base.dir">man/</xsl:param> \
485 <xsl:param name="man.output.subdirs.enabled" select="1"/> \
486 </xsl:stylesheet>
489 # ALE documentation targets
492 ALE_SUBDIRS := user technical
493 ALE_TYPES := letter.pdf txt info
494 ALE_PACKAGE := TODO ChangeLog NEWS README REPORTING-BUGS
495 ALE_MANUALS := $(foreach subdir, $(ALE_SUBDIRS), $(subdir)-manual)
496 ALE_MANUAL_TARGETS := $(foreach manual, $(ALE_MANUALS), $(foreach type, $(ALE_TYPES), $(manual).$(type)))
497 ALE_PACKAGE_TARGETS := $(foreach package, $(ALE_PACKAGE), ../$(package))
498 ALE_TARGETS := $(ALE_MANUAL_TARGETS) $(ALE_PACKAGE_TARGETS)
501 # -----------------------------------------------------------------
502 # ** TARGETS START HERE **
503 # -----------------------------------------------------------------
504 # prevents make from deleting, e.g. foo.1, after making foo.1.pdf
505 # and foo.1.txt from it.
506 .PRECIOUS: %.1 %.2 %.3 %.4 %.5 %.6 %.7 %.8 %.9
508 # docbook: index.docbook $(DOCBOOK_OUTPUT_FORMATS) ../TODO ../ChangeLog ../NEWS ../README ../REPORTING-BUGS
509 docbook: $(ALE_TARGETS) index.docbook chunk
510 rm -rf html
511 mv index html
512 mkdir -p info; mv *.info info
513 rm index.docbook
515 %-manual.docbook: %/index.xml
516 $(XSLT) $(XSLT_FLAGS) ale-doc.xsl $< > $@
518 manual-set.docbook: index.xml
519 $(XSLT) $(XSLT_FLAGS) ale-doc.xsl $< > $@
521 ../TODO: package/todo/index.txt
522 mv package/todo/index.txt ../TODO
524 ../ChangeLog: package/changelog/index.txt
525 mv package/changelog/index.txt ../ChangeLog
527 ../NEWS: package/news/index.txt
528 mv package/news/index.txt ../NEWS
530 ../README: package/readme/index.txt
531 mv package/readme/index.txt ../README
533 ../REPORTING-BUGS: package/bugs/index.txt
534 mv package/bugs/index.txt ../REPORTING-BUGS
537 man: $(LISTS_MAN)
539 # we can generate PDFs from man pages
540 man-pdf: man
541 $(MAKE) $(FILES_MANP)
543 # we can generate plain text from man pages
544 man-txt: man
545 $(MAKE) $(FILES_MANT)
547 html: $(FILES_HTML)
549 chunk: $(LISTS_HTML)
551 txt: $(FILES_TXT)
553 pdf: $(FILES_PDF)
555 info: $(FILES_INFO)
557 # use the "debug" target to echo variables, etc., to
558 # test/troubleshoot changes you make to this makefile
559 debug:
560 @echo $(DIRS_MAN)
562 # -----------------------------------------------------------------
563 # preprocess xml to docbook.
564 # -----------------------------------------------------------------
565 %$(DOCBOOK_FILE_EXTENSION): %.xml $(BROKEN_DEPENDENCIES) ale-doc.xsl
566 $(XSLT) $(XSLT_FLAGS) ale-doc.xsl $< > $@
568 package/changelog/index.xml: package/changelog/index.in ./make-changelog
569 ./make-changelog < package/changelog/index.in > package/changelog/index.xml
571 # -----------------------------------------------------------------
572 # pattern rule for making (X)HTML and plain-text output
573 # -----------------------------------------------------------------
574 %.html: %$(DOCBOOK_FILE_EXTENSION) $(BROKEN_DEPENDENCIES)
575 @echo '$(HTML_CUSTOM)' | $(XSLT) $(XSLT_FLAGS) $(HTML_PARAMS) - $< > $@
577 %.txt: %.html
578 $(TXT_MAKER) $(TXT_MAKER_FLAGS) ./$< \
579 | sed "s/^\(\s\+[0-9]\+\. \)file:\/\/.\+$$/\\1(local)/g" \
580 | egrep -v '^ file:///.+$$' \
581 > $@
582 # if DOCBOOK_OUTPUT_FORMATS does not contain "html", then we need
583 # to remove the "intermediate" HTML files we used for generating
584 # plain-text output
585 ifeq ($(findstring html,$(DOCBOOK_OUTPUT_FORMATS)),)
586 $(RM) $<
587 endif
589 # -----------------------------------------------------------------
590 # pattern rule for making chunked (X)HTML pages
591 # -----------------------------------------------------------------
592 %.$(HTML_MANIFEST_EXT): %$(DOCBOOK_FILE_EXTENSION) $(BROKEN_DEPENDENCIES)
593 @echo '$(CHNK_CUSTOM)' | $(XSLT) $(XSLT_FLAGS) $(HTML_PARAMS) \
594 --stringparam manifest $@ \
595 --stringparam base.dir $(basename $@)$(BASEDIR_SUFFIX)/ \
596 - $<
598 # -----------------------------------------------------------------
599 # pattern rules for making FO and PDF stuff
600 # -----------------------------------------------------------------
601 %.letter.fo: %$(DOCBOOK_FILE_EXTENSION) $(BROKEN_DEPENDENCIES)
602 @echo '$(FO_LETTER_COLOR)' \
603 | $(XSLT) $(XSLT_FLAGS) $(FO_PARAMS) - $< > $@
605 %.small.fo: %$(DOCBOOK_FILE_EXTENSION) $(BROKEN_DEPENDENCIES)
606 @echo '$(FO_SMALL_COLOR)' \
607 | $(XSLT) $(XSLT_FLAGS) $(FO_PARAMS) - $< > $@
609 %.letter-mono.fo: %$(DOCBOOK_FILE_EXTENSION) $(BROKEN_DEPENDENCIES)
610 @echo '$(FO_LETTER_MONO)' \
611 | $(XSLT) $(XSLT_FLAGS) $(FO_PARAMS) - $< > $@
613 %.small-mono.fo: %$(DOCBOOK_FILE_EXTENSION) $(BROKEN_DEPENDENCIES)
614 @echo '$(FO_SMALL_MONO)' \
615 | $(XSLT) $(XSLT_FLAGS) $(FO_PARAMS) - $< > $@
617 ifeq ($(PDF_MAKER),dblatex)
618 %.pdf: %$(DOCBOOK_FILE_EXTENSION)
619 mkdir -p $(DOCBOOK_TMP)
620 echo '$(DBX_CUSTOM)' > $(DOCBOOK_TMP)/dblatex.xsl
621 -$(DBLATEX) $(DBLATEX_FLAGS)\
622 -p $(DOCBOOK_TMP)/dblatex.xsl \
623 -o $@ \
625 $(RM) -r $(DOCBOOK_TMP)
626 endif
628 %.pdf: %.fo
629 ifeq ($(PDF_MAKER),)
630 $(error No PDF_MAKER specified. Cannot make pdf)
631 else
632 ifeq ($(PDF_MAKER),xep)
633 $(XEP) $(XEP_FLAGS) $< $@
634 else
635 ifeq ($(PDF_MAKER),fop)
636 $(FOP) $(FOP_FLAGS) $< $@
637 else
638 ifeq ($(PDF_MAKER),xmlroff)
639 $(XMLROFF) $(XMLROFF_FLAGS) $< -o $@
640 else
641 ifeq ($(PDF_MAKER),passivetex)
642 $(PDFTEX) $(PDFTEX_FLAGS) &$(PDFXMLTEX) $<
643 @if [ `egrep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
644 $(PDFTEX) $(PDFTEX_FLAGS) &$(PDFXMLTEX) $< ; \
646 @if [ `egrep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
647 $(PDFTEX) $(PDFTEX_FLAGS) &$(PDFXMLTEX) $< ; \
649 $(RM) $(basename $@).log
650 $(RM) $(basename $@).aux
651 $(RM) $(basename $@).out
652 else
653 $(error I do not know how to make a PDF using "$(PDF_MAKER)")
654 endif
655 endif
656 endif
657 endif
658 endif
660 # -----------------------------------------------------------------
661 # pattern rules for making TeXinfo stuff
662 # -----------------------------------------------------------------
663 %.txml: %$(DOCBOOK_FILE_EXTENSION)
664 $(DB2X_XSLTPROC) $(DB2X_XSLTPROC_FLAGS) -s texi -o $@ $<
666 %.texi-list: %.txml
667 $(DB2X_TEXIXML) $(DB2X_TEXIXML_FLAGS) $< > $@
669 # the following is actually a built-in rule, but it's redefined
670 # here just for the sake of clarity
671 %.info: %.texi-list
672 /usr/bin/perl -w make-infos $(MAKEINFO) < $<
673 -@ # This doesn't work in general.
674 -@ # $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
676 # -----------------------------------------------------------------
677 # pattern rule for making man pages
678 # -----------------------------------------------------------------
679 %.$(MAN_MANIFEST_EXT): %$(DOCBOOK_FILE_EXTENSION)
680 @if [ "$(strip $(shell echo '$(REFENTRY_CHECK)' | $(XSLT) $(XSLT_FLAGS) - $<))" != "true" ]; then \
681 touch $@; \
682 else \
683 echo '$(MAN_CUSTOM)' \
684 | $(XSLT) $(XSLT_FLAGS) $(MAN_PARAMS) \
685 --stringparam man.output.manifest.filename $@ \
686 - $<; \
689 # -----------------------------------------------------------------
690 # pattern rule for enabling direct "make foo.1" to work
691 # -----------------------------------------------------------------
693 %.1 %.2 %.3 %.4 %.5 %.6 %.7: %.xml
694 $(MAKE) $(basename $<).$(MAN_MANIFEST_EXT)
696 # -----------------------------------------------------------------
697 # pattern rules for making Postscript/PDF output from man pages
698 # -----------------------------------------------------------------
699 %.1.ps: %.1
700 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
702 %.2.ps: %.2
703 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
705 %.3.ps: %.3
706 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
708 %.4.ps: %.4
709 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
711 %.5.ps: %.5
712 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
714 %.6.ps: %.6
715 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
717 %.7.ps: %.7
718 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
720 %.8.ps: %.8
721 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
723 %.9.ps: %.9
724 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
726 # -----------------------------------------------------------------
727 # pattern rule for converting Postscript to PDF
728 # -----------------------------------------------------------------
729 %.pdf: %.ps
730 $(PS2PDF) $(PS2PDF_FLAGS) $<
732 # -----------------------------------------------------------------
733 # pattern rules for making plain-text output from man pages
734 # -----------------------------------------------------------------
735 %.1.txt: %.1
736 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
738 %.2.txt: %.2
739 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
741 %.3.txt: %.3
742 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
744 %.4.txt: %.4
745 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
747 %.5.txt: %.5
748 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
750 %.6.txt: %.6
751 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
753 %.7.txt: %.7
754 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
756 %.8.txt: %.8
757 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
759 %.9.txt: %.9
760 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
762 # -----------------------------------------------------------------
763 # target(s) for cleaning up the mess
764 # -----------------------------------------------------------------
765 clean:
766 find . -name "*.info" | xargs rm -f
767 find . -name "*.texi" | xargs rm -f
768 find . -name "*.texi-list" | xargs rm -f
769 find . -name "*.pdf" | xargs rm -f
770 find . -name "*.fo" | xargs rm -f
771 find . -name "*.docbook" | xargs rm -f
772 find . -name "*.txt" | xargs rm -f
773 rm -f package/changelog/index.xml
774 rm -rf index
775 rm -rf html
776 ifneq ($(FILES_TXT),)
777 $(RM) $(FILES_TXT)
778 endif
779 ifneq ($(FILES_PDF),)
780 $(RM) $(FILES_PDF)
781 endif
782 ifneq ($(FILES_FO),)
783 $(RM) $(FILES_FO)
784 endif
785 ifneq ($(FILES_LOG),)
786 $(RM) $(FILES_LOG)
787 endif
788 ifneq ($(FILES_OUT),)
789 $(RM) $(FILES_OUT)
790 endif
791 ifneq ($(FILES_AUX),)
792 $(RM) $(FILES_AUX)
793 endif
794 ifneq ($(FILES_HTML),)
795 $(RM) $(FILES_HTML)
796 endif
797 ifneq ($(FILES_CHNK),)
798 $(RM) $(FILES_CHNK)
799 endif
800 ifneq ($(FILES_MAN),)
801 $(RM) $(FILES_MAN)
802 endif
803 ifneq ($(FILES_MANT),)
804 $(RM) $(FILES_MANT)
805 endif
806 ifneq ($(FILES_MANP),)
807 $(RM) $(FILES_MANP)
808 endif
809 ifneq ($(FILES_INFO),)
810 $(RM) $(FILES_INFO)
811 endif
812 ifneq ($(DIRS_CHUNK),)
813 for dir in $(DIRS_CHUNK); do \
814 if [ -d "$$dir" ]; then \
815 $(RMDIR) $(RMDIR_FLAGS) $$dir; \
816 fi \
817 done
818 endif
819 ifneq ($(DIRS_MAN),)
820 ifneq ($(DIRS_MAN),.)
821 for dir in $(DIRS_MAN); do \
822 if [ -d "$$dir" ]; then \
823 $(RMDIR) $(RMDIR_FLAGS) $$dir; \
824 fi \
825 done
826 endif
827 endif
828 ifneq ($(LISTS_MAN),)
829 $(RM) $(LISTS_MAN)
830 endif
831 ifneq ($(LISTS_HTML),)
832 $(RM) $(LISTS_HTML)
833 endif