|
1 |
| -# $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.4 2002/11/01 23:45:37 tgl Exp $ |
| 1 | +# $Header: /cvsroot/pgsql/contrib/contrib-global.mk,v 1.5 2002/11/02 00:16:21 tgl Exp $ |
2 | 2 |
|
3 | 3 | # This file contains generic rules to build many kinds of simple
|
4 | 4 | # contrib modules. You only need to set a few variables and include
|
@@ -185,6 +185,24 @@ distclean maintainer-clean: clean
|
185 | 185 |
|
186 | 186 |
|
187 | 187 | ifdefREGRESS
|
| 188 | + |
| 189 | +# When doing a VPATH build, must copy over the test .sql and .out |
| 190 | +# files so that the driver script can find them. We have to use an |
| 191 | +# absolute path for the targets, because otherwise make will try to |
| 192 | +# locate the missing files using VPATH, and will find them in |
| 193 | +# $(srcdir), but the point here is that we want to copy them from |
| 194 | +# $(srcdir) to the build directory. |
| 195 | + |
| 196 | +ifdefVPATH |
| 197 | +abs_builddir :=$(shell pwd) |
| 198 | +test_files_src :=$(wildcard$(srcdir)/sql/*.sql)$(wildcard$(srcdir)/expected/*.out)$(wildcard$(srcdir)/data/*.data) |
| 199 | +test_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(test_files_src)) |
| 200 | + |
| 201 | +all:$(test_files_build) |
| 202 | +$(test_files_build):$(abs_builddir)/%:$(srcdir)/% |
| 203 | +ln -s$<$@ |
| 204 | +endif# VPATH |
| 205 | + |
188 | 206 | .PHONY: submake
|
189 | 207 | submake:
|
190 | 208 | $(MAKE) -C$(top_builddir)/src/test/regress pg_regress
|
|