Makefile: Add support for PARALLEL categories

This commit is contained in:
Raul Marin 2017-10-31 14:48:48 +01:00 committed by Raúl Marín
parent d651a401d7
commit ddd2b4e3bf
2 changed files with 10 additions and 0 deletions

View File

@ -6,3 +6,6 @@ RELEASE_VERSION ?= $(EXTVERSION)
SED = sed SED = sed
PIP = pip PIP = pip
NOSETESTS = nosetests NOSETESTS = nosetests
AWK = awk
PG_CONFIG = pg_config
PG_PARALLEL := $(shell $(PG_CONFIG) --version | ($(AWK) '{$$2*=1000; if ($$2 >= 9600) print 1; else print 0;}' 2> /dev/null || echo 0))

View File

@ -23,6 +23,13 @@ REPLACEMENTS = -e 's/@@VERSION@@/$(EXTVERSION)/g'
$(DATA): $(SOURCES_DATA) $(DATA): $(SOURCES_DATA)
$(SED) $(REPLACEMENTS) $(SOURCES_DATA_DIR)/*.sql > $@ $(SED) $(REPLACEMENTS) $(SOURCES_DATA_DIR)/*.sql > $@
ifeq ($(PG_PARALLEL), 0)
# Remove PARALLEL in aggregates and functions
$(eval TMPFILE := $(shell mktemp /tmp/$(basename $0).XXXXXXXX))
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' \
-e 's/PARALLEL [A-Z]*/''/g' $@ > $(TMPFILE)
mv $(TMPFILE) $@
endif
TEST_DIR = test TEST_DIR = test
REGRESS = $(sort $(notdir $(basename $(wildcard $(TEST_DIR)/sql/*test.sql)))) REGRESS = $(sort $(notdir $(basename $(wildcard $(TEST_DIR)/sql/*test.sql))))