]> granicus.if.org Git - postgresql/blob - src/interfaces/ecpg/test/Makefile
Clean regression.out
[postgresql] / src / interfaces / ecpg / test / Makefile
1 # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.73 2008/10/21 10:51:24 petere Exp $
2
3 subdir = src/interfaces/ecpg/test
4 top_builddir = ../../../..
5 include $(top_builddir)/src/Makefile.global
6
7 # port number for temp-installation test postmaster
8 # this is also defined in test/connect/Makefile
9 TEMP_PORT = 4$(DEF_PGPORT)
10
11 # where to find psql for testing an existing installation
12 PSQLDIR = $(bindir)
13
14 # default encoding
15 MULTIBYTE = SQL_ASCII
16
17 # locale
18 NOLOCALE =
19 ifdef NO_LOCALE
20 NOLOCALE += --no-locale
21 endif
22
23 ifneq ($(PORTNAME),win32)
24 abs_builddir := $(shell pwd)
25 else
26 abs_builddir := $(shell pwd -W)
27 endif
28
29 # stuff to pass into build of pg_regress
30 EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
31         '-DMAKEPROG="$(MAKE)"' \
32         '-DSHELLPROG="$(SHELL)"' \
33         '-DDLSUFFIX="$(DLSUFFIX)"'
34
35 REGRESSINCLUDES = "-I$(top_srcdir)/src/test/regress"
36 REGRESSDRIVER = "$(top_builddir)/src/test/regress/pg_regress.o"
37
38 all install installdirs uninstall distprep:
39         $(MAKE) -C connect $@
40         $(MAKE) -C expected $@
41         $(MAKE) -C sql $@
42         $(MAKE) -C pgtypeslib $@
43         $(MAKE) -C preproc $@
44         $(MAKE) -C compat_informix $@
45         $(MAKE) -C thread $@
46
47 clean distclean maintainer-clean:
48         $(MAKE) -C connect $@
49         $(MAKE) -C connect extraclean
50         $(MAKE) -C expected extraclean
51         $(MAKE) -C sql $@
52         $(MAKE) -C pgtypeslib $@
53         $(MAKE) -C preproc $@
54         $(MAKE) -C compat_informix $@
55         $(MAKE) -C thread $@
56         rm -rf tmp_check results log
57         rm -f pg_regress regression.diffs regression.out pg_regress_ecpg.o
58
59 # Build regression test driver
60
61 all: pg_regress$(X)
62
63 pg_regress$(X): pg_regress_ecpg.o
64         $(CC) $(CFLAGS) $^ $(REGRESSDRIVER) $(REGRESSINCLUDES) $(LDFLAGS) $(LIBS) -o $@
65
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 $@ $<
69
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
72
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.
79
80 ifdef VPATH
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))
83
84 all: $(remaining_files_build)
85 $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
86         ln -s $< $@
87 endif
88
89
90 check: all
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
92
93 # the same options, but with --listen-on-tcp
94 checktcp: all
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
96
97 installcheck: all
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