1 #-------------------------------------------------------------------------
4 # Makefile for regress (the regression tests)
6 # Copyright (c) 1994, Regents of the University of California
10 # $Header: /cvsroot/pgsql/src/test/regress/GNUmakefile,v 1.38 2002/07/02 05:43:34 momjian Exp $
12 #-------------------------------------------------------------------------
14 subdir = src/test/regress
15 top_builddir = ../../..
16 include $(top_builddir)/src/Makefile.global
18 contribdir := $(top_builddir)/contrib
20 override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
21 override CFLAGS += $(CFLAGS_SL)
23 override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
30 # Build regression test driver
34 pg_regress: pg_regress.sh GNUmakefile
35 sed -e 's,@bindir@,$(bindir),g' \
36 -e 's,@libdir@,$(libdir),g' \
37 -e 's,@pkglibdir@,$(pkglibdir),g' \
38 -e 's,@datadir@,$(datadir),g' \
39 -e 's/@VERSION@/$(VERSION)/g' \
40 -e 's/@host_tuple@/$(host_tuple)/g' \
41 -e 's,@GMAKE@,$(MAKE),g' \
42 -e 's/@enable_shared@/$(enable_shared)/g' \
43 -e 's/@GCC@/$(GCC)/g' \
48 # Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE 'C'.
50 DLOBJS := regress$(DLSUFFIX)
51 # This is for some platforms
53 DLOBJS += regress$(EXPSUFF)
59 # Build test input and expected files
61 file_list := copy create_function_1 create_function_2 misc constraints
62 input_files := $(foreach file, $(file_list), sql/$(file).sql)
63 output_files := $(foreach file, $(file_list), expected/$(file).out)
65 all: $(input_files) $(output_files)
67 abs_srcdir := $(shell cd $(srcdir) && pwd)
68 abs_builddir := $(shell pwd)
71 sed -e 's,@abs_srcdir@,$(abs_srcdir),g' \
72 -e 's,@abs_builddir@,$(abs_builddir),g' \
73 -e 's/@DLSUFFIX@/$(DLSUFFIX)/g' $< >$@
76 $(input_files): sql/%.sql: input/%.source
79 $(output_files): expected/%.out: output/%.source
82 # When doing a VPATH build, copy over the remaining .sql and .out
83 # files so that the driver script can find them. We have to use an
84 # absolute path for the targets, because otherwise make will try to
85 # locate the missing files using VPATH, and will find them in
86 # $(srcdir), but the point here is that we want to copy them from
87 # $(srcdir) to the build directory.
90 remaining_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) $(srcdir)/resultmap
91 remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src))
93 all: $(remaining_files_build)
94 $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
99 # And finally some extra C modules...
105 $(MAKE) -C $(contribdir)/spi REFINT_VERBOSE=1 refint$(DLSUFFIX) autoinc$(DLSUFFIX)
113 $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE)
116 $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
119 # old interfaces follow...
122 runtest: installcheck
125 $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big
128 $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) numeric_big
135 clean distclean maintainer-clean:
136 # things built by `all' target
137 $(MAKE) -C $(contribdir)/spi clean
138 rm -f $(output_files) $(input_files) $(DLOBJS) regress.o pg_regress
139 # things created by various check targets
140 rm -rf results tmp_check log
141 rm -f regression.diffs regression.out regress.out run_check.out
142 ifeq ($(PORTNAME), win)
146 rm -f $(remaining_files_build)