-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile.vars
51 lines (40 loc) · 1.38 KB
/
Makefile.vars
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
43
44
45
46
47
48
49
50
51
# Variables required for this Makefile
ROOT_DIR = $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
VERSION = $(shell git describe --tags | cut -c 2-)
GO_ENV_VARS =
PKG_FILENAME = aerospike-prometheus-exporter
FIPS_PKG_FILENAME = aerospike-prometheus-exporter-federal
CENTOS_8 = $(shell cat /etc/*-release | grep "PRETTY_NAME" | sed 's/PRETTY_NAME=//g' | grep -i "CentOS" | grep -i "Linux 8")
RHEL_8 = $(shell cat /etc/*-release | grep "PRETTY_NAME" | sed 's/PRETTY_NAME=//g' | grep -i "Red Hat" | grep -i "Linux 8")
# FIPS required evaluations
GO_VERSION = $(shell go version)
GO_FIPS =
APE_SUPPORTED_OS = invalid-os
ifeq ( , $(findstring go1.20,$(GO_VERSION) go_not_20 ))
GO_BORINGCRYPTO=
# check if OS is CentOS 8 or RHEL 8
ifeq ($(CENTOS_8),)
ifneq ($(RHEL_8),)
APE_SUPPORTED_OS = validfipsos
else
APE_SUPPORTED_OS = not-validfipsos
endif
else
APE_SUPPORTED_OS = validfipsos
endif
# end OS check
else
# If Go version is >=1.20 we auto-support FIPS build
APE_SUPPORTED_OS = validfipsos
GO_BORINGCRYPTO=boringcrypto
endif
# end FIPS required evaluations
# Variables related to go build
ifdef GOOS
GO_ENV_VARS = GOOS=$(GOOS)
endif
ifdef GOARCH
GO_ENV_VARS += GOARCH=$(GOARCH)
endif
GO_ENV_VARS += CGO_ENABLED=0
DOCKER_MULTI_ARCH_PLATFORMS = linux/amd64,linux/arm64