Allow cleanup of logs as well and convert containerfile to a modifiable variable

This commit is contained in:
Alex D. 2024-10-14 09:12:07 +00:00
parent a6da1589c1
commit 3407acc70f
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 8 additions and 4 deletions

View File

@ -18,9 +18,10 @@ include config.mk
# touch $@
MANIFEST_FILE = ${IMAGE_DIR}/manifest.json
BUILD_INSTRUCTIONS = Containerfile
# Autogenerated lists
CONTAINERS := $(shell find ./ -name 'Containerfile' -exec 'dirname' '{}' ';' | cut -d'/' -f2-)
CONTAINERS := $(shell find ./ -name '${BUILD_INSTRUCTIONS}' -exec 'dirname' '{}' ';' | cut -d'/' -f2-)
IMAGE_DIRS := $(addsuffix /${IMAGE_DIR},${CONTAINERS})
BUILD_IDS := $(addsuffix /${BUILD_ID_OUT},${CONTAINERS})
BUILD_LOGS := $(addsuffix /${BUILD_LOG},${CONTAINERS})
@ -44,7 +45,7 @@ localbuild: $(BUILD_IDS)
$(shell cat $<) \
dir:$*/${IMAGE_DIR}
%/${BUILD_ID_OUT}: %/Containerfile
%/${BUILD_ID_OUT}: %/${BUILD_INSTRUCTIONS}
buildah build \
--jobs 0 \
--network=none \
@ -56,7 +57,10 @@ localbuild: $(BUILD_IDS)
$*
# Clean up
clean: cleanbuild cleandirs
clean: cleanbuild cleandirs cleanlogs
cleanlogs:
-rm -rv ${BUILD_LOGS}
cleanbuild:
-rm -rv ${BUILD_IDS}
@ -64,7 +68,7 @@ cleanbuild:
cleandirs:
-rm -rv ${IMAGE_DIRS}
.PHONY: all clean cleanbuild cleandirs localbuild unified
.PHONY: all clean cleanbuild cleandirs cleanlogs localbuild unified
.SUFFIXES:
# Somehow GNU make forgets these are intermediates if not explicitly stated, feel free to look into it *shrug*