1 # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.73 2008/10/21 10:51:24 petere Exp $
3 subdir = src/interfaces/ecpg/test
4 top_builddir = ../../../..
5 include $(top_builddir)/src/Makefile.global
7 # port number for temp-installation test postmaster
8 # this is also defined in test/connect/Makefile
9 TEMP_PORT = 4$(DEF_PGPORT)
11 # where to find psql for testing an existing installation
20 NOLOCALE += --no-locale
23 ifneq ($(PORTNAME),win32)
24 abs_builddir := $(shell pwd)
26 abs_builddir := $(shell pwd -W)
29 # stuff to pass into build of pg_regress
30 EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
31 '-DMAKEPROG="$(MAKE)"' \
32 '-DSHELLPROG="$(SHELL)"' \
33 '-DDLSUFFIX="$(DLSUFFIX)"'
35 REGRESSINCLUDES = "-I$(top_srcdir)/src/test/regress"
36 REGRESSDRIVER = "$(top_builddir)/src/test/regress/pg_regress.o"
38 all install installdirs uninstall distprep:
40 $(MAKE) -C expected $@
42 $(MAKE) -C pgtypeslib $@
44 $(MAKE) -C compat_informix $@
47 clean distclean maintainer-clean:
49 $(MAKE) -C connect extraclean
50 $(MAKE) -C expected extraclean
52 $(MAKE) -C pgtypeslib $@
54 $(MAKE) -C compat_informix $@
56 rm -rf tmp_check results log
57 rm -f pg_regress regression.diffs regression.out pg_regress_ecpg.o
59 # Build regression test driver
63 pg_regress$(X): pg_regress_ecpg.o
64 $(CC) $(CFLAGS) $^ $(REGRESSDRIVER) $(REGRESSINCLUDES) $(LDFLAGS) $(LIBS) -o $@
66 # dependencies ensure that path changes propagate
67 pg_regress_ecpg.o: pg_regress_ecpg.c $(top_builddir)/src/port/pg_config_paths.h
68 $(CC) $(CFLAGS) $(CPPFLAGS) -I$(top_builddir)/src/port $(REGRESSINCLUDES) $(EXTRADEFS) -c -o $@ $<
70 $(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
71 $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
73 # When doing a VPATH build, copy over the .pgc, .stdout and .stderr
74 # files so that the driver script can find them. We have to use an
75 # absolute path for the targets, because otherwise make will try to
76 # locate the missing files using VPATH, and will find them in
77 # $(srcdir), but the point here is that we want to copy them from
78 # $(srcdir) to the build directory.
81 remaining_files_src := $(wildcard $(srcdir)/*/*.pgc) $(wildcard $(srcdir)/expected/*.c) $(wildcard $(srcdir)/expected/*.stdout) $(wildcard $(srcdir)/expected/*.stderr)
82 remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src))
84 all: $(remaining_files_build)
85 $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
91 ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb
93 # the same options, but with --listen-on-tcp
95 ./pg_regress --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --temp-port=$(TEMP_PORT) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost
98 ./pg_regress --psqldir=$(PSQLDIR) --dbname=regress1,connectdb --top-builddir=$(top_builddir) --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb