File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,23 @@ BINDIR ?= $(PREFIX)/bin
1313
1414BINARY = $(addprefix bin/,finch-daemon)
1515
16- .PHONY : build
17- build :
18- $(eval PACKAGE := github.com/runfinch/finch-daemon)
19- $(eval VERSION ?= $(shell git describe --match 'v[0-9]* ' --dirty='.modified' --always --tags) )
20- $(eval GITCOMMIT := $(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi) )
21- ifneq ($(STATIC ) ,)
22- $(eval GO_BUILDTAGS := osusergo netgo)
23- $(eval LDFLAGS := "-X $(PACKAGE)/version.Version=$(VERSION) -X $(PACKAGE)/version.GitCommit=$(GITCOMMIT) -extldflags '-static'")
24- @echo "Building Static Binary"
16+ PACKAGE := github.com/runfinch/finch-daemon
17+ VERSION := $(shell git describe --match 'v[0-9]* ' --dirty='.modified' --always --tags)
18+ GITCOMMIT := $(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
19+
20+ LDFLAGS := -X $(PACKAGE ) /version.Version=$(VERSION ) -X $(PACKAGE ) /version.GitCommit=$(GITCOMMIT )
21+
22+ ifeq ($(STATIC ) ,)
23+ GO_BUILDTAGS := osusergo netgo
24+ LDFLAGS += -extldflags '-static'
25+ $(info Building Static Binary)
2526else
26- @echo "Building Dynamic Binary"
27- $(eval LDFLAGS := "-X $(PACKAGE)/version.Version=$(VERSION) -X $(PACKAGE)/version.GitCommit=$(GITCOMMIT)")
27+ $(info Building Dynamic Binary)
2828endif
29- GOOS=linux go build $(if $(GO_BUILDTAGS), -tags "$(GO_BUILDTAGS)") -ldflags $(LDFLAGS) $(if $(STATIC), ) -v -o $(BINARY) $(PACKAGE)/cmd/finch-daemon
29+
30+ .PHONY : build
31+ build :
32+ GOOS=linux go build $(if $(GO_BUILDTAGS ) , -tags "$(GO_BUILDTAGS ) ") -ldflags " $( LDFLAGS) " -v -o $(BINARY ) $(PACKAGE ) /cmd/finch-daemon
3033
3134.PHONY : linux
3235linux :
You can’t perform that action at this time.
0 commit comments