From 9d5d7ffc1eaa0e2d8a8d5bcd62118fead34cb6d0 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 17 Apr 2021 09:43:27 +0200 Subject: [PATCH] Makefile: set -race via GOFLAGS= variable --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 152ec8a..f4cc011 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ LDFLAGS = '\ -X "main.versionGit=$(shell git describe --long --tags --dirty --always)" \ -X "main.versionGo=$(shell go version)" \ ' +# Build with `make GOFLAGS=` if -race is not supported +GOFLAGS=-race all: safcm @@ -9,13 +11,13 @@ all: safcm safcm: go fmt ./... cd cmd/safcm-remote && ./build.sh - go build -ldflags $(LDFLAGS) -race ruderich.org/simon/safcm/cmd/safcm + go build $(GOFLAGS) -ldflags $(LDFLAGS) ruderich.org/simon/safcm/cmd/safcm @# For proper permissions after initial clone with a strict umask cd cmd/safcm/testdata/project && ../../../../safcm fixperms 2> /dev/null test: go vet ./... - go test -race ./... + go test $(GOFLAGS) ./... clean: rm -rf remote/helpers/ -- 2.43.2