1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-13 13:17:39 +03:00

M #-: Docker Machine multiple arch builds (#1472)

This commit is contained in:
Vlastimil Holer 2021-09-30 11:10:53 +02:00 committed by GitHub
parent 37ed63f720
commit b1442be83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ REPO_ROOT ?= $(shell realpath ../../../../)
GOCA_PATH ?= ${REPO_ROOT}/src/oca/go
GOPATH_REPO ?= ${REPO_ROOT}/src/docker_machine
USE_LOCAL_GOCA ?= yes
TARGET_ARCHS ?= amd64 arm64
ifeq ($(GOPATH),)
GOPATH := $(GOPATH_REPO)
@ -14,10 +15,17 @@ endif
.PHONY: clean build
build: bin/docker-machine-driver-opennebula
build: \
bin/docker-machine-driver-opennebula \
$(patsubst %, bin/docker-machine-driver-opennebula.%, $(TARGET_ARCHS))
bin/docker-machine-driver-opennebula: vendor
GOPATH=$(GOPATH) go build -ldflags "-B 0x$(BUILD_ID)" -o ./bin/docker-machine-driver-opennebula ./bin
# driver without suffix is always default x86-64 (for backward compatibility)
bin/docker-machine-driver-opennebula: bin/docker-machine-driver-opennebula.amd64
cp -f $< $@
# architecture dependent builds
bin/docker-machine-driver-opennebula.%: vendor
GOPATH=$(GOPATH) GOARCH=${*} go build -ldflags "-B 0x$(BUILD_ID)" -o "$@" ./bin
vendor:
rm -rf vendor/
@ -29,4 +37,4 @@ ifeq ($(USE_LOCAL_GOCA),yes)
endif
clean:
-rm -rf vendor/ bin/docker-machine-driver-opennebula
-rm -rf vendor/ bin/docker-machine-driver-opennebula*