aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPaul Gier <pgier@redhat.com>2019-01-23 14:44:12 -0600
committerBen Kochie <superq@gmail.com>2019-01-23 21:44:12 +0100
commit6a3b92ce57430ce801ffa149b1fa06acf80513f1 (patch)
tree7942284322de8a60c574fa1ee1dac7aecaffa4f3 /Makefile
parent3b5c2f6463d05a0391b278e422e678f1bfb6a439 (diff)
downloadprometheus_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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 6 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 25eafaf..918fdff 100644
--- a/Makefile
+++ b/Makefile
@@ -13,10 +13,6 @@
13 13
14include Makefile.common 14include Makefile.common
15 15
16GO ?= GO15VENDOREXPERIMENT=1 go
17GOARCH := $(shell $(GO) env GOARCH)
18GOHOSTARCH := $(shell $(GO) env GOHOSTARCH)
19
20PROMTOOL_VERSION ?= 2.5.0 16PROMTOOL_VERSION ?= 2.5.0
21PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz 17PROMTOOL_URL ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
22PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool 18PROMTOOL ?= $(FIRST_GOPATH)/bin/promtool
@@ -27,20 +23,7 @@ DOCKERFILE ?= Dockerfile
27 23
28STATICCHECK_IGNORE = 24STATICCHECK_IGNORE =
29 25
30ifeq ($(OS),Windows_NT) 26ifeq ($(GOHOSTOS), linux)
31 OS_detected := Windows
32else
33 OS_detected := $(shell uname -s)
34endif
35
36ifeq ($(GOHOSTARCH),amd64)
37 ifeq ($(OS_detected),$(filter $(OS_detected),Linux FreeBSD Darwin Windows))
38 # Only supported on amd64
39 test-flags := -race
40 endif
41endif
42
43ifeq ($(OS_detected), Linux)
44 test-e2e := test-e2e 27 test-e2e := test-e2e
45else 28else
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
52else 35else
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.
75cross-test = skip-test-32bit 58cross-test = skip-test-32bit
76define goarch_pair 59define 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
103skip-test-32bit: 86skip-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
106collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar 89collector/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
118skip-test-e2e: 101skip-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
122checkmetrics: $(PROMTOOL) 105checkmetrics: $(PROMTOOL)