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>
This commit is contained in:
parent
ab24242a44
commit
f52efc212c
6
Makefile
6
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 $@ \
|
||||
|
Loading…
Reference in New Issue
Block a user