From 5f7e943e50cdef80a5ee7397bd56a04a156e294e Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Mon, 21 Nov 2022 16:03:07 +0100 Subject: [PATCH 1/3] Add `clean_builtsrc`, `clean_builtassets` --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 7cdb1e35ec3..cb4bad83da4 100644 --- a/Makefile +++ b/Makefile @@ -251,6 +251,14 @@ endif clean: $(RM) -r $(ROM) $(ELF) build +clean_builtsrc: + $(RM) -r $(ROM) $(ELF) build/src build/data + find build -maxdepth 1 -type f -exec rm {} \; + +clean_builtassets: + $(RM) -r $(ROM) $(ELF) build/assets + find build -maxdepth 1 -type f -exec rm {} \; + assetclean: $(RM) -r $(ASSET_BIN_DIRS) $(RM) -r assets/text/*.h From d3f1c2efece451238dc07d01544cafaf4924b863 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Mon, 21 Nov 2022 16:04:22 +0100 Subject: [PATCH 2/3] make targets phony --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cb4bad83da4..364695d84e0 100644 --- a/Makefile +++ b/Makefile @@ -279,7 +279,7 @@ test: $(ROM) $(EMULATOR) $(EMU_FLAGS) $< -.PHONY: all clean setup test distclean assetclean +.PHONY: all clean clean_builtsrc clean_builtassets setup test distclean assetclean #### Various Recipes #### From a704b7fdd617db1911a4957306be709a9c6db5eb Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Fri, 13 Jan 2023 15:25:11 +0100 Subject: [PATCH 3/3] Comment on the "find rm" command --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 364695d84e0..98b56a3c3dd 100644 --- a/Makefile +++ b/Makefile @@ -253,11 +253,12 @@ clean: clean_builtsrc: $(RM) -r $(ROM) $(ELF) build/src build/data - find build -maxdepth 1 -type f -exec rm {} \; +# Delete files directly inside build/ (but not in subfolders) + find build -maxdepth 1 -type f -exec $(RM) {} \; clean_builtassets: $(RM) -r $(ROM) $(ELF) build/assets - find build -maxdepth 1 -type f -exec rm {} \; + find build -maxdepth 1 -type f -exec $(RM) {} \; assetclean: $(RM) -r $(ASSET_BIN_DIRS)