Skip to content

Commit b58544f

Browse files
committed
Makefile: add EXTRA_LDFLAGS
Add EXTRA_LDFLAGS to support add extra ldflags Signed-off-by: Changqing Li <[email protected]>
1 parent 5e63903 commit b58544f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ BUILDTAGS=
66
RUNTIME ?= runc
77
COMMIT ?= $(shell git describe --dirty --long --always --tags 2> /dev/null)
88
VERSION := ${shell cat ./VERSION}
9-
BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" $(EXTRA_FLAGS)
10-
STATIC_BUILD_FLAGS := -tags "$(BUILDTAGS) netgo osusergo" -ldflags "-extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" $(EXTRA_FLAGS)
9+
EXTRA_LDFLAGS ?= ""
10+
BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) ${EXTRA_LDFLAGS}" $(EXTRA_FLAGS)
11+
STATIC_BUILD_FLAGS := -tags "$(BUILDTAGS) netgo osusergo" -ldflags "-extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) ${EXTRA_LDFLAGS}" $(EXTRA_FLAGS)
1112
VALIDATION_TESTS ?= $(patsubst %.go,%.t,$(shell find ./validation/ -name *.go | grep -v util))
1213

1314
all: tool runtimetest validation-executables

0 commit comments

Comments
 (0)