doc/package/todo/index.xml: Migrate information from the plain-text TODO file.
[Ale.git] / doc / Makefile
blobd08ec67323f85a731e095ddcaad687bb0aac3511
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 = $(shell find . -name "*.xml")
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
183 # -----------------------------------------------------------------
184 # make(1) functions for building file lists
185 # -----------------------------------------------------------------
187 # the values of the following are used for determing what needs
188 # to be built and/or cleaned up
190 SOURCE_FILES_DBK = $(wildcard *$(DOCBOOK_FILE_EXTENSION))
192 FILES_FO = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).fo)
193 FILES_TXT = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).txt)
194 FILES_PDF = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).pdf)
195 FILES_LOG = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).log)
196 FILES_OUT = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).out)
197 FILES_AUX = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).aux)
198 FILES_HTML = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).html)
199 FILES_INFO = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).info)
200 DIRS_CHUNK = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base)$(BASEDIR_SUFFIX))
201 LISTS_HTML = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).$(HTML_MANIFEST_EXT))
202 LISTS_MAN = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).$(MAN_MANIFEST_EXT))
203 FILES_CHNK = $(shell for manifest in $(LISTS_HTML); do if [ -f "$$manifest" ]; then cat $$manifest; fi done)
204 FILES_MAN = $(shell for manifest in $(LISTS_MAN); do if [ -f "$$manifest" ]; then cat $$manifest; fi done)
205 FILES_MANP = $(foreach base,$(FILES_MAN),$(base).pdf)
206 FILES_MANT = $(foreach base,$(FILES_MAN),$(base).txt)
207 DIRS_MAN = $(shell for file in $(FILES_MAN); do dirname $$file; done | uniq)
209 # -----------------------------------------------------------------
210 # ** stylesheet for testing whether a file has a refentry
211 # -----------------------------------------------------------------
212 REFENTRY_CHECK := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
213 version="1.0" \
214 xmlns:db="http://docbook.org/ns/docbook" \
216 <xsl:output method="text"/> \
217 <xsl:template match="/"> \
218 <xsl:if test="//refentry|//db:refentry"> \
219 <xsl:text>true</xsl:text> \
220 </xsl:if> \
221 </xsl:template> \
222 </xsl:stylesheet>
224 # -----------------------------------------------------------------
225 # ** Stylesheet Customization Layers **
226 # -----------------------------------------------------------------
228 # for DBLaTeX
229 DBX_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
230 version="1.0"> \
231 <xsl:param name="co.linkends.show">0</xsl:param> \
232 <xsl:param name="callout.markup.circled">1</xsl:param> \
233 <xsl:param name="callout.linkends.hot">0</xsl:param> \
234 <xsl:param name="doc.publisher.show">1</xsl:param> \
235 <xsl:param name="term.breakline">1</xsl:param> \
236 <xsl:param name="doc.alignment">left</xsl:param> \
237 <xsl:param name="newtbl.use">1</xsl:param> \
238 <xsl:param name="latex.hyperparam"/> \
239 <xsl:param name="latex.style">docbook</xsl:param> \
240 <xsl:param name="latex.biblio.output">all</xsl:param> \
241 <xsl:param name="latex.bibfiles">""</xsl:param> \
242 <xsl:param name="latex.bibwidelabel">WIDELABEL</xsl:param> \
243 <xsl:param name="latex.output.revhistory">0</xsl:param> \
244 <xsl:param name="latex.figure.position">[htbp]</xsl:param> \
245 <xsl:param name="latex.figure.boxed">0</xsl:param> \
246 <xsl:param name="latex.babel.use">1</xsl:param> \
247 <xsl:param name="latex.babel.language"></xsl:param> \
248 <xsl:param name="latex.class.options">twoside</xsl:param> \
249 <xsl:param name="biblioentry.item.separator">, </xsl:param> \
250 <xsl:param name="refentry.xref.manvolnum">1</xsl:param> \
251 <xsl:param name="refsynopsis.title">Synopsis</xsl:param> \
252 <xsl:param name="refnamediv.title"></xsl:param> \
253 <xsl:param name="funcsynopsis.style">ansi</xsl:param> \
254 <xsl:param name="funcsynopsis.decoration">1</xsl:param> \
255 <xsl:param name="function.parens">0</xsl:param> \
256 <xsl:param name="classsynopsis.default.language">java</xsl:param> \
257 <xsl:param name="show.comments">0</xsl:param> \
258 </xsl:stylesheet>
260 # for FO output
261 FO_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
262 xmlns:fo="http://www.w3.org/1999/XSL/Format" \
263 version="1.0"> \
264 <xsl:import href="$(DOCBOOK_XSL)/fo/docbook.xsl"/> \
265 <xsl:param name="$(PDF_MAKER).extensions">1</xsl:param> \
266 <xsl:param name="paper.type">Custom</xsl:param> \
267 <xsl:param name="page.height">9.25in</xsl:param> \
268 <xsl:param name="page.width">7.5in</xsl:param> \
269 <xsl:param name="commented.page.margin.inner">3in</xsl:param> \
270 <xsl:param name="commented.page.margin.outer">3in</xsl:param> \
271 <xsl:param name="double.sided">1</xsl:param> \
272 <xsl:param name="draft.watermark.image"></xsl:param> \
273 <xsl:param name="hyphenation">false</xsl:param> \
274 <xsl:param name="hyphenate.verbatim">1</xsl:param> \
275 <xsl:param name="alignment">left</xsl:param> \
276 <xsl:param name="refentry.generate.name">1</xsl:param> \
277 <xsl:param name="refentry.generate.title">0</xsl:param> \
278 <xsl:param name="refentry.pagebreak">1</xsl:param> \
279 <xsl:param name="shade.verbatim">1</xsl:param> \
280 <xsl:param name="variablelist.as.blocks">1</xsl:param> \
281 <xsl:param name="ulink.show">1</xsl:param> \
282 <xsl:param name="ulink.footnotes">1</xsl:param> \
283 <xsl:param name="index.on.type">1</xsl:param> \
284 <xsl:attribute-set name="xref.properties"> \
285 <xsl:attribute name="color">blue</xsl:attribute> \
286 </xsl:attribute-set> \
287 <xsl:attribute-set name="shade.verbatim.style"> \
288 <xsl:attribute name="background-color">\#E0E0E0</xsl:attribute> \
289 <xsl:attribute name="padding-left">4pt</xsl:attribute> \
290 <xsl:attribute name="padding-right">4pt</xsl:attribute> \
291 <xsl:attribute name="padding-top">4pt</xsl:attribute> \
292 <xsl:attribute name="padding-bottom">4pt</xsl:attribute> \
293 </xsl:attribute-set> \
294 <xsl:attribute-set name="section.title.level1.properties"> \
295 <xsl:attribute name="font-size"> \
296 <xsl:value-of select="$$body.font.master * 1.5"></xsl:value-of> \
297 <xsl:text>pt</xsl:text> \
298 </xsl:attribute> \
299 </xsl:attribute-set> \
300 <xsl:attribute-set name="section.title.level2.properties"> \
301 <xsl:attribute name="font-size"> \
302 <xsl:value-of select="$$body.font.master * 1.3"></xsl:value-of> \
303 <xsl:text>pt</xsl:text> \
304 </xsl:attribute> \
305 </xsl:attribute-set> \
306 <xsl:attribute-set name="section.title.level3.properties"> \
307 <xsl:attribute name="font-size"> \
308 <xsl:value-of select="$$body.font.master * 1.1"></xsl:value-of> \
309 <xsl:text>pt</xsl:text> \
310 </xsl:attribute> \
311 </xsl:attribute-set> \
312 <xsl:attribute-set name="section.title.level4.properties"> \
313 <xsl:attribute name="font-size"> \
314 <xsl:value-of select="$$body.font.master"></xsl:value-of> \
315 <xsl:text>pt</xsl:text> \
316 </xsl:attribute> \
317 </xsl:attribute-set> \
318 <xsl:attribute-set name="component.title.properties"> \
319 <xsl:attribute name="font-size"> \
320 <xsl:value-of select="$$body.font.master * 1.5"></xsl:value-of> \
321 <xsl:text>pt</xsl:text> \
322 </xsl:attribute> \
323 </xsl:attribute-set> \
324 <xsl:attribute-set name="monospace.verbatim.properties"> \
325 <xsl:attribute name="wrap-option">wrap</xsl:attribute> \
326 <xsl:attribute name="hyphenation-character">\</xsl:attribute> \
327 <xsl:attribute name="font-size"> \
328 <xsl:value-of select="$$body.font.master * 0.8"></xsl:value-of> \
329 <xsl:text>pt</xsl:text> \
330 </xsl:attribute> \
331 </xsl:attribute-set> \
332 </xsl:stylesheet>
334 # for single-file (X)HTML outpout
335 HTML_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
336 version="1.0"> \
337 <xsl:import href="$(DOCBOOK_XSL)/$(HTML_OR_XHTML)/docbook.xsl"/> \
338 <xsl:param name="gentext.custom">local.l10n.xml</xsl:param> \
339 <xsl:param name="local.l10n.xml" select="document($$gentext.custom)"/> \
340 <xsl:param name="refentry.generate.name">1</xsl:param> \
341 <xsl:param name="refentry.generate.title">0</xsl:param> \
342 <xsl:param name="root.filename"></xsl:param> \
343 <xsl:param name="variablelist.as.table">0</xsl:param> \
344 <xsl:param name="html.stylesheet">$(HTML_STYLESHEET)</xsl:param> \
345 <xsl:param name="admon.graphics">0</xsl:param> \
346 <xsl:param name="index.on.type">1</xsl:param> \
347 </xsl:stylesheet>
349 # for chunked (X)HTML output
350 CHNK_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
351 version="1.0"> \
352 <xsl:import href="$(DOCBOOK_XSL)/$(HTML_OR_XHTML)/chunk.xsl"/> \
353 <xsl:param name="refentry.generate.name">0</xsl:param> \
354 <xsl:param name="refentry.generate.title">1</xsl:param> \
355 <xsl:param name="variablelist.as.table">0</xsl:param> \
356 <xsl:param name="html.stylesheet">$(HTML_STYLESHEET)</xsl:param> \
357 <xsl:param name="admon.graphics">1</xsl:param> \
358 <xsl:param name="admon.graphics.path">$(HTML_IMAGES)</xsl:param> \
359 <xsl:param name="admon.graphics.extension">$(HTML_IMAGES_EXT)</xsl:param> \
360 <xsl:param name="root.filename"></xsl:param> \
361 <xsl:param name="generate.manifest">1</xsl:param> \
362 <xsl:param name="use.id.as.filename">1</xsl:param> \
363 <xsl:param name="chunker.output.indent">yes</xsl:param> \
364 <xsl:param name="index.on.type">1</xsl:param> \
365 </xsl:stylesheet>
367 # for man-page output
368 MAN_CUSTOM := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
369 version="1.0"> \
370 <xsl:import href="$(DOCBOOK_XSL)/manpages/docbook.xsl"/> \
371 <xsl:param name="man.output.manifest.enabled" select="1"/> \
372 <xsl:param name="man.output.in.separate.dir" select="1"/> \
373 <xsl:param name="man.output.base.dir">man/</xsl:param> \
374 <xsl:param name="man.output.subdirs.enabled" select="1"/> \
375 </xsl:stylesheet>
377 # -----------------------------------------------------------------
378 # ** TARGETS START HERE **
379 # -----------------------------------------------------------------
380 # prevents make from deleting, e.g. foo.1, after making foo.1.pdf
381 # and foo.1.txt from it.
382 .PRECIOUS: %.1 %.2 %.3 %.4 %.5 %.6 %.7 %.8 %.9
384 docbook: index.docbook $(DOCBOOK_OUTPUT_FORMATS)
386 man: $(LISTS_MAN)
388 # we can generate PDFs from man pages
389 man-pdf: man
390 $(MAKE) $(FILES_MANP)
392 # we can generate plain text from man pages
393 man-txt: man
394 $(MAKE) $(FILES_MANT)
396 html: $(FILES_HTML)
398 chunk: $(LISTS_HTML)
400 txt: $(FILES_TXT)
402 pdf: $(FILES_PDF)
404 info: $(FILES_INFO)
406 # use the "debug" target to echo variables, etc., to
407 # test/troubleshoot changes you make to this makefile
408 debug:
409 @echo $(DIRS_MAN)
411 # -----------------------------------------------------------------
412 # preprocess xml to docbook.
413 # -----------------------------------------------------------------
414 %$(DOCBOOK_FILE_EXTENSION): %.xml ale-doc.xsl $(BROKEN_DEPENDENCIES)
415 $(XSLT) $(XSLT_FLAGS) ale-doc.xsl $< > $@
417 # -----------------------------------------------------------------
418 # pattern rule for making (X)HTML and plain-text output
419 # -----------------------------------------------------------------
420 %.html: %$(DOCBOOK_FILE_EXTENSION)
421 @echo '$(HTML_CUSTOM)' | $(XSLT) $(XSLT_FLAGS) $(HTML_PARAMS) - $< > $@
423 %.txt: %.html
424 $(TXT_MAKER) $(TXT_MAKER_FLAGS) ./$< \
425 | sed "s/^\(\s\+[0-9]\+\. \)file:\/\/.\+$$/\\1(local)/g" \
426 | egrep -v '^ file:///.+$$' \
427 > $@
428 # if DOCBOOK_OUTPUT_FORMATS does not contain "html", then we need
429 # to remove the "intermediate" HTML files we used for generating
430 # plain-text output
431 ifeq ($(findstring html,$(DOCBOOK_OUTPUT_FORMATS)),)
432 $(RM) $<
433 endif
435 # -----------------------------------------------------------------
436 # pattern rule for making chunked (X)HTML pages
437 # -----------------------------------------------------------------
438 %.$(HTML_MANIFEST_EXT): %$(DOCBOOK_FILE_EXTENSION)
439 @echo '$(CHNK_CUSTOM)' | $(XSLT) $(XSLT_FLAGS) $(HTML_PARAMS) \
440 --stringparam manifest $@ \
441 --stringparam base.dir $(basename $@)$(BASEDIR_SUFFIX)/ \
442 - $<
444 # -----------------------------------------------------------------
445 # pattern rules for making FO and PDF stuff
446 # -----------------------------------------------------------------
447 %.fo: %$(DOCBOOK_FILE_EXTENSION)
448 @echo '$(FO_CUSTOM)' \
449 | $(XSLT) $(XSLT_FLAGS) $(FO_PARAMS) - $< > $@
451 ifeq ($(PDF_MAKER),dblatex)
452 %.pdf: %$(DOCBOOK_FILE_EXTENSION)
453 mkdir -p $(DOCBOOK_TMP)
454 echo '$(DBX_CUSTOM)' > $(DOCBOOK_TMP)/dblatex.xsl
455 -$(DBLATEX) $(DBLATEX_FLAGS)\
456 -p $(DOCBOOK_TMP)/dblatex.xsl \
457 -o $@ \
459 $(RM) -r $(DOCBOOK_TMP)
460 endif
462 %.pdf: %.fo
463 ifeq ($(PDF_MAKER),)
464 $(error No PDF_MAKER specified. Cannot make pdf)
465 else
466 ifeq ($(PDF_MAKER),xep)
467 $(XEP) $(XEP_FLAGS) $< $@
468 else
469 ifeq ($(PDF_MAKER),fop)
470 $(FOP) $(FOP_FLAGS) $< $@
471 else
472 ifeq ($(PDF_MAKER),xmlroff)
473 $(XMLROFF) $(XMLROFF_FLAGS) $< -o $@
474 else
475 ifeq ($(PDF_MAKER),passivetex)
476 $(PDFTEX) $(PDFTEX_FLAGS) &$(PDFXMLTEX) $<
477 @if [ `egrep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
478 $(PDFTEX) $(PDFTEX_FLAGS) &$(PDFXMLTEX) $< ; \
480 @if [ `egrep Rerun $(basename $@).log | wc -l` -gt 0 ]; then \
481 $(PDFTEX) $(PDFTEX_FLAGS) &$(PDFXMLTEX) $< ; \
483 $(RM) $(basename $@).log
484 $(RM) $(basename $@).aux
485 $(RM) $(basename $@).out
486 else
487 $(error I do not know how to make a PDF using "$(PDF_MAKER)")
488 endif
489 endif
490 endif
491 endif
492 endif
494 # -----------------------------------------------------------------
495 # pattern rules for making TeXinfo stuff
496 # -----------------------------------------------------------------
497 %.txml: %$(DOCBOOK_FILE_EXTENSION)
498 $(DB2X_XSLTPROC) $(DB2X_XSLTPROC_FLAGS) -s texi -o $@ $<
500 %.texi-list: %.txml
501 $(DB2X_TEXIXML) $(DB2X_TEXIXML_FLAGS) $< > $@
503 # the following is actually a built-in rule, but it's redefined
504 # here just for the sake of clarity
505 %.info: %.texi-list
506 ./make-infos $(MAKEINFO) < $<
507 -@ # This doesn't work in general.
508 -@ # $(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@
510 # -----------------------------------------------------------------
511 # pattern rule for making man pages
512 # -----------------------------------------------------------------
513 %.$(MAN_MANIFEST_EXT): %$(DOCBOOK_FILE_EXTENSION)
514 @if [ "$(strip $(shell echo '$(REFENTRY_CHECK)' | $(XSLT) $(XSLT_FLAGS) - $<))" != "true" ]; then \
515 touch $@; \
516 else \
517 echo '$(MAN_CUSTOM)' \
518 | $(XSLT) $(XSLT_FLAGS) $(MAN_PARAMS) \
519 --stringparam man.output.manifest.filename $@ \
520 - $<; \
523 # -----------------------------------------------------------------
524 # pattern rule for enabling direct "make foo.1" to work
525 # -----------------------------------------------------------------
527 %.1 %.2 %.3 %.4 %.5 %.6 %.7: %.xml
528 $(MAKE) $(basename $<).$(MAN_MANIFEST_EXT)
530 # -----------------------------------------------------------------
531 # pattern rules for making Postscript/PDF output from man pages
532 # -----------------------------------------------------------------
533 %.1.ps: %.1
534 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
536 %.2.ps: %.2
537 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
539 %.3.ps: %.3
540 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
542 %.4.ps: %.4
543 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
545 %.5.ps: %.5
546 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
548 %.6.ps: %.6
549 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
551 %.7.ps: %.7
552 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
554 %.8.ps: %.8
555 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
557 %.9.ps: %.9
558 $(MAN) -l $(MAN_FLAGS) -Tps $< > $@
560 # -----------------------------------------------------------------
561 # pattern rule for converting Postscript to PDF
562 # -----------------------------------------------------------------
563 %.pdf: %.ps
564 $(PS2PDF) $(PS2PDF_FLAGS) $<
566 # -----------------------------------------------------------------
567 # pattern rules for making plain-text output from man pages
568 # -----------------------------------------------------------------
569 %.1.txt: %.1
570 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
572 %.2.txt: %.2
573 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
575 %.3.txt: %.3
576 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
578 %.4.txt: %.4
579 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
581 %.5.txt: %.5
582 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
584 %.6.txt: %.6
585 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
587 %.7.txt: %.7
588 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
590 %.8.txt: %.8
591 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
593 %.9.txt: %.9
594 $(MAN) -l $(MAN_FLAGS) -Tascii $< | $(COL) -b $(COL_FLAGS) | $(EXPAND) $(EXPAND_FLAGS) > $@
596 # -----------------------------------------------------------------
597 # target(s) for cleaning up the mess
598 # -----------------------------------------------------------------
599 clean:
600 $(RM) *.info
601 $(RM) *.texi
602 $(RM) *.texi-list
603 ifneq ($(FILES_TXT),)
604 $(RM) $(FILES_TXT)
605 endif
606 ifneq ($(FILES_PDF),)
607 $(RM) $(FILES_PDF)
608 endif
609 ifneq ($(FILES_FO),)
610 $(RM) $(FILES_FO)
611 endif
612 ifneq ($(FILES_LOG),)
613 $(RM) $(FILES_LOG)
614 endif
615 ifneq ($(FILES_OUT),)
616 $(RM) $(FILES_OUT)
617 endif
618 ifneq ($(FILES_AUX),)
619 $(RM) $(FILES_AUX)
620 endif
621 ifneq ($(FILES_HTML),)
622 $(RM) $(FILES_HTML)
623 endif
624 ifneq ($(FILES_CHNK),)
625 $(RM) $(FILES_CHNK)
626 endif
627 ifneq ($(FILES_MAN),)
628 $(RM) $(FILES_MAN)
629 endif
630 ifneq ($(FILES_MANT),)
631 $(RM) $(FILES_MANT)
632 endif
633 ifneq ($(FILES_MANP),)
634 $(RM) $(FILES_MANP)
635 endif
636 ifneq ($(FILES_INFO),)
637 $(RM) $(FILES_INFO)
638 endif
639 ifneq ($(DIRS_CHUNK),)
640 for dir in $(DIRS_CHUNK); do \
641 if [ -d "$$dir" ]; then \
642 $(RMDIR) $(RMDIR_FLAGS) $$dir; \
643 fi \
644 done
645 endif
646 ifneq ($(DIRS_MAN),)
647 ifneq ($(DIRS_MAN),.)
648 for dir in $(DIRS_MAN); do \
649 if [ -d "$$dir" ]; then \
650 $(RMDIR) $(RMDIR_FLAGS) $$dir; \
651 fi \
652 done
653 endif
654 endif
655 ifneq ($(LISTS_MAN),)
656 $(RM) $(LISTS_MAN)
657 endif
658 ifneq ($(LISTS_HTML),)
659 $(RM) $(LISTS_HTML)
660 endif