6
6
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7
7
# Portions Copyright (c) 1994, Regents of the University of California
8
8
#
9
- # $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.74 2008/05/30 00:04:32 tgl Exp $
9
+ # $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.75 2008/10/01 22:38:57 petere Exp $
10
10
#
11
11
# -------------------------------------------------------------------------
12
12
@@ -65,9 +65,12 @@ pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
65
65
$(top_builddir ) /src/port/pg_config_paths.h : $(top_builddir ) /src/Makefile.global
66
66
$(MAKE ) -C $(top_builddir ) /src/port pg_config_paths.h
67
67
68
- install : pg_regress $( X )
68
+ install : all installdirs
69
69
$(INSTALL_PROGRAM ) pg_regress$(X ) ' $(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
70
70
71
+ installdirs :
72
+ $(mkinstalldirs ) ' $(DESTDIR)$(pgxsdir)/$(subdir)'
73
+
71
74
uninstall :
72
75
rm -f ' $(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
73
76
@@ -83,34 +86,28 @@ all: all-lib
83
86
84
87
# Test input and expected files. These are created by pg_regress itself, so we
85
88
# don't have a rule to create them. We do need rules to clean them however.
86
- ifile_list := $(subst .source,, $(notdir $(wildcard $(top_srcdir ) /$(subdir ) /input/* .source) ) )
87
- input_files := $(foreach file, $(ifile_list ) , sql/$(file ) .sql)
88
- ofile_list := $(subst .source,, $(notdir $(wildcard $(top_srcdir ) /$(subdir ) /output/* .source) ) )
89
- output_files := $(foreach file, $(ofile_list ) , expected/$(file ) .out)
90
-
91
- ifneq ($(PORTNAME ) ,win32)
92
- abs_srcdir := $(shell cd $(srcdir ) && pwd)
93
- abs_builddir := $(shell pwd)
94
- else
95
- abs_srcdir := $(shell cd $(srcdir ) && pwd -W)
96
- abs_builddir := $(shell pwd -W)
97
- endif
89
+ input_files = $(patsubst $(srcdir ) /input/% .source,sql/% .sql, $(wildcard $(srcdir ) /input/* .source) )
90
+ output_files := $(patsubst $(srcdir ) /output/% .source,expected/% .out, $(wildcard $(srcdir ) /output/* .source) )
98
91
99
- # When doing a VPATH build, copy over the remaining .sql and .out
100
- # files so that the driver script can find them. We have to use an
101
- # absolute path for the targets, because otherwise make will try to
102
- # locate the missing files using VPATH, and will find them in
103
- # $(srcdir), but the point here is that we want to copy them from
104
- # $(srcdir) to the build directory.
105
92
106
- ifdef VPATH
107
- remaining_files_src := $(wildcard $(srcdir ) /sql/* .sql) $(wildcard $(srcdir ) /expected/* .out) $(srcdir ) /resultmap
108
- remaining_files_build := $(patsubst $(srcdir ) /% , $(abs_builddir ) /% , $(remaining_files_src ) )
93
+ # not installed by default
109
94
110
- all : $(remaining_files_build )
111
- $(remaining_files_build ) : $(abs_builddir ) /% : $(srcdir ) /%
112
- ln -s $< $@
113
- endif
95
+ regress_data_files = \
96
+ $(filter-out $(addprefix $(srcdir ) /,$(output_files ) ) ,$(wildcard $(srcdir ) /expected/* .out) ) \
97
+ $(wildcard $(srcdir ) /input/* .source) \
98
+ $(wildcard $(srcdir ) /output/* .source) \
99
+ $(filter-out $(addprefix $(srcdir ) /,$(input_files ) ) ,$(wildcard $(srcdir ) /sql/* .sql) ) \
100
+ $(wildcard $(srcdir ) /data/* .data) \
101
+ $(srcdir ) /parallel_schedule $(srcdir ) /serial_schedule $(srcdir ) /resultmap
102
+
103
+ install-tests : all install install-lib installdirs-tests
104
+ $(MAKE ) -C $(top_builddir ) /contrib/spi install
105
+ for file in $( regress_data_files) ; do \
106
+ $(INSTALL_DATA ) $$ file ' $(DESTDIR)$(pkglibdir)/regress/' $$ file; \
107
+ done
108
+
109
+ installdirs-tests : installdirs
110
+ $(mkinstalldirs ) $(patsubst $(srcdir ) /% /,'$(DESTDIR )$(pkglibdir ) /regress/% ',$(sort $(dir $(regress_data_files ) ) ) )
114
111
115
112
116
113
# Get some extra C modules from contrib/spi...
@@ -144,14 +141,16 @@ tablespace-setup:
144
141
# # Run tests
145
142
# #
146
143
144
+ pg_regress_call = ./pg_regress --inputdir=$(srcdir ) --dlpath=. --multibyte=$(MULTIBYTE ) --load-language=plpgsql $(NOLOCALE )
145
+
147
146
check : all
148
- ./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 ) $(TEMP_CONF )
147
+ $( pg_regress_call ) --temp-install=./tmp_check --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --schedule=$(srcdir ) /parallel_schedule $( MAXCONNOPT ) $(TEMP_CONF )
149
148
150
149
installcheck : all
151
- ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule --srcdir= $( abs_srcdir ) --multibyte= $( MULTIBYTE ) --load-language=plpgsql $( NOLOCALE )
150
+ $( pg_regress_call ) --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule
152
151
153
152
installcheck-parallel : all
154
- ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /parallel_schedule --srcdir= $( abs_srcdir ) --multibyte= $( MULTIBYTE ) --load-language=plpgsql $( MAXCONNOPT ) $( NOLOCALE )
153
+ $( pg_regress_call ) --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /parallel_schedule $( MAXCONNOPT )
155
154
156
155
157
156
# old interfaces follow...
@@ -161,10 +160,10 @@ runtest: installcheck
161
160
runtest-parallel : installcheck-parallel
162
161
163
162
bigtest : all
164
- ./pg_regress --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule --srcdir= $( abs_srcdir ) --multibyte= $( MULTIBYTE ) --load-language=plpgsql $( NOLOCALE ) numeric_big
163
+ $( pg_regress_call ) --psqldir=$(PSQLDIR ) --schedule=$(srcdir ) /serial_schedule numeric_big
165
164
166
165
bigcheck : all
167
- ./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
166
+ $( pg_regress_call ) --temp-install=./tmp_check --top-builddir=$(top_builddir ) --temp-port=$(TEMP_PORT ) --schedule=$(srcdir ) /parallel_schedule $( MAXCONNOPT ) numeric_big
168
167
169
168
170
169
# #
@@ -173,15 +172,9 @@ bigcheck: all
173
172
174
173
clean distclean maintainer-clean : clean-lib
175
174
# things built by `all' target
176
- rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX)
177
- rm -f $(output_files) $(input_files) pg_regress_main.o pg_regress.o pg_regress$(X)
175
+ rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX) pg_regress_main.o pg_regress.o pg_regress$(X)
178
176
# things created by various check targets
177
+ rm -f $(output_files) $(input_files)
179
178
rm -rf testtablespace
180
179
rm -rf results tmp_check log
181
180
rm -f regression.diffs regression.out regress.out run_check.out
182
- ifeq ($(PORTNAME ) , cygwin)
183
- rm -f regress.def
184
- endif
185
- ifdef VPATH
186
- rm -f $(remaining_files_build)
187
- endif
0 commit comments