-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathMakefile.common
More file actions
42 lines (38 loc) · 895 Bytes
/
Makefile.common
File metadata and controls
42 lines (38 loc) · 895 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
41
42
PG_CONFIG ?= pg_config
VERSION ?= 6.1
RELEASE ?= 0
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
#
# Shell commands
#
CXX ?= g++
PG_CONFIG ?= pg_config
PKGCONF ?= $(shell which pkgconf 2>/dev/null || which pkg-config 2>/dev/null)