From f52efc212c438a48b0ddfcfa1e17074019314af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Serv=C3=A9n=20Mar=C3=ADn?= Date: Mon, 23 Nov 2020 10:18:08 +0100 Subject: [PATCH] Makefile: variable detection for cross-compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR to add support for cross-compilation to other OSs introduced a bug in ARCH and OS variable detection. This commit fixes it. Signed-off-by: Lucas Servén Marín --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 63bd3e4..05709ff 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ pkg/k8s/apis/kilo/v1alpha1/openapi_generated.go: pkg/k8s/apis/kilo/v1alpha1/type go fmt $@ $(BINS): $(SRC) go.mod - @mkdir -p bin/$(word 2,$(subst /, ,$*))/$(word 3,$(subst /, ,$*)) + @mkdir -p bin/$(word 2,$(subst /, ,$@))/$(word 3,$(subst /, ,$@)) @echo "building: $@" @docker run --rm \ -u $$(id -u):$$(id -g) \ @@ -147,8 +147,8 @@ $(BINS): $(SRC) go.mod -w /$(PROJECT) \ $(BUILD_IMAGE) \ /bin/sh -c " \ - GOARCH=$(word 3,$(subst /, ,$*)) \ - GOOS=$(word 2,$(subst /, ,$*)) \ + GOARCH=$(word 3,$(subst /, ,$@)) \ + GOOS=$(word 2,$(subst /, ,$@)) \ GOCACHE=/$(PROJECT)/.cache \ CGO_ENABLED=0 \ go build -mod=vendor -o $@ \