forked from heterodb/pg-strom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.common
More file actions
40 lines (36 loc) · 821 Bytes
/
Makefile.common
File metadata and controls
40 lines (36 loc) · 821 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
30
31
32
33
34
35
36
37
38
39
40
PG_CONFIG ?= pg_config
VERSION ?= 6.0
RELEASE ?= 2
GITHASH_IF_NOT_GIVEN := HEAD
#
# PostgreSQL major version
#
PG_MAJORVERSION := $(shell $(PG_CONFIG) --version | sed 's/\./ /g' | awk '{print $$2}')
PG_MINORVERSION := $(shell $(PG_CONFIG) --version | sed 's/\./ /g' | awk '{print $$3}')
#
# PG-Strom version signature
#
ifeq ($(shell echo $(RELEASE) | grep -E '^[0-9]+'),)
PGSTROM_VERSION := $(VERSION)$(RELEASE)
else
PGSTROM_VERSION := $(VERSION).$(RELEASE)
endif
#
# GitHash to build
#
ifeq ($(GITHASH),)
GITHASH := $(shell git rev-parse HEAD 2>/dev/null)
ifeq ($(GITHASH),)
GITHASH := $(GITHASH_IF_NOT_GIVEN)
else
ifeq ($(shell git diff | wc -l),0)
PGSTROM_GITHASH := $(GITHASH)
else
PGSTROM_GITHASH := $(GITHASH)::local_changes
endif
endif
endif
#
# PostgreSQL Commands
#
PSQL=$(shell $(PG_CONFIG) --bindir)/psql