From d9696e44b7759ca0060f96cb300bdfeb690227d1 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 29 Dec 2024 16:12:33 -0500 Subject: [PATCH] add base-$(HOST_ARCH) and base-$(HOST_ARCH).test image targets These can be invoked via make base-amd64 make base-amd64.test make base-arm64 make base-arm64.test targets. Generates architecture specific flags. --- Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a2e0d95..097a6ca 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ TAG_FLAG := $(or $(TAG_FLAG), --tag) # Docker organization to pull the images from ORG = dockcross +# Host architecture +HOST_ARCH := $(shell uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') + # Directory where to generate the dockcross script for each images (e.g bin/dockcross-manylinux2014-x64) BIN = ./bin @@ -58,6 +61,9 @@ GEN_IMAGES := android-arm android-arm64 \ linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc \ bare-armv7emhf-nano_newlib +# Generate both amd64 and arm64 images +MULTIARCH_IMAGES := web-wasi web-wasi-threads + GEN_IMAGE_DOCKERFILES = $(addsuffix /Dockerfile,$(GEN_IMAGES)) # These images are expected to have explicit rules for *both* build and testing @@ -261,8 +267,18 @@ manylinux2014-x86.test: manylinux2014-x86 $(BIN)/dockcross-manylinux2014-x86 -i $(ORG)/manylinux2014-x86:latest /opt/python/cp38-cp38/bin/python test/run.py # -# base +# base-$(HOST_ARCH) # +base-$(HOST_ARCH): Dockerfile imagefiles/ + $(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/base:latest-$(HOST_ARCH) \ + $(TAG_FLAG) $(ORG)/base:$(TAG)-$(HOST_ARCH) \ + --build-arg IMAGE=$(ORG)/base \ + --build-arg VCS_URL=`git config --get remote.origin.url` \ + . + +base-$(HOST_ARCH).test: base-$(HOST_ARCH) + $(TEST_DOCKER) run $(RM) $(ORG)/base:latest-$(HOST_ARCH) > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base + base: Dockerfile imagefiles/ $(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/base:latest \ $(TAG_FLAG) $(ORG)/base:$(TAG) \