Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 776d965

Browse files
committed
Make it possible to run 'make installcheck' in contrib when building
outside the source tree.
1 parent 66a03b0 commit 776d965

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

contrib/contrib-global.mk

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $
22

33
# This file contains generic rules to build many kinds of simple
44
# contrib modules. You only need to set a few variables and include
@@ -185,6 +185,24 @@ distclean maintainer-clean: clean
185185

186186

187187
ifdef REGRESS
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+
ifdef VPATH
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+
188206
.PHONY: submake
189207
submake:
190208
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress

0 commit comments

Comments
 (0)