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>
This commit is contained in:
Ben Kochie 2018-09-25 16:02:42 +02:00 committed by GitHub
commit c7dfb82dac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 18 deletions

View file

@ -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