diff --git a/Makefile b/Makefile index b71b7ef31..939bf1b8e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ export SHELL=bash export CLEAN_DEPENDENCIES ?= false +export CLEAN_IMAGES ?= false .PHONY: help # HELP: print out this help message @@ -9,10 +10,13 @@ help: .PHONY: clean # HELP: clean compilation caches -clean: clean-frontend clean-backend ; +clean: + $(MAKE) clean-frontend CLEAN_DEPENDENCIES=$(CLEAN_DEPENDENCIES) CLEAN_IMAGES=$(CLEAN_IMAGES) + $(MAKE) clean-backend CLEAN_DEPENDENCIES=$(CLEAN_DEPENDENCIES) CLEAN_IMAGES=$(CLEAN_IMAGES) .PHONY: clean-all # HELP: clean everything, including dependency and image caches clean-all: CLEAN_DEPENDENCIES = true +clean-all: CLEAN_IMAGES = true clean-all: clean ; .PHONY: clean-% @@ -25,6 +29,10 @@ ifeq ("$(CLEAN_DEPENDENCIES)", "true") @$(MAKE) -- --clean-$*-deps @echo "Cleaned $* dependencies." endif +ifeq ("$(CLEAN_IMAGES)", "true") + docker compose rm --force --volumes + @echo "Cleaned $* image." +endif --clean-frontend: -rm -rf assets/icons assets/favicons -rm -rf static well-known