Skip to content

Commit 9f9bb71

Browse files
authored
Allow to configure golang flags (#329)
Signed-off-by: Sebastian Sch <[email protected]>
1 parent 1c2b841 commit 9f9bb71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ V = 0
2424
Q = $(if $(filter 1,$V),,@)
2525
TLS_SETTING := $(if $(filter $(OCI_BIN),podman),--tls-verify=false,)
2626

27+
# Go settings
28+
GO_BUILD_OPTS ?= CGO_ENABLED=0 GO111MODULE=on
29+
GO_TAGS ?= -tags no_openssl
30+
GO_FLAGS ?= -mod vendor
31+
2732
all: lint build
2833

2934
GO := $(GOBIN)/go
@@ -45,7 +50,7 @@ lint: $(GO) $(GOLANGCI)
4550
$(GOLANGCI) run
4651

4752
build-%: $(GO)
48-
cd cmd/$* && $(GO) fmt && $(GO) vet && GOOS=linux GOARCH=$(GOARCH) CGO_ENABLED=0 GO111MODULE=on $(GO) build -tags no_openssl -mod vendor
53+
cd cmd/$* && $(GO) fmt && $(GO) vet && GOOS=linux GOARCH=$(GOARCH) $(GO_BUILD_OPTS) $(GO) build $(GO_TAGS)
4954

5055
format: $(GO)
5156
$(GO) fmt ./pkg/... ./cmd/...

0 commit comments

Comments
 (0)