|
1 | 1 | # PGXS: PostgreSQL extensions makefile
|
2 | 2 |
|
3 |
| -# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.14 2008/10/02 12:25:25 tgl Exp $ |
| 3 | +# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.15 2008/10/03 08:00:16 petere Exp $ |
4 | 4 |
|
5 | 5 | # This file contains generic rules to build many kinds of simple
|
6 | 6 | # extension modules. You only need to set a few variables and include
|
@@ -232,6 +232,23 @@ endif
|
232 | 232 | # where to find psql for running the tests
|
233 | 233 | PSQLDIR =$(bindir)
|
234 | 234 |
|
| 235 | +# When doing a VPATH build, must copy over the data files so that the |
| 236 | +# driver script can find them. We have to use an absolute path for |
| 237 | +# the targets, because otherwise make will try to locate the missing |
| 238 | +# files using VPATH, and will find them in $(srcdir), but the point |
| 239 | +# here is that we want to copy them from $(srcdir) to the build |
| 240 | +# directory. |
| 241 | + |
| 242 | +ifdefVPATH |
| 243 | +abs_builddir :=$(shell pwd) |
| 244 | +test_files_src :=$(wildcard$(srcdir)/data/*.data) |
| 245 | +test_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(test_files_src)) |
| 246 | + |
| 247 | +all:$(test_files_build) |
| 248 | +$(test_files_build):$(abs_builddir)/%:$(srcdir)/% |
| 249 | +ln -s$<$@ |
| 250 | +endif# VPATH |
| 251 | + |
235 | 252 | .PHONY: submake
|
236 | 253 | submake:
|
237 | 254 | ifndefPGXS
|
|