diff options
author | Ben Kochie <superq@gmail.com> | 2018-09-25 16:02:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-25 16:02:42 +0200 |
commit | c7dfb82dac2d599d9eb3012b55a067a89f37f5c7 (patch) | |
tree | 80b758bc183c0192da24c8a04e0692a4b8b82aa1 /Makefile | |
parent | 0fdc089187c3d5d9fe62e528653986ee6e71325b (diff) | |
download | prometheus_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-- | Makefile | 31 |
1 files changed, 24 insertions, 7 deletions
@@ -26,24 +26,41 @@ DOCKERFILE ?= Dockerfile | |||
26 | STATICCHECK_IGNORE = | 26 | STATICCHECK_IGNORE = |
27 | 27 | ||
28 | ifeq ($(OS),Windows_NT) | 28 | ifeq ($(OS),Windows_NT) |
29 | OS_detected := Windows | 29 | OS_detected := Windows |
30 | else | 30 | else |
31 | OS_detected := $(shell uname -s) | 31 | OS_detected := $(shell uname -s) |
32 | endif | 32 | endif |
33 | 33 | ||
34 | ifeq ($(GOHOSTARCH),amd64) | 34 | ifeq ($(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 |
39 | endif | 39 | endif |
40 | 40 | ||
41 | ifeq ($(OS_detected), Linux) | 41 | ifeq ($(OS_detected), Linux) |
42 | test-e2e := test-e2e | 42 | test-e2e := test-e2e |
43 | else | 43 | else |
44 | test-e2e := skip-test-e2e | 44 | test-e2e := skip-test-e2e |
45 | endif | 45 | endif |
46 | 46 | ||
47 | # Use CGO for non-Linux builds. | ||
48 | ifeq ($(GOOS), linux) | ||
49 | PROMU_CONF ?= .promu-no-cgo.yml | ||
50 | else | ||
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 | ||
60 | endif | ||
61 | |||
62 | PROMU := $(FIRST_GOPATH)/bin/promu --config $(PROMU_CONF) | ||
63 | |||
47 | e2e-out = collector/fixtures/e2e-output.txt | 64 | e2e-out = collector/fixtures/e2e-output.txt |
48 | ifeq ($(MACH), ppc64le) | 65 | ifeq ($(MACH), ppc64le) |
49 | e2e-out = collector/fixtures/e2e-64k-page-output.txt | 66 | e2e-out = collector/fixtures/e2e-64k-page-output.txt |