2019-03-09 01:12:03 +00:00
|
|
|
DOCKER_TAG ?= multiarch-test-${USER}
|
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
default: test
|
|
|
|
|
|
|
|
.PHONY:test
|
|
|
|
test:
|
|
|
|
@echo ok
|
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Targets to download required qemu binaries for running on an amd64 machine
|
|
|
|
build/qemu-x86_64-static:
|
|
|
|
./get_qemu.sh x86_64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
|
|
|
build/qemu-arm-static:
|
2019-06-05 00:18:25 +00:00
|
|
|
./get_qemu.sh arm
|
2019-03-09 01:12:03 +00:00
|
|
|
|
|
|
|
build/qemu-aarch64-static:
|
2019-06-05 00:18:25 +00:00
|
|
|
./get_qemu.sh aarch64
|
|
|
|
|
|
|
|
# Build Docker image for host architechture (amd64)
|
|
|
|
.PHONY: build
|
|
|
|
build: build/qemu-x86_64-static
|
|
|
|
docker build . -t ${DOCKER_TAG}-linux-amd64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Cross build for arm architechtures
|
2019-03-09 01:12:03 +00:00
|
|
|
.PHONY: cross-build-arm
|
2019-03-10 22:37:45 +00:00
|
|
|
cross-build-arm: build/qemu-arm-static
|
2019-06-05 00:18:25 +00:00
|
|
|
docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-linux-arm
|
|
|
|
|
|
|
|
.PHONY: cross-build-arm
|
|
|
|
cross-build-arm64: build/qemu-aarch64-static
|
|
|
|
docker build --build-arg REPO=arm64v8 --build-arg ARCH=aarch64 . -t ${DOCKER_TAG}-linux-arm64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Run on host architechture
|
2019-03-09 01:12:03 +00:00
|
|
|
.PHONY: run
|
|
|
|
run: build
|
2019-06-05 00:18:25 +00:00
|
|
|
docker run ${DOCKER_TAG}-linux-amd64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Cross run on host architechture
|
|
|
|
.PHONY: cross-run-arm
|
2019-03-09 01:12:03 +00:00
|
|
|
cross-run-arm: cross-build-arm
|
2019-06-05 00:18:25 +00:00
|
|
|
docker run --rm ${DOCKER_TAG}-linux-arm
|
|
|
|
|
|
|
|
.PHONY: cross-run-arm64
|
|
|
|
cross-run-arm64: cross-build-arm64
|
|
|
|
docker run --rm ${DOCKER_TAG}-linux-arm64
|