Skip to content

Commit 8f69811

Browse files
Revert "add a better variable override mechanism"
This reverts commit f56b186.
1 parent bbc2886 commit 8f69811

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ prepare-static-check: FORCE install-golangci-lint install-modernize install-shel
5252

5353
# To add additional flags or values, specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.
5454
# To override the default flags or values, specify the variable on the command line, e.g. `make GO_BUILDFLAGS='-tags experimental'`.
55-
GO_BUILDFLAGS += -mod vendor
56-
GO_LDFLAGS +=
57-
GO_TESTFLAGS +=
58-
GO_TESTENV +=
59-
GO_BUILDENV +=
55+
GO_BUILDFLAGS := -mod vendor $(GO_BUILDFLAGS)
56+
GO_LDFLAGS := $(GO_LDFLAGS)
57+
GO_TESTFLAGS := $(GO_TESTFLAGS)
58+
GO_TESTENV := $(GO_TESTENV)
59+
GO_BUILDENV := $(GO_BUILDENV)
6060

6161
# These definitions are overridable, e.g. to provide fixed version/commit values when
6262
# no .git directory is present or to provide a fixed build date for reproducibility.

internal/makefile/makefile.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ endif
213213
if isGolang {
214214
build.addDefinition("# To add additional flags or values, specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.")
215215
build.addDefinition("# To override the default flags or values, specify the variable on the command line, e.g. `make GO_BUILDFLAGS='-tags experimental'`.")
216-
build.addDefinition("GO_BUILDFLAGS +=%s", cfg.Variable("GO_BUILDFLAGS", defaultBuildFlags))
217-
build.addDefinition("GO_LDFLAGS +=%s", cfg.Variable("GO_LDFLAGS", strings.TrimSpace(defaultLdFlags)))
218-
build.addDefinition("GO_TESTFLAGS +=%s", cfg.Variable("GO_TESTFLAGS", ""))
219-
build.addDefinition("GO_TESTENV +=%s", cfg.Variable("GO_TESTENV", ""))
220-
build.addDefinition("GO_BUILDENV +=%s", cfg.Variable("GO_BUILDENV", ""))
216+
build.addDefinition("GO_BUILDFLAGS :=%s $(GO_BUILDFLAGS)", cfg.Variable("GO_BUILDFLAGS", defaultBuildFlags))
217+
build.addDefinition("GO_LDFLAGS :=%s $(GO_LDFLAGS)", cfg.Variable("GO_LDFLAGS", strings.TrimSpace(defaultLdFlags)))
218+
build.addDefinition("GO_TESTFLAGS :=%s $(GO_TESTFLAGS)", cfg.Variable("GO_TESTFLAGS", ""))
219+
build.addDefinition("GO_TESTENV :=%s $(GO_TESTENV)", cfg.Variable("GO_TESTENV", ""))
220+
build.addDefinition("GO_BUILDENV :=%s $(GO_BUILDENV)", cfg.Variable("GO_BUILDENV", ""))
221221
}
222222
if sr.HasBinInfo {
223223
build.addDefinition("")

0 commit comments

Comments
 (0)