diff options
author | Paul Gier <pgier@redhat.com> | 2019-01-23 14:44:12 -0600 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2019-01-23 21:44:12 +0100 |
commit | 6a3b92ce57430ce801ffa149b1fa06acf80513f1 (patch) | |
tree | 7942284322de8a60c574fa1ee1dac7aecaffa4f3 | |
parent | 3b5c2f6463d05a0391b278e422e678f1bfb6a439 (diff) | |
download | prometheus_node_collector-6a3b92ce57430ce801ffa149b1fa06acf80513f1.tar.bz2 prometheus_node_collector-6a3b92ce57430ce801ffa149b1fa06acf80513f1.tar.xz prometheus_node_collector-6a3b92ce57430ce801ffa149b1fa06acf80513f1.zip |
cleanup makefile (#1232)
The recent updates to Makefile.common make some of the stuff in
Makefile unnecessary.
Signed-off-by: Paul Gier <pgier@redhat.com>
-rw-r--r-- | Makefile | 29 |
1 files changed, 6 insertions, 23 deletions
@@ -13,10 +13,6 @@ | |||
13 | 13 | ||
14 | include Makefile.common | 14 | include Makefile.common |
15 | 15 | ||
16 | GO ?= GO15VENDOREXPERIMENT=1 go | ||
17 | GOARCH := $(shell $(GO) env GOARCH) | ||
18 | GOHOSTARCH := $(shell $(GO) env GOHOSTARCH) | ||
19 | |||
20 | PROMTOOL_VERSION ?= 2.5.0 | 16 | PROMTOOL_VERSION ?= 2.5.0 |
21 | PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz | 17 | PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz |
22 | PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool | 18 | PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool |
@@ -27,20 +23,7 @@ DOCKERFILE ?= Dockerfile | |||
27 | 23 | ||
28 | STATICCHECK_IGNORE = | 24 | STATICCHECK_IGNORE = |
29 | 25 | ||
30 | ifeq ($(OS),Windows_NT) | 26 | ifeq ($(GOHOSTOS), linux) |
31 | OS_detected := Windows | ||
32 | else | ||
33 | OS_detected := $(shell uname -s) | ||
34 | endif | ||
35 | |||
36 | ifeq ($(GOHOSTARCH),amd64) | ||
37 | ifeq ($(OS_detected),$(filter $(OS_detected),Linux FreeBSD Darwin Windows)) | ||
38 | # Only supported on amd64 | ||
39 | test-flags := -race | ||
40 | endif | ||
41 | endif | ||
42 | |||
43 | ifeq ($(OS_detected), Linux) | ||
44 | test-e2e := test-e2e | 27 | test-e2e := test-e2e |
45 | else | 28 | else |
46 | test-e2e := skip-test-e2e | 29 | test-e2e := skip-test-e2e |
@@ -51,7 +34,7 @@ ifeq ($(GOOS), linux) | |||
51 | PROMU_CONF ?= .promu.yml | 34 | PROMU_CONF ?= .promu.yml |
52 | else | 35 | else |
53 | ifndef GOOS | 36 | ifndef GOOS |
54 | ifeq ($(OS_detected), Linux) | 37 | ifeq ($(GOHOSTOS), Linux) |
55 | PROMU_CONF ?= .promu.yml | 38 | PROMU_CONF ?= .promu.yml |
56 | else | 39 | else |
57 | PROMU_CONF ?= .promu-cgo.yml | 40 | PROMU_CONF ?= .promu-cgo.yml |
@@ -74,8 +57,8 @@ endif | |||
74 | # 64bit -> 32bit mapping for cross-checking. At least for amd64/386, the 64bit CPU can execute 32bit code but not the other way around, so we don't support cross-testing upwards. | 57 | # 64bit -> 32bit mapping for cross-checking. At least for amd64/386, the 64bit CPU can execute 32bit code but not the other way around, so we don't support cross-testing upwards. |
75 | cross-test = skip-test-32bit | 58 | cross-test = skip-test-32bit |
76 | define goarch_pair | 59 | define goarch_pair |
77 | ifeq ($$(OS_detected),Linux) | 60 | ifeq ($$(GOHOSTOS),linux) |
78 | ifeq ($$(GOARCH),$1) | 61 | ifeq ($$(GOHOSTARCH),$1) |
79 | GOARCH_CROSS = $2 | 62 | GOARCH_CROSS = $2 |
80 | cross-test = test-32bit | 63 | cross-test = test-32bit |
81 | endif | 64 | endif |
@@ -101,7 +84,7 @@ test-32bit: collector/fixtures/sys/.unpacked | |||
101 | 84 | ||
102 | .PHONY: skip-test-32bit | 85 | .PHONY: skip-test-32bit |
103 | skip-test-32bit: | 86 | skip-test-32bit: |
104 | @echo ">> SKIP running tests in 32-bit mode: not supported on $(OS_detected)/$(GOARCH)" | 87 | @echo ">> SKIP running tests in 32-bit mode: not supported on $(GOHOSTOS)/$(GOHOSTARCH)" |
105 | 88 | ||
106 | collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar | 89 | collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar |
107 | @echo ">> extracting sysfs fixtures" | 90 | @echo ">> extracting sysfs fixtures" |
@@ -116,7 +99,7 @@ test-e2e: build collector/fixtures/sys/.unpacked | |||
116 | 99 | ||
117 | .PHONY: skip-test-e2e | 100 | .PHONY: skip-test-e2e |
118 | skip-test-e2e: | 101 | skip-test-e2e: |
119 | @echo ">> SKIP running end-to-end tests on $(OS_detected)" | 102 | @echo ">> SKIP running end-to-end tests on $(GOHOSTOS)" |
120 | 103 | ||
121 | .PHONY: checkmetrics | 104 | .PHONY: checkmetrics |
122 | checkmetrics: $(PROMTOOL) | 105 | checkmetrics: $(PROMTOOL) |