Skip to content

Commit

Permalink
Exclude windows compilation from all target on non x86_64
Browse files Browse the repository at this point in the history
golang does not support windows on non x86_64 architectures which makes `make
all` fail on e.g. aarch64

Signed-off-by: Dan Čermák <[email protected]>
  • Loading branch information
dcermak committed Sep 23, 2021
1 parent 9717ee3 commit f463a02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Version := $(shell git describe --tags --dirty)
# Version := "dev"
GitCommit := $(shell git rev-parse HEAD)
LDFLAGS := "-s -w -X github.com/alexellis/k3sup/cmd.Version=$(Version) -X github.com/alexellis/k3sup/cmd.GitCommit=$(GitCommit)"
ARCH := $(shell uname -m)
export GO111MODULE=on
SOURCE_DIRS = cmd pkg main.go

Expand All @@ -24,7 +25,9 @@ dist:
CGO_ENABLED=0 GOOS=darwin go build -mod=vendor -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/k3sup-darwin
GOARM=6 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/k3sup-armhf
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/k3sup-arm64
ifeq ($(ARCH), x86_64)
GOOS=windows CGO_ENABLED=0 go build -mod=vendor -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/k3sup.exe
endif

.PHONY: hash
hash:
Expand Down

0 comments on commit f463a02

Please sign in to comment.