From c7dfb82dac2d599d9eb3012b55a067a89f37f5c7 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Tue, 25 Sep 2018 16:02:42 +0200 Subject: 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 --- Makefile | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6cd5e0f..835a407 100644 --- a/Makefile +++ b/Makefile @@ -26,24 +26,41 @@ DOCKERFILE ?= Dockerfile STATICCHECK_IGNORE = ifeq ($(OS),Windows_NT) - OS_detected := Windows + OS_detected := Windows else - OS_detected := $(shell uname -s) + 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 + # Only supported on amd64 + test-flags := -race + endif endif ifeq ($(OS_detected), Linux) - test-e2e := test-e2e + test-e2e := test-e2e else - test-e2e := skip-test-e2e + test-e2e := skip-test-e2e endif +# Use CGO for non-Linux builds. +ifeq ($(GOOS), linux) + PROMU_CONF ?= .promu-no-cgo.yml +else + ifndef GOOS + ifeq ($(OS_detected), Linux) + PROMU_CONF ?= .promu-no-cgo.yml + else + PROMU_CONF ?= .promu-cgo.yml + endif + else + PROMU_CONF ?= .promu-cgo.yml + endif +endif + +PROMU := $(FIRST_GOPATH)/bin/promu --config $(PROMU_CONF) + e2e-out = collector/fixtures/e2e-output.txt ifeq ($(MACH), ppc64le) e2e-out = collector/fixtures/e2e-64k-page-output.txt -- cgit v1.2.3