File: Makefile.am

package info (click to toggle)
docbook2x 0.8.8-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,740 kB
  • sloc: xml: 16,229; sh: 3,674; perl: 3,461; ansic: 639; makefile: 409; sed: 11
file content (202 lines) | stat: -rw-r--r-- 5,412 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# ----------------------------------------------------------------------
# $Id: Makefile.am,v 1.52 2007/02/25 22:28:05 stevecheng Exp $
#
# This Makefile builds the documentation for docbook2X in various
# formats.
#
# Unfortunately, you must not use VPATH builds if you want 
# the converted documentation to end up in the right place
# for the docbook2X distribution.  (It's an automake limitation
# that takes too much effort to work around.)
#

include $(top_srcdir)/docbuild.mk

# ----------------------------------------------------------------------
#
# Document info
#

# Stylesheets
XSLT_MAN = $(srcdir)/ss-man.xsl
XSLT_TEXI = $(srcdir)/ss-texinfo.xsl
XSLT_HTML = $(srcdir)/ss-html.xsl

XML_FILES = docbook2X.xml \
	changes.xml charsets.xml design-notes.xml faq.xml manpages.xml \
	quickstart.xml texinfo.xml textents.xml todo.xml xsltproc.xml \
	perf.xml testing.xml install.xml \
	i18n-system-property/i18n-system-property.xml

HTML_FILES = changes.html charsets.html cindex.html design-notes.html \
	db2x_manxml.html db2x_texixml.html db2x_xsltproc.html \
	sgml2xml-isoent.html docbook2X.html faq.html manpages.html \
	texinfo.html todo.html utf8trans.html xsltproc.html \
	performance.html testing.html install.html dependencies.html \
        docbook2man.html docbook2texi.html

MAN_FILES = db2x_manxml.1 db2x_texixml.1 db2x_xsltproc.1 utf8trans.1 \
	docbook2man.1 docbook2texi.1 sgml2xml-isoent.1

INFO_FILES = docbook2X.info
TEXI_FILES = docbook2X.texi

XSL_FILES = ss-man.xsl ss-texinfo.xsl ss-html.xsl

DOC = docbook2X
DOC_XML = $(DOC).xml



# ----------------------------------------------------------------------
#
# Validation
#

if HAVE_XMLLINT
DOC_VAL = .$(DOC).valid
$(DOC_VAL): $(XML_FILES)
	$(XMLLINT) --noout --valid $<
	touch $(DOC_VAL)
DOC_DEP = $(DOC_VAL)

validate: $(DOC_VAL)

else
DOC_DEP = $(XML_FILES)
endif



# ----------------------------------------------------------------------
#
# User targets
#

.PHONY: all html man texi

all: html man info

html: $(DOC).html
man: $(MAN_FILES)
texi: $(DOC).texi
info: $(DOC).info


# ----------------------------------------------------------------------
#
# HTML conversion
#

if HAVE_HTML_XSL
$(HTML_FILES): $(DOC_XML) $(DOC_DEP) $(XSLT_HTML)
	$(db2x_xsltproc) -s $(XSLT_HTML) $<
if HAVE_TIDY
	-$(TIDY) -q -m -f /dev/null \
		--doctype strict --output-xhtml true --add-xml-decl false \
		$(HTML_FILES)
endif
endif


# ----------------------------------------------------------------------
#
# Texinfo conversion
#

$(DOC).txml: $(DOC_XML) $(DOC_DEP) $(XSLT_TEXI)
	$(db2x_xsltproc) -s $(XSLT_TEXI) \
		--string-param install-datadir="$(datadir)/docbook2X/" \
		-o $@ $<

$(DOC).texi: $(DOC).txml
	$(db2x_texixml) $<

# Stupid makeinfo uses the POSIX locale for localizing documents
$(DOC).info: $(DOC).texi
	LANG=C makeinfo $<


# ----------------------------------------------------------------------
#
# Man page conversion
#

$(DOC).mxml: $(DOC_XML) $(DOC_DEP) $(XSLT_MAN)
	$(db2x_xsltproc) -s $(XSLT_MAN) \
		--string-param header-4="docbook2X $(VERSION)" \
		--string-param install-datadir="$(datadir)/docbook2X/" \
		-o $@ $<

$(MAN_FILES): $(DOC).mxml
	$(db2x_manxml) --solinks $<

# The use of $(srcdir) below is strange, and arguably not correct
# for VPATH builds; however, check gets called by automake's distcheck,
# which breaks if we do not use $(srcdir) here.
check: $(DOC).mxml
if HAVE_GROFF
	$(GROFF) -man -Tutf8 -z -w all $(srcdir)/*.1 2>&1 | grep "warning: " ; test $$? -eq 1
endif
	$(db2x_perl) $(top_srcdir)/test/htest-man.pl $(srcdir)/*.1

# Use for screenshot on Web site
demo-man.ps: $(MAN_FILES)
	groff -Tps -man $(srcdir)/docbook2man.1 $(srcdir)/docbook2texi.1 \
			$(srcdir)/db2x_manxml.1 $(srcdir)/db2x_texixml.1 \
			$(srcdir)/db2x_xsltproc.1 $(srcdir)/sgml2xml-isoent.1 \
			$(srcdir)/utf8trans.1 > demo-man.ps

# ----------------------------------------------------------------------
#
# The INSTALL, NEWS files
#
# The call to 'tr' is there because I absolutely hate the ugly
# fake directional ASCII quotes.
#
# Important: This rule doesn't work when configured for a VPATH build;
#            and it is not worthwhile to try to fix it because
#            it is a dangerous command anyway (it changes 
#            the INSTALL file in the distribution).
install.txt: install2.xml install.xml textents.xml
	$(db2x_xsltproc) -s $(XSLT_TEXI) install2.xml | $(db2x_texixml) --plaintext --to-stdout | tr \` \' > install.txt
	cp install.txt ../INSTALL

# ----------------------------------------------------------------------
#
# Distribution (automake)
#

EXTRA_DIST = $(XML_FILES) install2.xml $(MAN_FILES) $(HTML_FILES) \
	$(XSL_FILES) docbook2X.css \
	$(DOC).mxml $(DOC).txml .$(DOC).valid
# We include the last three files in the distribution, even though
# they are auto-generated, so that we don't trigger unnecessary
# rebuilding of the documentation on the user's end.

# Don't include big ass texinfo.tex
AUTOMAKE_OPTIONS = no-texinfo.tex

# ----------------------------------------------------------------------
#
# Install (automake)
#

htmldir = $(datadir)/doc/docbook2X

man_MANS = $(MAN_FILES)
html_DATA = $(HTML_FILES)
info_TEXINFOS = docbook2X.texi


# ----------------------------------------------------------------------
#
# Clean (automake)
#

MAINTAINERCLEANFILES = $(MAN_FILES) $(HTML_FILES) \
	$(INFO_FILES) $(TEXI_FILES) \
	$(DOC).mxml $(DOC).txml $(DOC_VAL)

.DELETE_ON_ERROR: