mirror of
				https://github.com/prometheus/node_exporter.git
				synced 2025-08-20 18:33:52 -07:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									3b5c2f6463
								
							
						
					
					
						commit
						6a3b92ce57
					
				
							
								
								
									
										29
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								Makefile
									
									
									
									
									
								
							| 
						 | 
					@ -13,10 +13,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include Makefile.common
 | 
					include Makefile.common
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GO     ?= GO15VENDOREXPERIMENT=1 go
 | 
					 | 
				
			||||||
GOARCH := $(shell $(GO) env GOARCH)
 | 
					 | 
				
			||||||
GOHOSTARCH := $(shell $(GO) env GOHOSTARCH)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
PROMTOOL_VERSION ?= 2.5.0
 | 
					PROMTOOL_VERSION ?= 2.5.0
 | 
				
			||||||
PROMTOOL_URL     ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
 | 
					PROMTOOL_URL     ?= https://github.com/prometheus/prometheus/releases/download/v$(PROMTOOL_VERSION)/prometheus-$(PROMTOOL_VERSION).$(GO_BUILD_PLATFORM).tar.gz
 | 
				
			||||||
PROMTOOL         ?= $(FIRST_GOPATH)/bin/promtool
 | 
					PROMTOOL         ?= $(FIRST_GOPATH)/bin/promtool
 | 
				
			||||||
| 
						 | 
					@ -27,20 +23,7 @@ DOCKERFILE              ?= Dockerfile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
STATICCHECK_IGNORE =
 | 
					STATICCHECK_IGNORE =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(OS),Windows_NT)
 | 
					ifeq ($(GOHOSTOS), linux)
 | 
				
			||||||
	OS_detected := Windows
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	OS_detected := $(shell uname -s)
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ifeq ($(GOHOSTARCH),amd64)
 | 
					 | 
				
			||||||
	ifeq ($(OS_detected),$(filter $(OS_detected),Linux FreeBSD Darwin Windows))
 | 
					 | 
				
			||||||
		# Only supported on amd64
 | 
					 | 
				
			||||||
		test-flags := -race
 | 
					 | 
				
			||||||
	endif
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ifeq ($(OS_detected), Linux)
 | 
					 | 
				
			||||||
	test-e2e := test-e2e
 | 
						test-e2e := test-e2e
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	test-e2e := skip-test-e2e
 | 
						test-e2e := skip-test-e2e
 | 
				
			||||||
| 
						 | 
					@ -51,7 +34,7 @@ ifeq ($(GOOS), linux)
 | 
				
			||||||
	PROMU_CONF ?= .promu.yml
 | 
						PROMU_CONF ?= .promu.yml
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	ifndef GOOS
 | 
						ifndef GOOS
 | 
				
			||||||
		ifeq ($(OS_detected), Linux)
 | 
							ifeq ($(GOHOSTOS), Linux)
 | 
				
			||||||
			PROMU_CONF ?= .promu.yml
 | 
								PROMU_CONF ?= .promu.yml
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			PROMU_CONF ?= .promu-cgo.yml
 | 
								PROMU_CONF ?= .promu-cgo.yml
 | 
				
			||||||
| 
						 | 
					@ -74,8 +57,8 @@ endif
 | 
				
			||||||
# 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.
 | 
					# 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.
 | 
				
			||||||
cross-test = skip-test-32bit
 | 
					cross-test = skip-test-32bit
 | 
				
			||||||
define goarch_pair
 | 
					define goarch_pair
 | 
				
			||||||
	ifeq ($$(OS_detected),Linux)
 | 
						ifeq ($$(GOHOSTOS),linux)
 | 
				
			||||||
		ifeq ($$(GOARCH),$1)
 | 
							ifeq ($$(GOHOSTARCH),$1)
 | 
				
			||||||
			GOARCH_CROSS = $2
 | 
								GOARCH_CROSS = $2
 | 
				
			||||||
			cross-test = test-32bit
 | 
								cross-test = test-32bit
 | 
				
			||||||
		endif
 | 
							endif
 | 
				
			||||||
| 
						 | 
					@ -101,7 +84,7 @@ test-32bit: collector/fixtures/sys/.unpacked
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: skip-test-32bit
 | 
					.PHONY: skip-test-32bit
 | 
				
			||||||
skip-test-32bit:
 | 
					skip-test-32bit:
 | 
				
			||||||
	@echo ">> SKIP running tests in 32-bit mode: not supported on $(OS_detected)/$(GOARCH)"
 | 
						@echo ">> SKIP running tests in 32-bit mode: not supported on $(GOHOSTOS)/$(GOHOSTARCH)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar
 | 
					collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar
 | 
				
			||||||
	@echo ">> extracting sysfs fixtures"
 | 
						@echo ">> extracting sysfs fixtures"
 | 
				
			||||||
| 
						 | 
					@ -116,7 +99,7 @@ test-e2e: build collector/fixtures/sys/.unpacked
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: skip-test-e2e
 | 
					.PHONY: skip-test-e2e
 | 
				
			||||||
skip-test-e2e:
 | 
					skip-test-e2e:
 | 
				
			||||||
	@echo ">> SKIP running end-to-end tests on $(OS_detected)"
 | 
						@echo ">> SKIP running end-to-end tests on $(GOHOSTOS)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: checkmetrics
 | 
					.PHONY: checkmetrics
 | 
				
			||||||
checkmetrics: $(PROMTOOL)
 | 
					checkmetrics: $(PROMTOOL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue