2
2
#
3
3
# PostgreSQL documentation makefile
4
4
#
5
- # $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.128 2009/08/26 22:24:42 petere Exp $
5
+ # $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.129 2009/08/28 20:26:18 petere Exp $
6
6
#
7
7
# ----------------------------------------------------------------------------
8
8
32
32
ifndef JADE
33
33
JADE = jade
34
34
endif
35
- SGMLINCLUDE = -D $(srcdir )
35
+ SGMLINCLUDE = -D . -D $(srcdir )
36
36
37
37
ifndef NSGMLS
38
38
NSGMLS = nsgmls
@@ -75,13 +75,9 @@ override SPFLAGS += -wall -wno-unused-param -wno-empty -wfully-tagged
75
75
76
76
man : man-stamp
77
77
78
- ifeq ($(vpath_build ) ,yes)
79
- XSLTPROC_MAN_FLAGS = --stringparam man.output.base.dir '$(srcdir ) /'
80
- endif
81
-
82
- $(srcdir ) /man-stamp : stylesheet-man.xsl postgres.xml
78
+ man-stamp : stylesheet-man.xsl postgres.xml
83
79
$(XSLTPROC ) $(XSLTPROCFLAGS ) $(XSLTPROC_MAN_FLAGS ) $^
84
- rm $( srcdir ) / man1/dblink*
80
+ rm man1/dblink*
85
81
touch $@
86
82
87
83
@@ -92,47 +88,43 @@ $(srcdir)/man-stamp: stylesheet-man.xsl postgres.xml
92
88
.PHONY : draft
93
89
94
90
JADE.html.call = $(JADE ) $(JADEFLAGS ) $(SPFLAGS ) $(SGMLINCLUDE ) $(CATALOG ) -d stylesheet.dsl -t sgml -i output-html
95
- ifeq ($(vpath_build ) ,yes)
96
- # This only works with openjade, not with the older jade.
97
- JADE.html.call += -V '(define %output-dir% "$(srcdir ) /html")'
98
- endif
99
91
100
92
# The draft target creates HTML output in draft mode, without index (for faster build).
101
93
draft : postgres.sgml $(ALMOSTALLSGML ) stylesheet.dsl
102
- $(MKDIR_P ) $( srcdir ) / html
94
+ $(MKDIR_P ) html
103
95
$(JADE.html.call ) -V draft-mode $<
104
- cp $(srcdir ) /stylesheet.css $( srcdir ) / html/
96
+ cp $(srcdir ) /stylesheet.css html/
105
97
106
98
html : html-stamp
107
99
108
- $( srcdir ) / html-stamp : postgres.sgml $(ALLSGML ) stylesheet.dsl
109
- $(MKDIR_P ) $( srcdir ) / html
100
+ html-stamp : postgres.sgml $(ALLSGML ) stylesheet.dsl
101
+ $(MKDIR_P ) html
110
102
$(JADE.html.call ) -i include-index $<
111
- cp $(srcdir ) /stylesheet.css $( srcdir ) / html/
103
+ cp $(srcdir ) /stylesheet.css html/
112
104
touch $@
113
105
114
- $( srcdir ) / HTML.index : postgres.sgml $(ALMOSTALLSGML ) stylesheet.dsl
115
- @$(MKDIR_P ) $( srcdir ) / html
106
+ HTML.index : postgres.sgml $(ALMOSTALLSGML ) stylesheet.dsl
107
+ @$(MKDIR_P ) html
116
108
$(JADE.html.call ) -V html-index $<
117
109
118
- $( srcdir ) / bookindex.sgml : HTML.index
110
+ bookindex.sgml : HTML.index
119
111
LC_ALL=C $(PERL ) $(COLLATEINDEX ) -f -g -i ' bookindex' -o $@ $<
120
112
121
113
# Technically, this should depend on Makefile.global, but then
122
114
# version.sgml would need to be rebuilt after every configure run,
123
115
# even in distribution tarballs. So this is cheating a bit, but it
124
116
# will achieve the goal of updating the version number when it
125
117
# changes.
126
- $( srcdir ) / version.sgml : $(top_srcdir ) /configure
118
+ version.sgml : $(top_srcdir ) /configure
127
119
{ \
128
120
echo " <!entity version \" $( VERSION) \" >" ; \
129
121
echo " <!entity majorversion \" $( MAJORVERSION) \" >" ; \
130
122
} > $@
131
123
132
- $( srcdir ) / features-supported.sgml : $(top_srcdir ) /src/backend/catalog/sql_feature_packages.txt $(top_srcdir ) /src/backend/catalog/sql_features.txt
124
+ features-supported.sgml : $(top_srcdir ) /src/backend/catalog/sql_feature_packages.txt $(top_srcdir ) /src/backend/catalog/sql_features.txt
133
125
$(PERL ) $(srcdir ) /mk_feature_tables.pl YES $^ > $@
134
126
135
- $( srcdir ) / features-unsupported.sgml : $(top_srcdir ) /src/backend/catalog/sql_feature_packages.txt $(top_srcdir ) /src/backend/catalog/sql_features.txt
127
+ features-unsupported.sgml : $(top_srcdir ) /src/backend/catalog/sql_feature_packages.txt $(top_srcdir ) /src/backend/catalog/sql_features.txt
136
128
$(PERL ) $(srcdir ) /mk_feature_tables.pl NO $^ > $@
137
129
138
130
@@ -232,10 +224,6 @@ postgres.xml: postgres.sgml $(ALMOSTALLSGML)
232
224
> $@
233
225
# ' hello Emacs
234
226
235
- ifeq ($(vpath_build ) ,yes)
236
- XSLTPROC_HTML_FLAGS = --stringparam base.dir '$(srcdir ) /html'
237
- endif
238
-
239
227
xslthtml : stylesheet.xsl postgres.xml
240
228
$(XSLTPROC ) $(XSLTPROCFLAGS ) $(XSLTPROC_HTML_FLAGS ) $^
241
229
@@ -280,9 +268,11 @@ check: postgres.sgml $(ALMOSTALLSGML)
280
268
# # Install
281
269
# #
282
270
283
- found_html = $(wildcard $(srcdir ) /html-stamp)
271
+ vpathsearch = $(firstword $(wildcard $(addsuffix /$(1 ) ,$(subst :, ,. $(VPATH ) ) ) ) )
272
+
273
+ found_html = $(wildcard html-stamp $(srcdir ) /html-stamp)
284
274
285
- ifneq ($(wildcard $(srcdir ) /man-stamp) ,)
275
+ ifneq ($(wildcard man-stamp $(srcdir ) /man-stamp) ,)
286
276
# SCO OpenServer's man system is sufficiently different to not bother.
287
277
ifneq ($(PORTNAME ) , sco)
288
278
found_man = yes
@@ -301,7 +291,7 @@ uninstall:
301
291
# # Install html
302
292
303
293
install-html : html installdirs
304
- cp -R $(srcdir ) / html ' $(DESTDIR)$(htmldir)'
294
+ cp -R $(call vpathsearch, html) ' $(DESTDIR)$(htmldir)'
305
295
306
296
307
297
# # Install man
@@ -316,7 +306,7 @@ sqlmansectnum = $(shell expr X'$(sqlmansect)' : X'\([0-9]\)')
316
306
#
317
307
ifeq ($(sqlmansectnum ) ,7)
318
308
install-man :
319
- cp -R $(addprefix $( srcdir ) / ,man1 man3 man7) ' $(DESTDIR)$(mandir)'
309
+ cp -R $(foreach dir ,man1 man3 man7, $( call vpathsearch, $( dir ) ) ) ' $(DESTDIR)$(mandir)'
320
310
321
311
else # sqlmansectnum != 7
322
312
fix_sqlmansectnum = sed -e '/^\.TH/s/"7"/"$(sqlmansect ) "/' \
0 commit comments