|
@@ -15,23 +15,30 @@ PACKAGES_EXPANDED=$(PACKAGES:%=github.com/coreos/flannel/%)
|
|
|
|
|
|
# Set the (cross) compiler to use for different architectures
|
|
|
ifeq ($(ARCH),amd64)
|
|
|
- LIB_DIR=x86_64-linux-gnu
|
|
|
+ LIB_DIR=/lib/x86_64-linux-gnu
|
|
|
CC=gcc
|
|
|
endif
|
|
|
ifeq ($(ARCH),arm)
|
|
|
- LIB_DIR=arm-linux-gnueabi
|
|
|
- CC=arm-linux-gnueabi-gcc
|
|
|
+ LIB_DIR=/usr/arm-linux-gnueabihf/lib
|
|
|
+ CC=arm-linux-gnueabihf-gcc
|
|
|
endif
|
|
|
ifeq ($(ARCH),arm64)
|
|
|
- LIB_DIR=aarch64-linux-gnu
|
|
|
+ LIB_DIR=/usr/aarch64-linux-gnu/lib
|
|
|
CC=aarch64-linux-gnu-gcc
|
|
|
endif
|
|
|
ifeq ($(ARCH),ppc64le)
|
|
|
- LIB_DIR=powerpc64le-linux-gnu
|
|
|
+ LIB_DIR=/usr/powerpc64le-linux-gnu/lib
|
|
|
CC=powerpc64le-linux-gnu-gcc
|
|
|
endif
|
|
|
-GOARM=6
|
|
|
-KUBE_CROSS_TAG=v1.6.2-2
|
|
|
+ifeq ($(ARCH),s390x)
|
|
|
+ LIB_DIR=s390x-linux-gnu
|
|
|
+ CC=s390x-linux-gnu-gcc
|
|
|
+endif
|
|
|
+
|
|
|
+GOARM=7
|
|
|
+
|
|
|
+# List images with gcloud alpha container images list-tags gcr.io/google_containers/kube-cross
|
|
|
+KUBE_CROSS_TAG=v1.7.5-3
|
|
|
IPTABLES_VERSION=1.4.21
|
|
|
|
|
|
dist/flanneld: $(shell find . -type f -name '*.go')
|
|
@@ -97,7 +104,7 @@ endif
|
|
|
## Build an architecture specific flanneld binary
|
|
|
dist/flanneld-$(ARCH):
|
|
|
# Build for other platforms with 'ARCH=$$ARCH make dist/flanneld-$$ARCH'
|
|
|
- # valid values for $$ARCH are [amd64 arm arm64 ppc64le]
|
|
|
+ # valid values for $$ARCH are [amd64 arm arm64 ppc64le s390x]
|
|
|
docker run -e CC=$(CC) -e GOARM=$(GOARM) -e GOARCH=$(ARCH) \
|
|
|
-u $(shell id -u):$(shell id -g) \
|
|
|
-v $(CURDIR):/go/src/github.com/coreos/flannel:ro \
|
|
@@ -108,9 +115,11 @@ dist/flanneld-$(ARCH):
|
|
|
mv dist/flanneld dist/flanneld-$(ARCH) && \
|
|
|
file dist/flanneld-$(ARCH)'
|
|
|
|
|
|
-## Busybox images are missing pthread. Pull it out of the kube-cross image
|
|
|
-dist/libpthread.so.0-$(ARCH):
|
|
|
- docker run --rm -v `pwd`:/host gcr.io/google_containers/kube-cross:$(KUBE_CROSS_TAG) cp /lib/$(LIB_DIR)/libpthread.so.0 /host/dist/libpthread.so.0-$(ARCH)
|
|
|
+## Busybox images need updated libs. Pull them out of the kube-cross image
|
|
|
+dist/libpthread.so.0-$(ARCH) dist/libc.so.6-$(ARCH) dist/ld64.so.1-$(ARCH):
|
|
|
+ docker run --rm -v $(CURDIR):/host gcr.io/google_containers/kube-cross:$(KUBE_CROSS_TAG) cp $(LIB_DIR)/libc-2.23.so /host/dist/libc.so.6-$(ARCH)
|
|
|
+ docker run --rm -v $(CURDIR):/host gcr.io/google_containers/kube-cross:$(KUBE_CROSS_TAG) cp $(LIB_DIR)/ld-2.23.so /host/dist/ld64.so.1-$(ARCH)
|
|
|
+ docker run --rm -v $(CURDIR):/host gcr.io/google_containers/kube-cross:$(KUBE_CROSS_TAG) cp $(LIB_DIR)/libpthread.so.0 /host/dist/libpthread.so.0-$(ARCH)
|
|
|
|
|
|
## Build an architecture specific iptables binary
|
|
|
dist/iptables-$(ARCH):
|
|
@@ -148,6 +157,9 @@ tar.gz:
|
|
|
ARCH=arm64 make dist/flanneld-arm64
|
|
|
tar --transform='flags=r;s|-arm64||' -zcvf dist/flannel-$(TAG)-linux-arm64.tar.gz -C dist flanneld-arm64 mk-docker-opts.sh ../README.md
|
|
|
tar -tvf dist/flannel-$(TAG)-linux-arm64.tar.gz
|
|
|
+ ARCH=s390x make dist/flanneld-s390x
|
|
|
+ tar --transform='flags=r;s|-s390x||' -zcvf dist/flannel-$(TAG)-linux-s390x.tar.gz -C dist flanneld-s390x mk-docker-opts.sh ../README.md
|
|
|
+ tar -tvf dist/flannel-$(TAG)-linux-s390x.tar.gz
|
|
|
|
|
|
## Make a release after creating a tag
|
|
|
release: tar.gz
|
|
@@ -155,6 +167,7 @@ release: tar.gz
|
|
|
ARCH=arm make dist/flanneld-$(TAG)-arm.aci
|
|
|
ARCH=arm64 make dist/flanneld-$(TAG)-arm64.aci
|
|
|
ARCH=ppc64le make dist/flanneld-$(TAG)-ppc64le.aci
|
|
|
+ ARCH=s390x make dist/flanneld-$(TAG)-s390x.aci
|
|
|
@echo "Everything should be built for $(TAG)"
|
|
|
@echo "Add all *.aci, flanneld-* and *.tar.gz files from dist/ to the Github release"
|
|
|
@echo "Use make docker-push-all to push the images to a registry"
|
|
@@ -164,6 +177,7 @@ docker-push-all:
|
|
|
ARCH=arm make docker-push
|
|
|
ARCH=arm64 make docker-push
|
|
|
ARCH=ppc64le make docker-push
|
|
|
+ ARCH=s390x make docker-push
|
|
|
|
|
|
flannel-git:
|
|
|
ARCH=amd64 REGISTRY=quay.io/coreos/flannel-git make clean dist/flanneld-$(TAG)-amd64.docker docker-push
|
|
@@ -172,3 +186,4 @@ flannel-git:
|
|
|
ARCH=arm REGISTRY=quay.io/coreos/flannel-git make clean dist/flanneld-$(TAG)-arm.docker docker-push
|
|
|
ARCH=arm64 REGISTRY=quay.io/coreos/flannel-git make clean dist/flanneld-$(TAG)-arm64.docker docker-push
|
|
|
ARCH=ppc64le REGISTRY=quay.io/coreos/flannel-git make clean dist/flanneld-$(TAG)-ppc64le.docker docker-push
|
|
|
+ ARCH=s390x REGISTRY=quay.io/coreos/flannel-git make clean dist/flanneld-$(TAG)-s390x.docker docker-push
|