aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBen Kochie <superq@gmail.com>2018-09-25 16:02:42 +0200
committerGitHub <noreply@github.com>2018-09-25 16:02:42 +0200
commitc7dfb82dac2d599d9eb3012b55a067a89f37f5c7 (patch)
tree80b758bc183c0192da24c8a04e0692a4b8b82aa1 /Makefile
parent0fdc089187c3d5d9fe62e528653986ee6e71325b (diff)
downloadprometheus_node_collector-c7dfb82dac2d599d9eb3012b55a067a89f37f5c7.tar.bz2
prometheus_node_collector-c7dfb82dac2d599d9eb3012b55a067a89f37f5c7.tar.xz
prometheus_node_collector-c7dfb82dac2d599d9eb3012b55a067a89f37f5c7.zip
Update build (#1081)
* Update build * Only use CGO when building non-Linux. * Update build to Go 1.11 * Use tab indenting consistently. Signed-off-by: Ben Kochie <superq@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 24 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6cd5e0f..835a407 100644
--- a/Makefile
+++ b/Makefile
@@ -26,24 +26,41 @@ DOCKERFILE ?= Dockerfile
26STATICCHECK_IGNORE = 26STATICCHECK_IGNORE =
27 27
28ifeq ($(OS),Windows_NT) 28ifeq ($(OS),Windows_NT)
29 OS_detected := Windows 29 OS_detected := Windows
30else 30else
31 OS_detected := $(shell uname -s) 31 OS_detected := $(shell uname -s)
32endif 32endif
33 33
34ifeq ($(GOHOSTARCH),amd64) 34ifeq ($(GOHOSTARCH),amd64)
35 ifeq ($(OS_detected),$(filter $(OS_detected),Linux FreeBSD Darwin Windows)) 35 ifeq ($(OS_detected),$(filter $(OS_detected),Linux FreeBSD Darwin Windows))
36 # Only supported on amd64 36 # Only supported on amd64
37 test-flags := -race 37 test-flags := -race
38 endif 38 endif
39endif 39endif
40 40
41ifeq ($(OS_detected), Linux) 41ifeq ($(OS_detected), Linux)
42 test-e2e := test-e2e 42 test-e2e := test-e2e
43else 43else
44 test-e2e := skip-test-e2e 44 test-e2e := skip-test-e2e
45endif 45endif
46 46
47# Use CGO for non-Linux builds.
48ifeq ($(GOOS), linux)
49 PROMU_CONF ?= .promu-no-cgo.yml
50else
51 ifndef GOOS
52 ifeq ($(OS_detected), Linux)
53 PROMU_CONF ?= .promu-no-cgo.yml
54 else
55 PROMU_CONF ?= .promu-cgo.yml
56 endif
57 else
58 PROMU_CONF ?= .promu-cgo.yml
59 endif
60endif
61
62PROMU := $(FIRST_GOPATH)/bin/promu --config $(PROMU_CONF)
63
47e2e-out = collector/fixtures/e2e-output.txt 64e2e-out = collector/fixtures/e2e-output.txt
48ifeq ($(MACH), ppc64le) 65ifeq ($(MACH), ppc64le)
49 e2e-out = collector/fixtures/e2e-64k-page-output.txt 66 e2e-out = collector/fixtures/e2e-64k-page-output.txt