Skip to content

Commit d61f340

Browse files
committed
Makefile: fix Makefile
1 parent e56f01c commit d61f340

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ GO_PKGS := $(shell go list ./... | grep -v -e '.pb.go')
1919
GO_TEST_PKGS := $(shell go list -f='{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./...)
2020

2121
export GOTESTSUM_FORMAT=pkgname-and-test-fails
22-
GO_TEST ?= ${TOOLS_BIN}/gotestsum --
22+
GO_TEST ?= ${TOOLS_BIN}/gotestsum --format=standard-verbose --
2323
GO_TEST_FUNC ?= .
2424
GO_TEST_FLAGS ?=
2525
GO_BENCH_FUNC ?= .
2626
GO_BENCH_FLAGS ?= -benchmem
2727
GO_LINT_FLAGS ?=
2828

2929
CGO_ENABLED ?= 0
30-
GO_BUILDTAGS=osusergo netgo static static_build
30+
GO_BUILDTAGS=osusergo netgo static
3131
GO_LDFLAGS=-s -w "-extldflags=-static"
3232
GO_FLAGS ?= -tags='$(subst $(space),$(comma),${GO_BUILDTAGS})' -ldflags='${GO_LDFLAGS}' -installsuffix=netgo
33+
GO_FLAGS_TOOLS ?= -tags='$(subst $(space),$(comma),${GO_BUILDTAGS})' -ldflags='-s -w' -installsuffix=netgo
3334

3435
# ----------------------------------------------------------------------------
3536
# defines
@@ -50,17 +51,18 @@ tools: ${TOOLS_BIN} ## Install tools
5051
${TOOLS_BIN}:
5152
cd tools; \
5253
for t in $$(go list -f '{{ join .Imports " " }}' -tags=tools); do \
53-
GOBIN=${TOOLS_BIN} go install -v -mod=mod "$${t}"; \
54+
GOBIN=${TOOLS_BIN} CGO_ENABLED=0 go install -v -mod=mod ${GO_FLAGS_TOOLS} "$${t}"; \
5455
done
5556

5657
##@ test, bench, coverage
5758

5859
.PHONY: test
5960
test: ${TOOLS_BIN}
6061
test: CGO_ENABLED=1
62+
test: GO_FLAGS=-tags='$(subst $(space),$(comma),${GO_BUILDTAGS})'
6163
test: ## Runs package test including race condition.
6264
$(call target)
63-
CGO_ENABLED=$(CGO_ENABLED) $(GO_TEST) -v -race -count 1 -run=$(GO_TEST_FUNC) $(strip ${GO_FLAGS}) $(GO_TEST_PKGS)
65+
CGO_ENABLED=$(CGO_ENABLED) $(GO_TEST) -race -count 1 -run=$(GO_TEST_FUNC) $(strip ${GO_FLAGS}) $(GO_TEST_PKGS)
6466

6567
.PHONY: test/gojay
6668
test/gojay: GO_BUILDTAGS+=gojay

0 commit comments

Comments
 (0)