From d764cae6623389918c21d5c116630d2add9af0f9 Mon Sep 17 00:00:00 2001 From: Rajas Kakodkar Date: Tue, 29 Sep 2020 10:55:25 +0530 Subject: [PATCH] Adding cross build support for s390x binary (#2833) Signed-off-by: Rajas Kakodkar --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 017685783ab..747d2a034f5 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ export GO111MODULE=on ALL_ARCH=amd64 arm arm64 ppc64le s390x ALL_CLIENT_PLATFORM=darwin linux windows +ALL_CLIENT_ARCHS=amd64 s390x PLATFORM ?= linux # This is the current platform, so that we can build a native client binary by default @@ -437,7 +438,11 @@ svcat-install: svcat svcat-all: $(addprefix svcat-for-,$(ALL_CLIENT_PLATFORM)) svcat-for-%: - $(MAKE) PLATFORM=$* VERSION=$(TAG_VERSION) svcat-xbuild + @if [ $(subst linux,,$*) ]; then \ + $(MAKE) PLATFORM=$* VERSION=$(TAG_VERSION) svcat-xbuild; \ + else \ + $(foreach CLIENT_ARCH,$(ALL_CLIENT_ARCHS), $(MAKE) PLATFORM=$* VERSION=$(TAG_VERSION) ARCH=$(CLIENT_ARCH) svcat-xbuild;) \ + fi svcat-xbuild: $(BINDIR)/svcat/$(TAG_VERSION)/$(PLATFORM)/$(ARCH)/svcat$(FILE_EXT) $(BINDIR)/svcat/$(TAG_VERSION)/$(PLATFORM)/$(ARCH)/svcat$(FILE_EXT): .init .generate_files