Sfoglia il codice sorgente

Makefile: variable detection for cross-compilation

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 <lserven@gmail.com>
Lucas Servén Marín 5 anni fa
parent
commit
f52efc212c
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      Makefile

+ 3 - 3
Makefile

@@ -139,7 +139,7 @@ pkg/k8s/apis/kilo/v1alpha1/openapi_generated.go: pkg/k8s/apis/kilo/v1alpha1/type
 	go fmt $@
 	go fmt $@
 
 
 $(BINS): $(SRC) go.mod
 $(BINS): $(SRC) go.mod
-	@mkdir -p bin/$(word 2,$(subst /, ,$*))/$(word 3,$(subst /, ,$*))
+	@mkdir -p bin/$(word 2,$(subst /, ,$@))/$(word 3,$(subst /, ,$@))
 	@echo "building: $@"
 	@echo "building: $@"
 	@docker run --rm \
 	@docker run --rm \
 	    -u $$(id -u):$$(id -g) \
 	    -u $$(id -u):$$(id -g) \
@@ -147,8 +147,8 @@ $(BINS): $(SRC) go.mod
 	    -w /$(PROJECT) \
 	    -w /$(PROJECT) \
 	    $(BUILD_IMAGE) \
 	    $(BUILD_IMAGE) \
 	    /bin/sh -c " \
 	    /bin/sh -c " \
-	        GOARCH=$(word 3,$(subst /, ,$*)) \
-	        GOOS=$(word 2,$(subst /, ,$*)) \
+	        GOARCH=$(word 3,$(subst /, ,$@)) \
+	        GOOS=$(word 2,$(subst /, ,$@)) \
 	        GOCACHE=/$(PROJECT)/.cache \
 	        GOCACHE=/$(PROJECT)/.cache \
 		CGO_ENABLED=0 \
 		CGO_ENABLED=0 \
 		go build -mod=vendor -o $@ \
 		go build -mod=vendor -o $@ \