Skip to content

Commit 4ca0ac0

Browse files
author
Ekaterina Sokolova
committed
Beautify Makefile in terms of supporting old versions
1 parent b959fba commit 4ca0ac0

File tree

1 file changed

+30
-33
lines changed

1 file changed

+30
-33
lines changed

Makefile

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ RELATIVE_INCLUDES = $(addprefix src/, $(INCLUDES))
2121

2222
LDFLAGS_SL += $(filter -lm, $(LIBS))
2323

24-
REGRESS = security rum rum_validate rum_hash ruminv timestamp orderby orderby_hash \
25-
altorder altorder_hash limits \
24+
REGRESS = security rum rum_validate rum_hash ruminv timestamp \
25+
orderby orderby_hash altorder altorder_hash limits \
2626
int2 int4 int8 float4 float8 money oid \
2727
time timetz date interval \
2828
macaddr inet cidr text varchar char bytea bit varbit \
29-
numeric rum_weight expr
29+
numeric rum_weight expr array
3030

3131
TAP_TESTS = 1
3232

@@ -48,25 +48,35 @@ endif
4848
$(EXTENSION)--$(EXTVERSION).sql: rum_init.sql
4949
cat $^ > $@
5050

51-
ifeq ($(MAJORVERSION), 9.6)
52-
# arrays are not supported on 9.6
53-
else
54-
REGRESS += array
51+
#
52+
# On versions 12 and 13 isolation tests cannot be run using pgxs.
53+
# Override installcheck target to avoid the error. This is just a
54+
# shortcut version of installcheck target from pgxs.mk that runs
55+
# all other tests besides isolation tests.
56+
#
57+
ifdef USE_PGXS
58+
ifeq ($(MAJORVERSION), $(filter 12% 13%, $(MAJORVERSION)))
59+
installcheck: submake $(REGRESS_PREP)
60+
ifdef REGRESS
61+
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
62+
endif
63+
ifdef TAP_TESTS
64+
$(prove_installcheck)
65+
endif
66+
endif
5567
endif
5668

57-
# For 9.6-11 we have to make specific target with tap tests
69+
# --------------------------------------------------------
70+
# Make conditional targets to save backward compatibility
71+
# with PG11, PG10 and PG9.6.
72+
# --------------------------------------------------------
5873
ifeq ($(MAJORVERSION), $(filter 9.6% 10% 11%, $(MAJORVERSION)))
59-
wal-check: temp-install
60-
$(prove_check)
6174

62-
check: wal-check
75+
# arrays are not supported on 9.6
76+
ifeq ($(MAJORVERSION), 9.6)
77+
REGRESS := $(filter-out array, $(REGRESS))
6378
endif
6479

65-
#
66-
# Make conditional targets to save backward compatibility with PG11, PG10 and PG9.6.
67-
#
68-
ifeq ($(MAJORVERSION), $(filter 9.6% 10% 11%, $(MAJORVERSION)))
69-
7080
install: installincludes
7181

7282
installincludes:
@@ -90,22 +100,9 @@ isolationcheck: | submake-isolation submake-rum temp-install
90100
$(pg_isolation_regress_check) \
91101
--temp-config $(top_srcdir)/contrib/rum/logical.conf \
92102
$(ISOLATIONCHECKS)
93-
endif
94103

95-
#
96-
# On versions 12 and 13 isolation tests cannot be run using pgxs.
97-
# Override installcheck target to avoid the error. This is just a stripped down
98-
# version of installcheck target from pgxs.mk that runs all other tests besides
99-
# isolation tests.
100-
#
101-
ifdef USE_PGXS
102-
ifeq ($(MAJORVERSION), $(filter 12% 13%, $(MAJORVERSION)))
103-
installcheck: submake $(REGRESS_PREP)
104-
ifdef REGRESS
105-
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
106-
endif
107-
ifdef TAP_TESTS
108-
$(prove_installcheck)
109-
endif
110-
endif
104+
# For 9.6-11 we have to make specific target with tap tests
105+
check: temp-install
106+
$(prove_check)
107+
111108
endif

0 commit comments

Comments
 (0)