Skip to content

Commit 5e4044d

Browse files
committed
Makefile: adjust documentation for variable extensions
1 parent 18ddcb2 commit 5e4044d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ install-reuse: FORCE
5050

5151
prepare-static-check: FORCE install-golangci-lint install-modernize install-shellcheck install-go-licence-detector install-addlicense install-reuse
5252

53-
# To add additional flags or values, specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.
53+
# To add additional flags or values (before the default ones), 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'`.
5555
GO_BUILDFLAGS += -mod vendor
5656
GO_LDFLAGS +=

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,11 @@ This mechanism cannot be used to define new variables to use in your own rules;
455455
By default, all accepted variables are empty.
456456
The only exception is that `GO_BUILDFLAGS` defaults to `-mod vendor` when vendoring is enabled (see below).
457457

458-
When invoking the respective targets utilizing the variables, it's possible to either append to the provided values by modifying the calling environment:
458+
When invoking the respective targets utilizing the variables, it's possible to either prepend to the provided values by modifying the calling environment:
459459

460460
```console
461461
$ GO_BUILDFLAGS="-work -v" make build/go-makefile-maker
462-
env go build -mod vendor -work -v -ldflags ...
462+
env go build -work -v -mod vendor -ldflags ...
463463
```
464464

465465
or to override their values by passing the variables as `make` arguments:

internal/makefile/makefile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ endif
214214
if isGolang {
215215
// WARNING: DO NOT CHANGE THIS WITHOUT FIRST UNDERSTANDING THE CONSEQUENCES.
216216
// All changes have to be okay'd by Stefan Majewsky to avoid breaking setups.
217-
build.addDefinition("# To add additional flags or values, specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.")
217+
build.addDefinition("# To add additional flags or values (before the default ones), specify the variable in the environment, e.g. `GO_BUILDFLAGS='-tags experimental' make`.")
218218
build.addDefinition("# To override the default flags or values, specify the variable on the command line, e.g. `make GO_BUILDFLAGS='-tags experimental'`.")
219219
build.addDefinition("GO_BUILDFLAGS +=%s", cfg.Variable("GO_BUILDFLAGS", defaultBuildFlags))
220220
build.addDefinition("GO_LDFLAGS +=%s", cfg.Variable("GO_LDFLAGS", strings.TrimSpace(defaultLdFlags)))

0 commit comments

Comments
 (0)