File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,22 @@ ifndef GODEBUG
2121 EXTRA_LDFLAGS += -s -w
2222endif
2323
24- LDFLAGS := -X $(PACKAGE ) /version.Version=$(VERSION ) -X $(PACKAGE ) /version.GitCommit=$(GITCOMMIT )
25-
26- # LDFLAGS += $(EXTRA_LDFLAGS)
24+ LDFLAGS_BASE := -X $(PACKAGE ) /version.Version=$(VERSION ) -X $(PACKAGE ) /version.GitCommit=$(GITCOMMIT ) $(EXTRA_LDFLAGS )
2725
26+ .PHONY : build
27+ build :
2828ifeq ($(STATIC ) ,)
29- GO_BUILDTAGS := osusergo netgo
30- LDFLAGS += -extldflags '-static'
31- $(info Building Static Binary)
29+ @echo "Building Dynamic Binary"
30+ $(eval LDFLAGS := $(LDFLAGS_BASE))
3231else
33- $(info Building Dynamic Binary)
32+ @echo "Building Static Binary"
33+ $(eval GO_BUILDTAGS := osusergo netgo)
34+ $(eval LDFLAGS := $(LDFLAGS_BASE) -extldflags '-static')
3435endif
35-
36- .PHONY : build
37- build :
38- GOOS=linux go build $(if $(GO_BUILDTAGS ) , -tags "$(GO_BUILDTAGS ) ") -ldflags " $( LDFLAGS) " -v -o $(BINARY ) $(PACKAGE ) /cmd/finch-daemon
39-
36+ GOOS=linux go build \
37+ $(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)") \
38+ -ldflags "$(LDFLAGS)" \
39+ -v -o $(BINARY) $(PACKAGE)/cmd/finch-daemon
4040clean :
4141 @rm -f $(BINARIES )
4242 @rm -rf $(BIN )
You can’t perform that action at this time.
0 commit comments