Skip to content

Commit

Permalink
Merge pull request #35 from ddebroy/winbld2
Browse files Browse the repository at this point in the history
Build Windows only for amd64
  • Loading branch information
k8s-ci-robot authored Oct 7, 2019
2 parents 0affdf9 + 2d6b3ce commit 518d6af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.make
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ else
TESTARGS =
endif

ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))

# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.

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

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

0 comments on commit 518d6af

Please sign in to comment.