]> git.saurik.com Git - apt.git/blame_incremental - buildlib/docbook.mak
fix crash in order writing in pkgDPkgPM::WriteApportReport()
[apt.git] / buildlib / docbook.mak
... / ...
CommitLineData
1# -*- make -*-
2
3# This processes DocBook XML to produce html and plain text output
4
5# Input
6# $(SOURCE) - The documents to use
7
8# All output is written to files in the build doc directory
9
10# See defaults.mak for information about LOCAL
11
12# Some local definitions
13LOCAL := docbook-$(firstword $(SOURCE))
14$(LOCAL)-HTML := $(addsuffix .html,$(addprefix $(DOC)/,$(basename $(SOURCE))))
15$(LOCAL)-TEXT := $(addsuffix .text,$(addprefix $(DOC)/,$(basename $(SOURCE))))
16INCLUDES = apt.ent apt-verbatim.ent apt-vendor.ent
17
18docbook:
19
20
21#---------
22
23# Rules to build HTML documentations
24ifdef XSLTPROC
25
26DOCBOOK_HTML_STYLESHEET := docbook-html-style.xsl
27
28# Install generation hooks
29docbook: $($(LOCAL)-HTML)
30veryclean: veryclean/html/$(LOCAL)
31
32vpath %.dbk $(SUBDIRS)
33vpath $(DOCBOOK_HTML_STYLESHEET) $(SUBDIRS)
34$(DOC)/%.html: %.dbk $(DOCBOOK_HTML_STYLESHEET) $(INCLUDES)
35 echo Creating html for $< to $@
36 -rm -rf $@
37 mkdir -p $@
38 $(DOCBOOK) \
39 --stringparam base.dir $@/ \
40 --stringparam l10n.gentext.default.language $(LC) \
41 $(<D)/$(DOCBOOK_HTML_STYLESHEET) $< || exit 199
42
43# Clean rule
44.PHONY: veryclean/html/$(LOCAL)
45veryclean/html/$(LOCAL):
46 -rm -rf $($(@F)-HTML)
47
48endif
49
50#---------
51
52# Rules to build Text documentations
53ifdef XSLTPROC
54
55DOCBOOK_TEXT_STYLESHEET := docbook-text-style.xsl
56
57# Install generation hooks
58docbook: $($(LOCAL)-TEXT)
59veryclean: veryclean/text/$(LOCAL)
60
61vpath %.dbk $(SUBDIRS)
62vpath $(DOCBOOK_TEXT_STYLESHEET) $(SUBDIRS)
63$(DOC)/%.text: %.dbk $(DOCBOOK_TEXT_STYLESHEET) $(INCLUDES)
64 echo Creating text for $< to $@
65 $(DOCBOOK) \
66 --stringparam l10n.gentext.default.language $(LC) \
67 $(<D)/$(DOCBOOK_TEXT_STYLESHEET) $< | \
68 LC_ALL=C.UTF-8 $(DOCBOOK2TEXT) > $@ || exit 198
69
70# Clean rule
71.PHONY: veryclean/text/$(LOCAL)
72veryclean/text/$(LOCAL):
73 -rm -rf $($(@F)-TEXT)
74
75endif