mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Add distclean rule to makefile (#716)
* Add clean_everything rule to makefile Signed-off-by: angie <angheloalf95@gmail.com> * change `clean_everything` to `distclean` Signed-off-by: angie <angheloalf95@gmail.com> * Somehow forgot to commit the makefile Signed-off-by: angie <angheloalf95@gmail.com> * Remove nuke Signed-off-by: angie <angheloalf95@gmail.com> * Remove redundant variables Signed-off-by: angie <angheloalf95@gmail.com> * Forgot to remove `TEXTURE_DIRS` Signed-off-by: angie <angheloalf95@gmail.com>
This commit is contained in:
parent
42af56b231
commit
867b5a87ba
2 changed files with 21 additions and 16 deletions
32
Makefile
32
Makefile
|
@ -97,15 +97,12 @@ SPEC := spec
|
||||||
|
|
||||||
SRC_DIRS := $(shell find src -type d)
|
SRC_DIRS := $(shell find src -type d)
|
||||||
ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*") $(shell find data -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_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*")
|
||||||
ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.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_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
|
||||||
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \
|
ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \
|
||||||
$(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f)
|
$(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f)
|
||||||
|
|
||||||
TEXTURE_DIRS := assets/textures assets/scenes assets/objects assets/overlays
|
|
||||||
|
|
||||||
# source files
|
# source files
|
||||||
C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c))
|
C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c))
|
||||||
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
|
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,$(C_FILES:.c=.o),build/$f) \
|
||||||
$(foreach f,$(wildcard baserom/*),build/$f.o)
|
$(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,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.rgba32.png))
|
||||||
|
TEXTURE_FILES_RGBA16 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.rgb5a1.png))
|
||||||
TEXTURE_FILES_RGBA32 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.rgba32.png))
|
TEXTURE_FILES_GRAY4 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.i4.png))
|
||||||
TEXTURE_FILES_RGBA16 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.rgb5a1.png))
|
TEXTURE_FILES_GRAY8 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.i8.png))
|
||||||
TEXTURE_FILES_GRAY4 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.i4.png))
|
TEXTURE_FILES_GRAYA4 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ia4.png))
|
||||||
TEXTURE_FILES_GRAY8 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.i8.png))
|
TEXTURE_FILES_GRAYA8 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ia8.png))
|
||||||
TEXTURE_FILES_GRAYA4 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ia4.png))
|
TEXTURE_FILES_GRAYA16 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ia16.png))
|
||||||
TEXTURE_FILES_GRAYA8 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ia8.png))
|
TEXTURE_FILES_CI4 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ci4.png))
|
||||||
TEXTURE_FILES_GRAYA16 := $(foreach dir,$(TEXTURE_BIN_DIRS),$(wildcard $(dir)/*.ia16.png))
|
TEXTURE_FILES_CI8 := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.ci8.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_OUT := $(foreach f,$(TEXTURE_FILES_RGBA32:.rgba32.png=.rgba32.inc.c),build/$f) \
|
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_RGBA16:.rgb5a1.png=.rgb5a1.inc.c),build/$f) \
|
||||||
$(foreach f,$(TEXTURE_FILES_GRAY4:.i4.png=.i4.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) \
|
$(foreach f,$(TEXTURE_FILES_CI8:.ci8.png=.ci8.inc.c),build/$f) \
|
||||||
|
|
||||||
# create build directories
|
# 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_O1/%.o: OPTFLAGS := -O1
|
||||||
build/src/libultra_boot_O2/%.o: OPTFLAGS := -O2
|
build/src/libultra_boot_O2/%.o: OPTFLAGS := -O2
|
||||||
|
@ -194,6 +189,11 @@ build/undefined_syms.txt: undefined_syms.txt
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(ROM) $(ELF) build
|
$(RM) -r $(ROM) $(ELF) build
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
$(RM) -r $(ASSET_BIN_DIRS)
|
||||||
|
$(RM) -r baserom/
|
||||||
|
$(MAKE) -C tools distclean
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
$(MAKE) -C tools -j
|
$(MAKE) -C tools -j
|
||||||
python3 fixbaserom.py
|
python3 fixbaserom.py
|
||||||
|
@ -204,7 +204,7 @@ resources: $(ASSET_FILES_OUT)
|
||||||
test: $(ROM)
|
test: $(ROM)
|
||||||
$(EMULATOR) $(EMU_FLAGS) $<
|
$(EMULATOR) $(EMU_FLAGS) $<
|
||||||
|
|
||||||
.PHONY: all clean setup test
|
.PHONY: all clean setup test distclean
|
||||||
|
|
||||||
#### Various Recipes ####
|
#### Various Recipes ####
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,11 @@ clean:
|
||||||
$(RM) ZAPD/ZAPD.out
|
$(RM) ZAPD/ZAPD.out
|
||||||
# Need to clean the above line later...
|
# Need to clean the above line later...
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
$(MAKE) -C ZAPD clean
|
||||||
|
|
||||||
|
.PHONY: all clean distclean
|
||||||
|
|
||||||
mkldscript_SOURCES := mkldscript.c util.c
|
mkldscript_SOURCES := mkldscript.c util.c
|
||||||
elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c
|
elf2rom_SOURCES := elf2rom.c elf32.c n64chksum.c util.c
|
||||||
yaz0_SOURCES := yaz0tool.c yaz0.c util.c
|
yaz0_SOURCES := yaz0tool.c yaz0.c util.c
|
||||||
|
|
Loading…
Reference in a new issue