Makefile: target to for cross platform

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2018-02-28 15:12:55 -05:00
parent f387b33f84
commit 80066151ba

View file

@ -98,6 +98,7 @@ ifneq ($(GOPATH),)
rm -f "$(GOPATH)/.gopathok" rm -f "$(GOPATH)/.gopathok"
endif endif
rm -rf _output rm -rf _output
rm -rf ./crio.cross.*
rm -f docs/*.5 docs/*.8 rm -f docs/*.5 docs/*.8
rm -fr test/testdata/redis-image rm -fr test/testdata/redis-image
find . -name \*~ -delete find . -name \*~ -delete
@ -109,6 +110,17 @@ endif
rm -f test/copyimg/copyimg rm -f test/copyimg/copyimg
rm -f test/checkseccomp/checkseccomp rm -f test/checkseccomp/checkseccomp
local-cross:
@for target in windows/amd64 darwin/amd64 ; do \
os=`echo $${target} | cut -f1 -d/` ; \
arch=`echo $${target} | cut -f2 -d/` ; \
suffix=$${os}.$${arch} ; \
echo "building for $${target} ..."; \
GOOS=$${os} GOARCH=$${arch} $(GO) build -i $(LDFLAGS) -tags "containers_image_openpgp" -o crio.cross.$${suffix} $(PROJECT)/cmd/crio && \
echo "built ./crio.$${suffix}"; \
done
crioimage: crioimage:
docker build -t ${CRIO_IMAGE} . docker build -t ${CRIO_IMAGE} .
@ -224,6 +236,7 @@ install.tools: .install.gitvalidation .install.gometalinter .install.md2man .ins
.PHONY: \ .PHONY: \
binaries \ binaries \
local-cross \
clean \ clean \
conmon \ conmon \
default \ default \