build static binaries
This commit is contained in:
parent
70d68a491d
commit
8834728285
1 changed files with 2 additions and 6 deletions
6
Makefile
6
Makefile
|
@ -17,11 +17,7 @@ WINDOWS_ARCHS ?= windows/amd64
|
|||
GO_FMT_FILES := $(shell find . -type f -name "*.go" ! -name "generated.*")
|
||||
GOFILES := $(shell find . -type f -name "*.go" -o -name "go.mod" ! -name "generated.*")
|
||||
|
||||
ifneq ($(shell uname), Darwin)
|
||||
EXTLDFLAGS = -extldflags "-static" $(null)
|
||||
else
|
||||
EXTLDFLAGS =
|
||||
endif
|
||||
|
||||
ifeq ($(HAS_GO), GO)
|
||||
GOPATH ?= $(shell $(GO) env GOPATH)
|
||||
|
@ -107,7 +103,7 @@ install: $(GOFILES)
|
|||
build: go-check $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(GOFILES)
|
||||
$(GO) build -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
|
||||
$(GO) build -v -tags 'netgo osusergo $(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
|
||||
|
||||
.PHONY: deps-backend
|
||||
deps-backend:
|
||||
|
|
Loading…
Reference in a new issue