From 1498b8b2acde9a20da08a009fa94bc2e6c80223b Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Sun, 18 Jan 2026 17:04:18 +0100 Subject: Allow cleanup to prevent space issues --- Makefile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e7e7bd4..587d164 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ fedora_versions := fedora42 fedora43 fedora-rawhide debian_versions := bookworm trixie forky all_containers := arch $(fedora_versions) $(debian_versions) container_image_prefix := map-build +clean_images := 0 # Config: Release Location ##################################################### deploy_host := deploy@build.r.bdr.sh @@ -180,7 +181,7 @@ endif # Podman wrappers for distro-specific builds # -package-pacman-podman: +package-pacman-podman: build-container-arch @echo "=== Building Arch package for $(arch) ===" podman run --rm -v $(CURDIR):/src:Z -w /src $(container_image_prefix):arch bash -c '\ staging=$$(mktemp -d) && \ @@ -188,31 +189,42 @@ package-pacman-podman: chown -R builder:builder $$staging && \ su builder -c "cd $$staging && make -e profile=$(profile) -e channel=$(channel) -e target=$(target) package-pacman" && \ cp $$staging/$(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz /src/' +ifeq ($(clean_images),1) + podman rmi $(container_image_prefix):arch +endif package-rpm-podman: ifndef distro $(error distro is required, e.g., make package-rpm-podman distro=fedora43) endif + $(MAKE) build-container-$(distro) @echo "=== Building RPM for $(distro) ($(arch)) ===" podman run --rm -v $(CURDIR):/src:Z -w /src $(container_image_prefix):$(distro) \ - make -e profile=$(profile) -e channel=$(channel) -e target=$(target) -e distro=$(distro) package-rpm + make package-rpm +ifeq ($(clean_images),1) + podman rmi $(container_image_prefix):$(distro) +endif package-deb-podman: ifndef distro $(error distro is required, e.g., make package-deb-podman distro=bookworm) endif + $(MAKE) build-container-$(distro) @echo "=== Building DEB for $(distro) ($(arch)) ===" podman run --rm -v $(CURDIR):/src:Z -w /src $(container_image_prefix):$(distro) \ - make -e profile=$(profile) -e channel=$(channel) -e target=$(target) -e distro=$(distro) package-deb + make package-deb +ifeq ($(clean_images),1) + podman rmi $(container_image_prefix):$(distro) +endif package-rpm-all: @for v in $(fedora_versions); do \ - $(MAKE) -e profile=$(profile) -e channel=$(channel) -e target=$(target) -e distro=$$v package-rpm-podman; \ + $(MAKE) distro=$$v package-rpm-podman; \ done package-deb-all: @for v in $(debian_versions); do \ - $(MAKE) -e profile=$(profile) -e channel=$(channel) -e target=$(target) -e distro=$$v package-deb-podman; \ + $(MAKE) distro=$$v package-deb-podman; \ done package: package-tar package-flatpak package-appimage package-pacman-podman package-rpm-all package-deb-all @@ -250,7 +262,7 @@ distribute: distribute-tar distribute-flatpak distribute-appimage distribute-pac # Release ###################################################################### release: - $(MAKE) profile=release build-containers package distribute + $(MAKE) profile=release package distribute # Installation ################################################################# -- cgit