Skip to content

Commit

Permalink
feat: pick cgo arg from env (#1095)
Browse files Browse the repository at this point in the history
Signed-off-by: Vamsi Krishna <vamsikrishnasatyasi971@gmail.com>
  • Loading branch information
SVKREP committed Jan 4, 2024
1 parent 17a115d commit aa79dfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
GO_VERSION ?= $(shell go run ./scripts/detectgoversion/detect.go 2>/dev/null || printf '1.18')
BINNAME ?= move2kube
IN_CICD ?= false
CGO_ENABLED ?= 0
BINDIR := $(CURDIR)/bin
DISTDIR := $(CURDIR)/_dist
TARGETS := darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 linux/s390x linux/ppc64le windows/amd64
Expand Down Expand Up @@ -102,7 +103,7 @@ build: get $(BINDIR)/$(BINNAME) ## Build go code
@printf "\033[32m-------------------------------------\n BUILD SUCCESS\n-------------------------------------\033[0m\n"

$(BINDIR)/$(BINNAME): $(SRC) $(ASSETS) $(WEB_ASSETS)
CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINNAME) .
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINNAME) .
mkdir -p $(GOPATH)/bin/
cp $(BINDIR)/$(BINNAME) $(GOPATH)/bin/

Expand Down

0 comments on commit aa79dfa

Please sign in to comment.