Skip to content

Commit 2d6b3ce

Browse files
committed
Build Windows only for amd64
Signed-off-by: Deep Debroy <[email protected]>
1 parent 0affdf9 commit 2d6b3ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.make

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,17 @@ else
5757
TESTARGS =
5858
endif
5959

60+
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
61+
6062
# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
6163
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.
6264

6365
build-%:
6466
mkdir -p bin
6567
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$* ./cmd/$*
66-
CGO_ENABLED=0 GOOS=windows go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$*.exe ./cmd/$*
68+
if [ "$$ARCH" = "amd64" ]; then \
69+
CGO_ENABLED=0 GOOS=windows go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$*.exe ./cmd/$* ; \
70+
fi
6771

6872
container-%: build-%
6973
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .

0 commit comments

Comments
 (0)