From: Tom Lane Date: Sat, 2 Nov 2002 00:16:21 +0000 (+0000) Subject: Make it possible to run 'make installcheck' in contrib when building X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=5f7fde13fdfa62fc267b795556a2ce197fd666c8;p=users%2Fbernd%2Fpostgres.git Make it possible to run 'make installcheck' in contrib when building outside the source tree. --- diff --git a/contrib/contrib-global.mk b/contrib/contrib-global.mk index 3e1e99a5b2..a93c75900c 100644 --- a/contrib/contrib-global.mk +++ b/contrib/contrib-global.mk @@ -185,6 +185,24 @@ distclean maintainer-clean: clean ifdef REGRESS + +# When doing a VPATH build, must copy over the test .sql and .out +# 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)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) $(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: $(MAKE) -C $(top_builddir)/src/test/regress pg_regress