mirror of https://github.com/zeldaret/mm.git
Move spec to spec folder (#1790)
This commit is contained in:
parent
84a89c8f46
commit
1241a8ca5c
21
Makefile
21
Makefile
|
@ -252,7 +252,8 @@ ELF := $(ROM:.z64=.elf)
|
||||||
MAP := $(ROM:.z64=.map)
|
MAP := $(ROM:.z64=.map)
|
||||||
LDSCRIPT := $(ROM:.z64=.ld)
|
LDSCRIPT := $(ROM:.z64=.ld)
|
||||||
# description of ROM segments
|
# description of ROM segments
|
||||||
SPEC := spec
|
SPEC := spec/spec
|
||||||
|
SPEC_INCLUDES := $(wildcard spec/*.inc)
|
||||||
|
|
||||||
# create asm directories
|
# create asm directories
|
||||||
$(shell mkdir -p asm data extracted)
|
$(shell mkdir -p asm data extracted)
|
||||||
|
@ -357,11 +358,11 @@ ASSET_C_FILES_EXTRACTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_E
|
||||||
ASSET_C_FILES_COMMITTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.c)))
|
ASSET_C_FILES_COMMITTED := $(filter-out %.inc.c,$(foreach dir,$(ASSET_BIN_DIRS_COMMITTED),$(wildcard $(dir)/*.c)))
|
||||||
C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS_C_FILES),$(wildcard $(dir)/*.c))
|
C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS_C_FILES),$(wildcard $(dir)/*.c))
|
||||||
S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s)) \
|
S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s)) \
|
||||||
$(shell grep -F "\$$(BUILD_DIR)/asm" spec | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.s/') \
|
$(shell grep -F "\$$(BUILD_DIR)/asm" $(SPEC) | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.s/') \
|
||||||
$(shell grep -F "\$$(BUILD_DIR)/data" spec | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.s/')
|
$(shell grep -F "\$$(BUILD_DIR)/data" $(SPEC) | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.s/')
|
||||||
SCHEDULE_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.schl))
|
SCHEDULE_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.schl))
|
||||||
BASEROM_FILES := $(shell grep -F "\$$(BUILD_DIR)/baserom" spec | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*//')
|
BASEROM_FILES := $(shell grep -F "\$$(BUILD_DIR)/baserom" $(SPEC) | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*//')
|
||||||
ARCHIVES_O := $(shell grep -F ".yar.o" spec | sed 's/.*include "// ; s/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.o/')
|
ARCHIVES_O := $(shell grep -F ".yar.o" $(SPEC) | sed 's/.*include "// ; s/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.o/')
|
||||||
O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \
|
O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \
|
||||||
$(foreach f,$(C_FILES:.c=.o),$(BUILD_DIR)/$f) \
|
$(foreach f,$(C_FILES:.c=.o),$(BUILD_DIR)/$f) \
|
||||||
$(foreach f,$(ASSET_C_FILES_EXTRACTED:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
|
$(foreach f,$(ASSET_C_FILES_EXTRACTED:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \
|
||||||
|
@ -585,13 +586,13 @@ all: rom compress
|
||||||
$(BUILD_DIR)/%.ld: %.ld
|
$(BUILD_DIR)/%.ld: %.ld
|
||||||
$(CPP) $(CPPFLAGS) $(IINC) $< > $@
|
$(CPP) $(CPPFLAGS) $(IINC) $< > $@
|
||||||
|
|
||||||
$(BUILD_DIR)/$(SPEC): $(SPEC)
|
$(BUILD_DIR)/spec: $(SPEC) $(SPEC_INCLUDES)
|
||||||
$(CPP) $(CPPFLAGS) $< | $(BUILD_DIR_REPLACE) > $@
|
$(CPP) $(CPPFLAGS) -I. $< | $(BUILD_DIR_REPLACE) > $@
|
||||||
|
|
||||||
$(LDSCRIPT): $(BUILD_DIR)/$(SPEC)
|
$(LDSCRIPT): $(BUILD_DIR)/spec
|
||||||
$(MKLDSCRIPT) $< $@
|
$(MKLDSCRIPT) $< $@
|
||||||
|
|
||||||
$(BUILD_DIR)/dmadata/dmadata_table_spec.h $(BUILD_DIR)/dmadata/compress_ranges.txt &: $(BUILD_DIR)/$(SPEC)
|
$(BUILD_DIR)/dmadata/dmadata_table_spec.h $(BUILD_DIR)/dmadata/compress_ranges.txt &: $(BUILD_DIR)/spec
|
||||||
$(MKDMADATA) $< $(BUILD_DIR)/dmadata/dmadata_table_spec.h $(BUILD_DIR)/dmadata/compress_ranges.txt
|
$(MKDMADATA) $< $(BUILD_DIR)/dmadata/dmadata_table_spec.h $(BUILD_DIR)/dmadata/compress_ranges.txt
|
||||||
|
|
||||||
# Dependencies for files that may include the dmadata header automatically generated from the spec file
|
# Dependencies for files that may include the dmadata header automatically generated from the spec file
|
||||||
|
@ -637,7 +638,7 @@ $(BUILD_DIR)/assets/text/message_data_static.o: $(BUILD_DIR)/assets/text/message
|
||||||
$(BUILD_DIR)/assets/text/staff_message_data_static.o: $(BUILD_DIR)/assets/text/message_data_staff.enc.h
|
$(BUILD_DIR)/assets/text/staff_message_data_static.o: $(BUILD_DIR)/assets/text/message_data_staff.enc.h
|
||||||
$(BUILD_DIR)/src/code/z_message.o: $(BUILD_DIR)/assets/text/message_data.enc.h $(BUILD_DIR)/assets/text/message_data_staff.enc.h
|
$(BUILD_DIR)/src/code/z_message.o: $(BUILD_DIR)/assets/text/message_data.enc.h $(BUILD_DIR)/assets/text/message_data_staff.enc.h
|
||||||
|
|
||||||
$(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/$(SPEC)
|
$(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/spec
|
||||||
$(FADO) $$(tools/buildtools/reloc_prereq $< $(*F)) -n $(*F) -o $(@:.o=.s) -M $(@:.o=.d)
|
$(FADO) $$(tools/buildtools/reloc_prereq $< $(*F)) -n $(*F) -o $(@:.o=.s) -M $(@:.o=.d)
|
||||||
$(AS) $(ASFLAGS) $(ENDIAN) $(IINC) $(@:.o=.s) -o $@
|
$(AS) $(ASFLAGS) $(ENDIAN) $(IINC) $(@:.o=.s) -o $@
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ DATA_OUT = "data/"
|
||||||
def discard_decomped_files(files_spec, include_files):
|
def discard_decomped_files(files_spec, include_files):
|
||||||
root_path = Path(__file__).parent.parent.parent
|
root_path = Path(__file__).parent.parent.parent
|
||||||
|
|
||||||
with open(root_path / "spec", "r") as f:
|
with open(root_path / "spec/spec", "r") as f:
|
||||||
spec = f.read()
|
spec = f.read()
|
||||||
# No need to check anything beyond here
|
# No need to check anything beyond here
|
||||||
spec = spec[: spec.find('name "gameplay_keep"')].splitlines()[:-2]
|
spec = spec[: spec.find('name "gameplay_keep"')].splitlines()[:-2]
|
||||||
|
|
Loading…
Reference in New Issue