1- # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.58 2006/08/19 13:42:40 meskes Exp $
1+ # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.59 2006/08/28 16: 13:11 tgl Exp $
22
33subdir = src/interfaces/ecpg/test
44top_builddir = ../../../..
@@ -17,6 +17,12 @@ ifdef NO_LOCALE
1717NOLOCALE += --no-locale
1818endif
1919
20+ ifneq ($(PORTNAME ) ,win32)
21+ abs_builddir :=$(shell pwd)
22+ else
23+ abs_builddir :=$(shell pwd -W)
24+ endif
25+
2026all install installdirs uninstall dep depend distprep :
2127$(MAKE ) -C connect$@
2228$(MAKE ) -C sql$@
@@ -36,13 +42,11 @@ clean distclean maintainer-clean:
3642$(MAKE ) -C complex$@
3743$(MAKE ) -C thread$@
3844rm -rf tmp_check results log
39- rm -f pg_regress.inc.sh regression.diffs
45+ rm -f pg_regress regression.diffs
4046
41- all : pg_regress.sh
47+ all : pg_regress
4248
43- pg_regress.sh : pg_regress.inc.sh
44-
45- pg_regress.inc.sh : pg_regress.inc.sh.in$(top_builddir ) /src/Makefile.global
49+ pg_regress : pg_regress.sh$(top_builddir ) /src/Makefile.global
4650sed -e' s,@bindir@,$(bindir),g' \
4751 -e' s,@libdir@,$(libdir),g' \
4852 -e' s,@pkglibdir@,$(pkglibdir),g' \
@@ -54,12 +58,29 @@ pg_regress.inc.sh: pg_regress.inc.sh.in $(top_builddir)/src/Makefile.global
5458 -e' s/@GCC@/$(GCC)/g' \
5559$< > $@
5660
57- check : all pg_regress.inc.sh
58- sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE )
61+ # When doing a VPATH build, copy over the .pgc, .stdout and .stderr
62+ # files so that the driver script can find them. We have to use an
63+ # absolute path for the targets, because otherwise make will try to
64+ # locate the missing files using VPATH, and will find them in
65+ # $(srcdir), but the point here is that we want to copy them from
66+ # $(srcdir) to the build directory.
67+
68+ ifdef VPATH
69+ remaining_files_src :=$(wildcard $(srcdir ) /* /* .pgc) $(wildcard $(srcdir ) /expected/* .c) $(wildcard $(srcdir ) /expected/* .stdout) $(wildcard $(srcdir ) /expected/* .stderr)
70+ remaining_files_build :=$(patsubst $(srcdir ) /% ,$(abs_builddir ) /% ,$(remaining_files_src ) )
71+
72+ all :$(remaining_files_build )
73+ $(remaining_files_build ) :$(abs_builddir ) /% :$(srcdir ) /%
74+ ln -s$< $@
75+ endif
76+
77+
78+ check : all
79+ sh ./pg_regress --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE )
5980
6081# the same options, but with --listen-on-tcp
61- checktcp : all pg_regress.inc.sh
62- sh ./pg_regress.sh --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE ) --listen-on-tcp
82+ checktcp : all
83+ sh ./pg_regress --dbname=regress1 --debug --temp-install --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --multibyte=$(MULTIBYTE ) --load-language=plpgsql$(NOLOCALE ) --listen-on-tcp
6384
64- installcheck : all pg_regress.inc.sh
65- sh ./pg_regress.sh --dbname=regress1 --debug --top-builddir=$(top_builddir ) --load-language=plpgsql$(NOLOCALE )
85+ installcheck : all
86+ sh ./pg_regress --dbname=regress1 --debug --top-builddir=$(top_builddir ) --load-language=plpgsql$(NOLOCALE )