mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2025-08-06 22:27:29 +02:00
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>
This commit is contained in:
parent
64cb18a0c3
commit
0a6910cade
26
Makefile
26
Makefile
@ -6,24 +6,16 @@ OUTPUTDIR=$(shell pwd)/output
|
|||||||
clean:
|
clean:
|
||||||
rm -rf $(BUILDDIR) $(OUTPUTDIR)
|
rm -rf $(BUILDDIR) $(OUTPUTDIR)
|
||||||
|
|
||||||
$(OUTPUTDIR)/base.tar.zst:
|
.PRECIOUS: $(OUTPUTDIR)/%.tar.zst
|
||||||
scripts/make-rootfs.sh base $(BUILDDIR) $(OUTPUTDIR)
|
$(OUTPUTDIR)/%.tar.zst:
|
||||||
|
scripts/make-rootfs.sh $(*) $(BUILDDIR) $(OUTPUTDIR)
|
||||||
|
|
||||||
$(OUTPUTDIR)/base-devel.tar.zst:
|
.PRECIOUS: $(OUTPUTDIR)/Dockerfile.%
|
||||||
scripts/make-rootfs.sh base-devel $(BUILDDIR) $(OUTPUTDIR)
|
$(OUTPUTDIR)/Dockerfile.%: $(OUTPUTDIR)/%.tar.zst
|
||||||
|
scripts/make-dockerfile.sh $(*) $(OUTPUTDIR) "true" "Dev"
|
||||||
$(OUTPUTDIR)/Dockerfile.base: $(OUTPUTDIR)/base.tar.zst
|
|
||||||
scripts/make-dockerfile.sh base $(OUTPUTDIR)
|
|
||||||
|
|
||||||
$(OUTPUTDIR)/Dockerfile.base-devel: $(OUTPUTDIR)/base-devel.tar.zst
|
|
||||||
scripts/make-dockerfile.sh base-devel $(OUTPUTDIR)
|
|
||||||
|
|
||||||
# The following is for local builds only, it is not used by the CI/CD pipeline
|
# The following is for local builds only, it is not used by the CI/CD pipeline
|
||||||
|
|
||||||
.PHONY: image-base
|
all: image-base image-base-devel
|
||||||
image-base: $(OUTPUTDIR)/Dockerfile.base
|
image-%: $(OUTPUTDIR)/Dockerfile.%
|
||||||
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.base -t archlinux/archlinux:base $(OUTPUTDIR)
|
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.$(*) -t archlinux/archlinux:$(*) $(OUTPUTDIR)
|
||||||
|
|
||||||
.PHONY: image-base-devel
|
|
||||||
image-base-devel: $(OUTPUTDIR)/Dockerfile.base-devel
|
|
||||||
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.base-devel -t archlinux/archlinux:base-devel $(OUTPUTDIR)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user