From 867b5a87ba51b5fd533f1f51816a1bfdb6ba73ca Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sun, 14 Mar 2021 13:07:46 -0300 Subject: [PATCH] Add distclean rule to makefile (#716) * Add clean_everything rule to makefile Signed-off-by: angie * change `clean_everything` to `distclean` Signed-off-by: angie * Somehow forgot to commit the makefile Signed-off-by: angie * Remove nuke Signed-off-by: angie * Remove redundant variables Signed-off-by: angie * Forgot to remove `TEXTURE_DIRS` Signed-off-by: angie --- Makefile | 32 ++++++++++++++++---------------- tools/Makefile | 5 +++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index bee349a96d..844522e8da 100644 --- a/Makefile +++ b/Makefile @@ -97,15 +97,12 @@ SPEC := spec SRC_DIRS := $(shell find src -type d) ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*") $(shell find data -type d) -ASSET_DIRS := assets/objects assets/textures assets/scenes assets/overlays ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*") ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml)) ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin)) ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \ $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f) -TEXTURE_DIRS := assets/textures assets/scenes assets/objects assets/overlays - # source files C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c)) S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s)) @@ -113,17 +110,15 @@ O_FILES := $(foreach f,$(S_FILES:.s=.o),build/$f) \ $(foreach f,$(C_FILES:.c=.o),build/$f) \ $(foreach f,$(wildcard baserom/*),build/$f.o) -TEXTURE_BIN_DIRS := $(shell find assets/objects/* assets/textures/* assets/scenes/* assets/overlays/* -type d) - -TEXTURE_FILES_RGBA32 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.rgba32.png)) -TEXTURE_FILES_RGBA16 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.rgb5a1.png)) -TEXTURE_FILES_GRAY4 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.i4.png)) -TEXTURE_FILES_GRAY8 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.i8.png)) -TEXTURE_FILES_GRAYA4 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ia4.png)) -TEXTURE_FILES_GRAYA8 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ia8.png)) -TEXTURE_FILES_GRAYA16 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ia16.png)) -TEXTURE_FILES_CI4 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ci4.png)) -TEXTURE_FILES_CI8 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ci8.png)) +TEXTURE_FILES_RGBA32 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.rgba32.png)) +TEXTURE_FILES_RGBA16 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.rgb5a1.png)) +TEXTURE_FILES_GRAY4 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.i4.png)) +TEXTURE_FILES_GRAY8 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.i8.png)) +TEXTURE_FILES_GRAYA4 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ia4.png)) +TEXTURE_FILES_GRAYA8 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ia8.png)) +TEXTURE_FILES_GRAYA16 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ia16.png)) +TEXTURE_FILES_CI4 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ci4.png)) +TEXTURE_FILES_CI8 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ci8.png)) TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_RGBA32:.rgba32.png=.rgba32.inc.c),build/$f) \ $(foreach f,$(TEXTURE_FILES_RGBA16:.rgb5a1.png=.rgb5a1.inc.c),build/$f) \ $(foreach f,$(TEXTURE_FILES_GRAY4:.i4.png=.i4.inc.c),build/$f) \ @@ -135,7 +130,7 @@ TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_RGBA32:.rgba32.png=.rgba32.inc. $(foreach f,$(TEXTURE_FILES_CI8:.ci8.png=.ci8.inc.c),build/$f) \ # create build directories -$(shell mkdir -p build/baserom $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(TEXTURE_DIRS) $(ASSET_BIN_DIRS),build/$(dir))) +$(shell mkdir -p build/baserom $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(ASSET_BIN_DIRS),build/$(dir))) build/src/libultra_boot_O1/%.o: OPTFLAGS := -O1 build/src/libultra_boot_O2/%.o: OPTFLAGS := -O2 @@ -194,6 +189,11 @@ build/undefined_syms.txt: undefined_syms.txt clean: $(RM) -r $(ROM) $(ELF) build +distclean: clean + $(RM) -r $(ASSET_BIN_DIRS) + $(RM) -r baserom/ + $(MAKE) -C tools distclean + setup: $(MAKE) -C tools -j python3 fixbaserom.py @@ -204,7 +204,7 @@ resources: $(ASSET_FILES_OUT) test: $(ROM) $(EMULATOR) $(EMU_FLAGS) $< -.PHONY: all clean setup test +.PHONY: all clean setup test distclean #### Various Recipes #### diff --git a/tools/Makefile b/tools/Makefile index cdb50552f3..da52fcfb40 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -11,6 +11,11 @@ clean: $(RM) ZAPD/ZAPD.out # Need to clean the above line later... +distclean: clean + $(MAKE) -C ZAPD clean + +.PHONY: all clean distclean + mkldscript_SOURCES := mkldscript.c util.c elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c yaz0_SOURCES := yaz0tool.c yaz0.c util.c