diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -220,11 +220,16 @@ $(COMPRESSTARGETS): # Safe removal of images $(BASERMTARGETS): rm/%: %/*.backinglock - @rm -rf $(@) + $(eval BUILD_DIR := $(subst rm/,,$(@))) + @rm -rf $(BUILD_DIR) $(PROVRMTARGETS): rm/%: %/build/*.backinglock - @rm -rf $(@) + $(eval BUILD_DIR := $(subst rm/,,$(@))/build) + $(eval FATHER_BUILD := $(dir $(shell qemu-img info $(BUILD_DIR)/rootfs-image | grep "backing file" | cut -d\ -f3-))) + $(eval BUILD_TIME := $(subst .,,$(suffix $(@)))) + @rm -rf $(FATHER_BUILD)/$(BUILD_TIME).backinglock + @rm -rf $(BUILD_DIR) %.backinglock: backinglock @qemu-img convert -f qcow2 $(@)/build/rootfs-image -O qcow2 $(@)/build/rootfs-image.tmp |