Put back the copying of some of the regression test data files for vpath
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 3 Oct 2008 08:00:16 +0000 (08:00 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 3 Oct 2008 08:00:16 +0000 (08:00 +0000)
builds.  It is too complicated to fix in another way for now.

src/makefiles/pgxs.mk

index 51391ec959812523ef8953a7de0b2ad0b5be32e1..08208ae6d6cf623d2612fda5e32bd43f9e76b1c8 100644 (file)
@@ -232,6 +232,23 @@ endif
 # where to find psql for running the tests
 PSQLDIR = $(bindir)
 
+# When doing a VPATH build, must copy over the data files so that the
+# driver script can find them.  We have to use an absolute path for
+# the targets, because otherwise make will try to locate the missing
+# files using VPATH, and will find them in $(srcdir), but the point
+# here is that we want to copy them from $(srcdir) to the build
+# directory.
+
+ifdef VPATH
+abs_builddir := $(shell pwd)
+test_files_src := $(wildcard $(srcdir)/data/*.data)
+test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src))
+
+all: $(test_files_build)
+$(test_files_build): $(abs_builddir)/%: $(srcdir)/%
+       ln -s $< $@
+endif # VPATH
+
 .PHONY: submake
 submake:
 ifndef PGXS