chore(): build static binary

This commit is contained in:
Nicolas Carlier 2023-12-22 22:02:52 +00:00
parent 908aedaf46
commit bc846f48b4

View File

@ -1,7 +1,5 @@
.SILENT : .SILENT :
export GO111MODULE=on
# App name # App name
APPNAME=webhookd APPNAME=webhookd
@ -27,7 +25,8 @@ BUILT:=`date`
define LDFLAGS define LDFLAGS
-X '$(PKG_VERSION).Version=$(VERSION)' \ -X '$(PKG_VERSION).Version=$(VERSION)' \
-X '$(PKG_VERSION).GitCommit=$(GIT_COMMIT)' \ -X '$(PKG_VERSION).GitCommit=$(GIT_COMMIT)' \
-X '$(PKG_VERSION).Built=$(BUILT)' -X '$(PKG_VERSION).Built=$(BUILT)' \
-s -w -buildid=
endef endef
all: build all: build
@ -46,7 +45,7 @@ clean:
build: build:
-mkdir -p release -mkdir -p release
echo ">>> Building: $(EXECUTABLE) $(VERSION) for $(GOOS)-$(GOARCH) ..." echo ">>> Building: $(EXECUTABLE) $(VERSION) for $(GOOS)-$(GOARCH) ..."
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -o release/$(EXECUTABLE) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -tags osusergo,netgo -ldflags "$(LDFLAGS)" -o release/$(EXECUTABLE)
.PHONY: build .PHONY: build
release/$(EXECUTABLE): build release/$(EXECUTABLE): build