From: Tom Lane Date: Tue, 24 May 2005 17:07:41 +0000 (+0000) Subject: Fix PL makefiles to support running regression tests in VPATH builds. X-Git-Tag: REL8_1_0BETA1~740 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc6444dc6a4b98d6d8b65dede360531ce2294ece;p=postgresql Fix PL makefiles to support running regression tests in VPATH builds. --- diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index 2afaa80775..20dd732070 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -1,5 +1,5 @@ # Makefile for PL/Perl -# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.21 2005/05/24 08:05:36 neilc Exp $ +# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.22 2005/05/24 17:07:41 tgl Exp $ subdir = src/pl/plperl top_builddir = ../../.. @@ -47,6 +47,27 @@ all: all-lib SPI.c: SPI.xs $(PERL) $(perl_privlibexp)/ExtUtils/xsubpp -typemap $(perl_privlibexp)/ExtUtils/typemap $< >$@ +# When doing a VPATH build, copy over the .sql and .out files so that the +# test script can find them. See comments in src/test/regress/GNUmakefile. +ifdef VPATH + +ifneq ($(PORTNAME),win32) +abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_builddir := $(shell pwd) +else +abs_srcdir := $(shell cd $(srcdir) && pwd -W) +abs_builddir := $(shell pwd -W) +endif + +test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) +test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)) + +all: $(test_files_build) +$(test_files_build): $(abs_builddir)/%: $(srcdir)/% + ln -s $< $@ + +endif + install: all installdirs ifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX) diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile index 3720dc3cef..c8eead2601 100644 --- a/src/pl/plpython/Makefile +++ b/src/pl/plpython/Makefile @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.20 2005/05/17 18:26:23 tgl Exp $ +# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.21 2005/05/24 17:07:41 tgl Exp $ subdir = src/pl/plpython top_builddir = ../../.. @@ -66,6 +66,27 @@ include $(top_srcdir)/src/Makefile.shlib all: all-lib +# When doing a VPATH build, copy over the .sql and .out files so that the +# test script can find them. See comments in src/test/regress/GNUmakefile. +ifdef VPATH + +ifneq ($(PORTNAME),win32) +abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_builddir := $(shell pwd) +else +abs_srcdir := $(shell cd $(srcdir) && pwd -W) +abs_builddir := $(shell pwd -W) +endif + +test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) +test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)) + +all: $(test_files_build) +$(test_files_build): $(abs_builddir)/%: $(srcdir)/% + ln -s $< $@ + +endif + install: all installdirs ifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX) diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index 6b7764e942..6e40e7de1e 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -2,7 +2,7 @@ # # Makefile for the pltcl shared object # -# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.46 2005/05/17 18:26:23 tgl Exp $ +# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.47 2005/05/24 17:07:41 tgl Exp $ # #------------------------------------------------------------------------- @@ -50,6 +50,27 @@ ifeq ($(TCL_SHARED_BUILD), 1) all: all-lib $(MAKE) -C modules $@ +# When doing a VPATH build, copy over the .sql and .out files so that the +# test script can find them. See comments in src/test/regress/GNUmakefile. +ifdef VPATH + +ifneq ($(PORTNAME),win32) +abs_srcdir := $(shell cd $(srcdir) && pwd) +abs_builddir := $(shell pwd) +else +abs_srcdir := $(shell cd $(srcdir) && pwd -W) +abs_builddir := $(shell pwd -W) +endif + +test_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) +test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src)) + +all: $(test_files_build) +$(test_files_build): $(abs_builddir)/%: $(srcdir)/% + ln -s $< $@ + +endif + install: all installdirs ifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)