Skip to content

Commit

Permalink
Enable to build cross platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kairen committed Feb 19, 2019
1 parent 7adf462 commit a585bc7
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 @@ -8,15 +8,15 @@ OWNER := kairen
REPOPATH ?= $(ORG)/$(OWNER)/kubectl-config-merge

GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)

$(shell mkdir -p ./out)

.PHONY: build
build: out/config-merge
build: out/config-merge-$(GOOS)-$(GOARCH)

.PHONY: out/config-merge
out/config-merge:
CGO_ENABLED=0 GOOS=$(GOOS) go build \
out/config-merge-%-$(GOARCH):
CGO_ENABLED=0 GOOS=$* GOARCH=$(GOARCH) go build \
-ldflags="-s -w -X $(REPOPATH)/pkg/version.version=$(VERSION)" \
-a -o $@ cmd/kubectl-config-merge.go

Expand Down

0 comments on commit a585bc7

Please sign in to comment.