66# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
77# Portions Copyright (c) 1994, Regents of the University of California
88#
9- # $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.63 2007/01/05 22:20:03 momjian Exp $
9+ # $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.64 2007/01/19 16:42:24 alvherre Exp $
1010#
1111# -------------------------------------------------------------------------
1212
4040# stuff to pass into build of pg_regress
4141EXTRADEFS = '-DHOST_TUPLE="$(host_tuple ) "'\
4242'-DMAKEPROG="$(MAKE ) "'\
43- '-DSHELLPROG="$(SHELL ) "'
43+ '-DSHELLPROG="$(SHELL ) "'\
44+ '-DDLSUFFIX="$(DLSUFFIX ) "'
4445
4546# #
4647# # Prepare for tests
@@ -83,14 +84,12 @@ $(NAME)$(DLSUFFIX): $(shlib)
8384rm -f$(NAME )$(DLSUFFIX )
8485$(LN_S ) $(shlib ) $(NAME )$(DLSUFFIX )
8586
86- # Build test input and expected files
87-
88- file_list :=copy create_function_1 create_function_2 misc constraints tablespace
87+ # Test input and expected files. These are created by pg_regress itself, so we
88+ # don't have a rule to create them. We do need rules to clean them however.
89+ file_list :=$( subst .source,, $( notdir $( wildcard $( top_srcdir ) / $( subdir ) /input/ * .source) ) )
8990input_files :=$(foreach file,$(file_list ) , sql/$(file ) .sql)
9091output_files :=$(foreach file,$(file_list ) , expected/$(file ) .out)
9192
92- all :$(input_files ) $(output_files )
93-
9493ifneq ($(PORTNAME ) ,win32)
9594abs_srcdir :=$(shell cd$(srcdir ) && pwd)
9695abs_builddir :=$(shell pwd)
@@ -99,22 +98,6 @@ abs_srcdir := $(shell cd $(srcdir) && pwd -W)
9998abs_builddir :=$(shell pwd -W)
10099endif
101100
102- testtablespace :=$(abs_builddir ) /testtablespace
103-
104-
105- define sed-command
106- sed -e 's,@abs_srcdir@,$(abs_srcdir ) ,g' \
107- -e 's,@abs_builddir@,$(abs_builddir ) ,g' \
108- -e 's,@testtablespace@,$(testtablespace ) ,g' \
109- -e 's/@DLSUFFIX@/$(DLSUFFIX ) /g'$< >$@
110- endef
111-
112- $(input_files ) : sql/% .sql: input/% .source
113- $(sed-command )
114-
115- $(output_files ) : expected/% .out: output/% .source
116- $(sed-command )
117-
118101# When doing a VPATH build, copy over the remaining .sql and .out
119102# files so that the driver script can find them. We have to use an
120103# absolute path for the targets, because otherwise make will try to
@@ -148,17 +131,17 @@ all-spi:
148131check : all
149132-rm -rf ./testtablespace
150133mkdir ./testtablespace
151- ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --schedule=$(srcdir ) /parallel_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(MAXCONNOPT ) $(NOLOCALE )
134+ ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir ) --srcdir= $( abs_srcdir ) -- temp-port=$(TEMP_PORT ) --schedule=$(srcdir ) /parallel_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(MAXCONNOPT ) $(NOLOCALE )
152135
153136installcheck : all
154137-rm -rf ./testtablespace
155138mkdir ./testtablespace
156- ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE )
139+ ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule --srcdir= $( abs_srcdir ) -- multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE )
157140
158141installcheck-parallel : all
159142-rm -rf ./testtablespace
160143mkdir ./testtablespace
161- ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /parallel_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(MAXCONNOPT ) $(NOLOCALE )
144+ ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /parallel_schedule --srcdir= $( abs_srcdir ) -- multibyte=$(MULTIBYTE ) --load-language=plpgsql$(MAXCONNOPT ) $(NOLOCALE )
162145
163146
164147# old interfaces follow...
@@ -168,10 +151,10 @@ runtest: installcheck
168151runtest-parallel : installcheck-parallel
169152
170153bigtest :
171- ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE ) numeric_big
154+ ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule --srcdir= $( abs_srcdir ) -- multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE ) numeric_big
172155
173156bigcheck :
174- ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --schedule=$(srcdir ) /parallel_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(MAXCONNOPT ) $(NOLOCALE ) numeric_big
157+ ./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir ) --srcdir= $( abs_srcdir ) -- temp-port=$(TEMP_PORT ) --schedule=$(srcdir ) /parallel_schedule --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(MAXCONNOPT ) $(NOLOCALE ) numeric_big
175158
176159
177160# #