-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcommon.mk
More file actions
29 lines (24 loc) · 770 Bytes
/
common.mk
File metadata and controls
29 lines (24 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Supported PostgreSQL versions:
PG_VERSIONS = 14 15 16 17 18
EXTENSION = pg_tracing
PG_CONFIG = pg_config
# Get postgres version
PG_CONFIG_EXISTS := $(shell command -v $(PG_CONFIG) 2> /dev/null)
ifdef PG_CONFIG_EXISTS
# Default to pg_config's advertised version
PG_VERSION ?= $(shell $(PG_CONFIG) --version | sed 's/PostgreSQL \([0-9]*\).*/\1/g')
else
# pg_config is not present, let's assume we are packaging and use the latest PG version
PG_VERSION ?= $(lastword $(PG_VERSIONS))
endif
ifeq ($(EXT_VERSION),)
# Get extension version
GIT_EXISTS := $(shell command -v git 2> /dev/null)
ifdef GIT_EXISTS
EXT_VERSION = $(shell git describe --tags | sed 's/^v//')
else
EXT_VERSION = "0.1.0"
endif
endif
TMP_DIR=$(PWD)/tmp
EXTRA_CLEAN = META.json $(TMP_DIR)