2016-03-16 22:40:40 +08:00
|
|
|
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
2016-03-29 20:53:51 +08:00
|
|
|
EXTENSION = crankshaft
|
|
|
|
PACKAGE = crankshaft
|
|
|
|
EXTVERSION = $(shell grep default_version $(SELF_DIR)/src/pg/$(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
|
|
|
|
RELEASE_VERSION ?= $(EXTVERSION)
|
2019-12-19 22:22:44 +08:00
|
|
|
|
2016-03-29 20:53:51 +08:00
|
|
|
SED = sed
|
2017-10-31 21:48:48 +08:00
|
|
|
AWK = awk
|
2019-12-19 22:22:44 +08:00
|
|
|
|
2017-10-31 21:48:48 +08:00
|
|
|
PG_CONFIG = pg_config
|
2019-12-19 22:22:44 +08:00
|
|
|
PG_VERSION_1000 := $(shell $(PG_CONFIG) --version | $(AWK) '{$$2*=1000; print $$2}')
|
|
|
|
PG_PARALLEL := $(shell [ $(PG_VERSION_1000) -ge 9600 ] && echo true)
|
|
|
|
|
|
|
|
PG_12plus := $(shell [ $(PG_VERSION_1000) -ge 12000 ] && echo true)
|
|
|
|
PYTHON3 ?= $(PG_12plus)
|
|
|
|
|
|
|
|
ifeq ($(PYTHON3), true)
|
|
|
|
PIP := python3 -m pip
|
2019-12-19 23:58:35 +08:00
|
|
|
NOSETESTS = nosetests3
|
2019-12-19 22:22:44 +08:00
|
|
|
else
|
|
|
|
PIP := python2 -m pip
|
2019-12-19 23:58:35 +08:00
|
|
|
NOSETESTS = nosetests
|
2019-12-19 22:22:44 +08:00
|
|
|
endif
|