@@ -61,15 +61,22 @@ ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
61
61
ALL_IMAGES :=$(wildcard $(srcdir ) /images/* .svg)
62
62
63
63
64
+ # Run validation only once, common to all subsequent targets. While
65
+ # we're at it, also resolve all entities (that is, copy all included
66
+ # files into one big file). This helps tools that don't understand
67
+ # vpath builds (such as dbtoepub).
68
+ postgres-full.xml : postgres.sgml$(ALLSGML )
69
+ $(XMLLINT ) $(XMLINCLUDE ) --output$@ --noent --valid$<
70
+
71
+
64
72
# #
65
73
# # Man pages
66
74
# #
67
75
68
76
man distprep-man : man-stamp
69
77
70
- man-stamp : stylesheet-man.xsl postgres.sgml$(ALLSGML )
71
- $(XMLLINT ) $(XMLINCLUDE ) --noout --valid$(word 2,$^ )
72
- $(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_MAN_FLAGS ) $(wordlist 1,2,$^ )
78
+ man-stamp : stylesheet-man.xsl postgres-full.xml
79
+ $(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_MAN_FLAGS ) $^
73
80
touch$@
74
81
75
82
@@ -117,7 +124,7 @@ INSTALL.html: %.html : stylesheet-text.xsl %.xml
117
124
$(XMLLINT ) --noout --valid$* .xml
118
125
$(XSLTPROC ) $(XSLTPROCFLAGS ) $(XSLTPROC_HTML_FLAGS ) $^ > $@
119
126
120
- INSTALL.xml : standalone-profile.xsl standalone-install.xml postgres.sgml $( ALLSGML )
127
+ INSTALL.xml : standalone-profile.xsl standalone-install.xml postgres-full.xml
121
128
$(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) --xinclude$(wordlist 1,2,$^ ) > $@
122
129
123
130
@@ -131,25 +138,22 @@ endif
131
138
132
139
html : html-stamp
133
140
134
- html-stamp : stylesheet.xsl postgres.sgml$(ALLSGML ) $(ALL_IMAGES )
135
- $(XMLLINT ) $(XMLINCLUDE ) --noout --valid$(word 2,$^ )
141
+ html-stamp : stylesheet.xsl postgres-full.xml$(ALL_IMAGES )
136
142
$(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_HTML_FLAGS ) $(wordlist 1,2,$^ )
137
143
cp$(ALL_IMAGES ) html/
138
144
cp$(srcdir ) /stylesheet.css html/
139
145
touch$@
140
146
141
147
htmlhelp : htmlhelp-stamp
142
148
143
- htmlhelp-stamp : stylesheet-hh.xsl postgres.sgml$(ALLSGML ) $(ALL_IMAGES )
144
- $(XMLLINT ) $(XMLINCLUDE ) --noout --valid$(word 2,$^ )
149
+ htmlhelp-stamp : stylesheet-hh.xsl postgres-full.xml$(ALL_IMAGES )
145
150
$(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(wordlist 1,2,$^ )
146
151
cp$(ALL_IMAGES ) htmlhelp/
147
152
cp$(srcdir ) /stylesheet.css htmlhelp/
148
153
touch$@
149
154
150
155
# single-page HTML
151
- postgres.html : stylesheet-html-nochunk.xsl postgres.sgml$(ALLSGML ) $(ALL_IMAGES )
152
- $(XMLLINT ) $(XMLINCLUDE ) --noout --valid$(word 2,$^ )
156
+ postgres.html : stylesheet-html-nochunk.xsl postgres-full.xml$(ALL_IMAGES )
153
157
$(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_HTML_FLAGS ) -o$@ $(wordlist 1,2,$^ )
154
158
155
159
# single-page text
@@ -166,13 +170,11 @@ postgres.pdf:
166
170
167
171
XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir ) /'
168
172
169
- % -A4.fo : stylesheet-fo.xsl% .sgml$(ALLSGML )
170
- $(XMLLINT ) $(XMLINCLUDE ) --noout --valid$(word 2,$^ )
171
- $(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_FO_FLAGS ) --stringparam paper.type A4 -o$@ $(wordlist 1,2,$^ )
173
+ % -A4.fo : stylesheet-fo.xsl% -full.xml
174
+ $(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_FO_FLAGS ) --stringparam paper.type A4 -o$@ $^
172
175
173
- % -US.fo : stylesheet-fo.xsl% .sgml$(ALLSGML )
174
- $(XMLLINT ) $(XMLINCLUDE ) --noout --valid$(word 2,$^ )
175
- $(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_FO_FLAGS ) --stringparam paper.type USletter -o$@ $(wordlist 1,2,$^ )
176
+ % -US.fo : stylesheet-fo.xsl% -full.xml
177
+ $(XSLTPROC ) $(XMLINCLUDE ) $(XSLTPROCFLAGS ) $(XSLTPROC_FO_FLAGS ) --stringparam paper.type USletter -o$@ $^
176
178
177
179
% .pdf :% .fo$(ALL_IMAGES )
178
180
$(FOP ) -fo$< -pdf$@
@@ -183,8 +185,11 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/'
183
185
# #
184
186
185
187
epub : postgres.epub
186
- postgres.epub : postgres.sgml$(ALLSGML ) $(ALL_IMAGES )
187
- $(XMLLINT ) --noout --valid$<
188
+ postgres.epub : postgres-full.xml$(ALL_IMAGES )
189
+ ifeq ($(vpath_build ) ,yes)
190
+ $(MKDIR_P) images
191
+ cp $(ALL_IMAGES) images/
192
+ endif
188
193
$(DBTOEPUB) -o $@ $<
189
194
190
195
@@ -196,8 +201,7 @@ DB2X_TEXIXML = db2x_texixml
196
201
DB2X_XSLTPROC = db2x_xsltproc
197
202
MAKEINFO = makeinfo
198
203
199
- % .texixml :% .sgml$(ALLSGML )
200
- $(XMLLINT ) --noout --valid$<
204
+ % .texixml :% -full.xml
201
205
$(DB2X_XSLTPROC ) -s texi -g output-file=$(basename $@ ) $< -o$@
202
206
203
207
% .texi :% .texixml
@@ -284,6 +288,7 @@ check-tabs:
284
288
# This allows removing some files from the distribution tarballs while
285
289
# keeping the dependencies satisfied.
286
290
.SECONDARY :$(GENERATED_SGML )
291
+ .SECONDARY : postgres-full.xml
287
292
.SECONDARY : INSTALL.html INSTALL.xml
288
293
.SECONDARY : postgres-A4.fo postgres-US.fo
289
294
@@ -297,6 +302,7 @@ clean:
297
302
rm -f *.fo *.pdf
298
303
# generated SGML files
299
304
rm -f $(GENERATED_SGML)
305
+ rm -f postgres-full.xml
300
306
# HTML Help
301
307
rm -rf htmlhelp/ htmlhelp-stamp
302
308
# EPUB