From 9ede2bcd951679b62c3dcf101b2638536649f1ac Mon Sep 17 00:00:00 2001 From: Hyounggyu Choi Date: Mon, 22 May 2023 18:02:43 +0200 Subject: [PATCH] local-build: differentiate build targets based on architecture This is to rule out unnecessary build targets for s390x. Signed-off-by: Hyounggyu Choi --- .../kata-deploy/local-build/Makefile | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index 0d64cd4cb7..7e007a227c 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -9,19 +9,16 @@ MK_DIR := $(dir $(MK_PATH)) # Verbose build V := 1 -define BUILD - $(MK_DIR)/kata-deploy-binaries-in-docker.sh $(if $(V),,-s) --build=$1 -endef +ifeq ($(CROSS_BUILD),) + CROSS_BUILD = false +endif -kata-tarball: | all-parallel merge-builds +ifeq ($(CROSS_BUILD),false) + ARCH := $(shell uname -m) +endif -$(MK_DIR)/dockerbuild/install_yq.sh: - $(MK_DIR)/kata-deploy-copy-yq-installer.sh - -all-parallel: $(MK_DIR)/dockerbuild/install_yq.sh - ${MAKE} -f $(MK_PATH) all -j $(shell nproc ${CI:+--ignore 1}) V= - -all: serial-targets \ +ifeq ($(ARCH), x86_64) +BASE_TARBALLS = serial-targets \ firecracker-tarball \ kernel-dragonball-experimental-tarball \ kernel-nvidia-gpu-tarball \ @@ -39,16 +36,40 @@ all: serial-targets \ shim-v2-tarball \ tdvf-tarball \ virtiofsd-tarball - -serial-targets: - ${MAKE} -f $(MK_PATH) -j 1 V= \ - rootfs-image-tarball \ +BASE_SERIAL_TARBALLS = rootfs-image-tarball \ rootfs-image-tdx-tarball \ rootfs-initrd-mariner-tarball \ rootfs-initrd-sev-tarball \ rootfs-initrd-tarball \ cloud-hypervisor-tarball \ cloud-hypervisor-glibc-tarball +else ifeq ($(ARCH), s390x) +BASE_TARBALLS = serial-targets \ + kernel-tarball \ + qemu-tarball \ + shim-v2-tarball \ + virtiofsd-tarball +BASE_SERIAL_TARBALLS = rootfs-image-tarball \ + rootfs-initrd-tarball +endif + +define BUILD + $(MK_DIR)/kata-deploy-binaries-in-docker.sh $(if $(V),,-s) --build=$1 +endef + +kata-tarball: | all-parallel merge-builds + +$(MK_DIR)/dockerbuild/install_yq.sh: + $(MK_DIR)/kata-deploy-copy-yq-installer.sh + +all-parallel: $(MK_DIR)/dockerbuild/install_yq.sh + ${MAKE} -f $(MK_PATH) all -j $(shell nproc ${CI:+--ignore 1}) V= + +all: ${BASE_TARBALLS} + +serial-targets: + ${MAKE} -f $(MK_PATH) -j 1 V= \ + ${BASE_SERIAL_TARBALLS} %-tarball-build: $(MK_DIR)/dockerbuild/install_yq.sh $(call BUILD,$*)