Skip to content

Commit

Permalink
Fix cross-compiled binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Jun 20, 2020
1 parent 7024acf commit 1e2c111
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ else
endif

ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
GOBUILD ?= CGO_ENABLED=0 go build -i
else
GOBUILD ?= go build
GOBUILD ?= CGO_ENABLED=0 go build
endif

PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(PACKAGES)

TAGS ?=
TAGS ?= netgo

ifndef OUTPUT
ifneq ($(DRONE_TAG),)
Expand All @@ -48,7 +48,7 @@ ifndef SHA
SHA := $(shell git rev-parse --short HEAD)
endif

LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Revision=$(SHA)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
LDFLAGS += -s -w -extldflags "-static" -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Revision=$(SHA)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l

.PHONY: all
Expand Down

0 comments on commit 1e2c111

Please sign in to comment.