archlinux-docker/Makefile
Emil Velikov 0a6910cade Use pattern rules in the makefile
Less duplication ftw, specially with multilib-devel on the horizon.
Unfortunately we'd need to tag the file pattern rules as precious,
otherwise make thinks they are intermediate files and nukes them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-10-02 12:45:57 +01:00

22 lines
640 B
Makefile

OCITOOL=podman # or docker
BUILDDIR=$(shell pwd)/build
OUTPUTDIR=$(shell pwd)/output
.PHONY: clean
clean:
rm -rf $(BUILDDIR) $(OUTPUTDIR)
.PRECIOUS: $(OUTPUTDIR)/%.tar.zst
$(OUTPUTDIR)/%.tar.zst:
scripts/make-rootfs.sh $(*) $(BUILDDIR) $(OUTPUTDIR)
.PRECIOUS: $(OUTPUTDIR)/Dockerfile.%
$(OUTPUTDIR)/Dockerfile.%: $(OUTPUTDIR)/%.tar.zst
scripts/make-dockerfile.sh $(*) $(OUTPUTDIR) "true" "Dev"
# The following is for local builds only, it is not used by the CI/CD pipeline
all: image-base image-base-devel
image-%: $(OUTPUTDIR)/Dockerfile.%
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.$(*) -t archlinux/archlinux:$(*) $(OUTPUTDIR)