From 80066151ba4282e2b0a45fe523addebf538cc8b9 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 28 Feb 2018 15:12:55 -0500 Subject: [PATCH] Makefile: target to for cross platform Signed-off-by: Vincent Batts --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 4af1bfb6..b4f6d9ca 100644 --- a/Makefile +++ b/Makefile @@ -98,6 +98,7 @@ ifneq ($(GOPATH),) rm -f "$(GOPATH)/.gopathok" endif rm -rf _output + rm -rf ./crio.cross.* rm -f docs/*.5 docs/*.8 rm -fr test/testdata/redis-image find . -name \*~ -delete @@ -109,6 +110,17 @@ endif rm -f test/copyimg/copyimg 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: docker build -t ${CRIO_IMAGE} . @@ -224,6 +236,7 @@ install.tools: .install.gitvalidation .install.gometalinter .install.md2man .ins .PHONY: \ binaries \ + local-cross \ clean \ conmon \ default \