mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-25 09:45:02 +00:00
Move roms to build folder (#1651)
* Move built roms to build directory, along with rename map and linker script * PR review * sym_info fix * Revert docs/tutorial/data.md change
This commit is contained in:
parent
8db76a27da
commit
5785c7adfb
12 changed files with 24 additions and 22 deletions
16
Makefile
16
Makefile
|
@ -187,9 +187,11 @@ DISASM_FLAGS += --config-dir $(DISASM_DATA_DIR) --symbol-addrs $(DISASM_DATA_DIR
|
||||||
#### Files ####
|
#### Files ####
|
||||||
|
|
||||||
# ROM image
|
# ROM image
|
||||||
ROMC := oot-$(VERSION)-compressed.z64
|
ROM := $(BUILD_DIR)/oot-$(VERSION).z64
|
||||||
ROM := oot-$(VERSION).z64
|
ROMC := $(ROM:.z64=-compressed.z64)
|
||||||
ELF := $(ROM:.z64=.elf)
|
ELF := $(ROM:.z64=.elf)
|
||||||
|
MAP := $(ROM:.z64=.map)
|
||||||
|
LDSCRIPT := $(ROM:.z64=.ld)
|
||||||
# description of ROM segments
|
# description of ROM segments
|
||||||
SPEC := spec
|
SPEC := spec
|
||||||
|
|
||||||
|
@ -342,7 +344,7 @@ ifneq ($(COMPARE),0)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(ROMC) $(ROM) $(ELF) $(BUILD_DIR)
|
$(RM) -r $(BUILD_DIR)
|
||||||
|
|
||||||
assetclean:
|
assetclean:
|
||||||
$(RM) -r $(ASSET_BIN_DIRS)
|
$(RM) -r $(ASSET_BIN_DIRS)
|
||||||
|
@ -392,8 +394,8 @@ $(ROMC): $(ROM) $(ELF) $(BUILD_DIR)/compress_ranges.txt
|
||||||
$(PYTHON) tools/compress.py --in $(ROM) --out $@ --dma-range `./tools/dmadata_range.sh $(NM) $(ELF)` --compress `cat $(BUILD_DIR)/compress_ranges.txt` --threads $(N_THREADS)
|
$(PYTHON) tools/compress.py --in $(ROM) --out $@ --dma-range `./tools/dmadata_range.sh $(NM) $(ELF)` --compress `cat $(BUILD_DIR)/compress_ranges.txt` --threads $(N_THREADS)
|
||||||
$(PYTHON) -m ipl3checksum sum --cic 6105 --update $@
|
$(PYTHON) -m ipl3checksum sum --cic 6105 --update $@
|
||||||
|
|
||||||
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(BUILD_DIR)/ldscript.txt $(BUILD_DIR)/undefined_syms.txt
|
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) $(OVL_RELOC_FILES) $(LDSCRIPT) $(BUILD_DIR)/undefined_syms.txt
|
||||||
$(LD) -T $(BUILD_DIR)/undefined_syms.txt -T $(BUILD_DIR)/ldscript.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(BUILD_DIR)/z64.map -o $@
|
$(LD) -T $(LDSCRIPT) -T $(BUILD_DIR)/undefined_syms.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $(MAP) -o $@
|
||||||
|
|
||||||
## Order-only prerequisites
|
## Order-only prerequisites
|
||||||
# These ensure e.g. the O_FILES are built before the OVL_RELOC_FILES.
|
# These ensure e.g. the O_FILES are built before the OVL_RELOC_FILES.
|
||||||
|
@ -410,7 +412,7 @@ $(O_FILES): | asset_files
|
||||||
$(BUILD_DIR)/$(SPEC): $(SPEC)
|
$(BUILD_DIR)/$(SPEC): $(SPEC)
|
||||||
$(CPP) $(CPPFLAGS) $< | $(SPEC_REPLACE_VARS) > $@
|
$(CPP) $(CPPFLAGS) $< | $(SPEC_REPLACE_VARS) > $@
|
||||||
|
|
||||||
$(BUILD_DIR)/ldscript.txt: $(BUILD_DIR)/$(SPEC)
|
$(LDSCRIPT): $(BUILD_DIR)/$(SPEC)
|
||||||
$(MKLDSCRIPT) $< $@
|
$(MKLDSCRIPT) $< $@
|
||||||
|
|
||||||
$(BUILD_DIR)/undefined_syms.txt: undefined_syms.txt
|
$(BUILD_DIR)/undefined_syms.txt: undefined_syms.txt
|
||||||
|
|
|
@ -127,16 +127,16 @@ Make sure your path to the project is not too long, otherwise this process may e
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
If all goes well, a new ROM called "oot-gc-eu-mq-dbg.z64" should be built and the following text should be printed:
|
If all goes well, a new ROM should be built at `build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg.z64`, and the following text printed:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
oot-gc-eu-mq-dbg.z64: OK
|
build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg.z64: OK
|
||||||
```
|
```
|
||||||
|
|
||||||
If you instead see the following:
|
If you instead see the following:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
oot-gc-eu-mq-dbg.z64: FAILED
|
build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg.z64: FAILED
|
||||||
md5sum: WARNING: 1 computed checksum did NOT match
|
md5sum: WARNING: 1 computed checksum did NOT match
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
5831385a7f216370cdbea55616b12fed oot-gc-eu-mq-dbg-compressed.z64
|
5831385a7f216370cdbea55616b12fed build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg-compressed.z64
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
f0b7f35375f9cc8ca1b2d59d78e35405 oot-gc-eu-mq-dbg.z64
|
f0b7f35375f9cc8ca1b2d59d78e35405 build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg.z64
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1618403427e4344a57833043db5ce3c3 oot-gc-eu-mq-compressed.z64
|
1618403427e4344a57833043db5ce3c3 build/gc-eu-mq/oot-gc-eu-mq-compressed.z64
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1a438f4235f8038856971c14a798122a oot-gc-eu-mq.z64
|
1a438f4235f8038856971c14a798122a build/gc-eu-mq/oot-gc-eu-mq.z64
|
||||||
|
|
|
@ -3,8 +3,8 @@ def add_custom_arguments(parser):
|
||||||
|
|
||||||
def apply(config, args):
|
def apply(config, args):
|
||||||
version = args.oot_version
|
version = args.oot_version
|
||||||
config['mapfile'] = f'build/{version}/z64.map'
|
config['mapfile'] = f'build/{version}/oot-{version}.map'
|
||||||
config['myimg'] = f'oot-{version}.z64'
|
config['myimg'] = f'build/{version}/oot-{version}.z64'
|
||||||
config['baseimg'] = f'baseroms/{version}/baserom-decompressed.z64'
|
config['baseimg'] = f'baseroms/{version}/baserom-decompressed.z64'
|
||||||
config['makeflags'] = [f'VERSION={version}']
|
config['makeflags'] = [f'VERSION={version}']
|
||||||
config['source_directories'] = ['src', 'include', 'spec']
|
config['source_directories'] = ['src', 'include', 'spec']
|
||||||
|
|
|
@ -52,7 +52,7 @@ code. In order to keep the code readable, we should try to minimize the amount o
|
||||||
```
|
```
|
||||||
|
|
||||||
where `N` is the number of cores on your machine. This will build into
|
where `N` is the number of cores on your machine. This will build into
|
||||||
`build/gc-eu-mq` and produce `oot-gc-eu-mq.z64`.
|
`build/gc-eu-mq` and produce `build/gc-eu-mq/oot-gc-eu-mq.z64`.
|
||||||
|
|
||||||
If you later want to delete all output files, run
|
If you later want to delete all output files, run
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ def firstDiffMain():
|
||||||
|
|
||||||
buildFolder = Path("build") / args.oot_version
|
buildFolder = Path("build") / args.oot_version
|
||||||
|
|
||||||
BUILTROM = Path(f"oot-{args.oot_version}.z64")
|
BUILTROM = buildFolder / f"oot-{args.oot_version}.z64"
|
||||||
BUILTMAP = buildFolder / "z64.map"
|
BUILTMAP = buildFolder / f"oot-{args.oot_version}.map"
|
||||||
|
|
||||||
EXPECTEDROM = Path(f"baseroms/{args.oot_version}/baserom-decompressed.z64")
|
EXPECTEDROM = Path(f"baseroms/{args.oot_version}/baserom-decompressed.z64")
|
||||||
EXPECTEDMAP = "expected" / BUILTMAP
|
EXPECTEDMAP = "expected" / BUILTMAP
|
||||||
|
|
|
@ -61,7 +61,7 @@ def IsCFile(objfile):
|
||||||
srcfile = objfile.strip().replace("build/gc-eu-mq-dbg/", "").replace(".o", ".c")
|
srcfile = objfile.strip().replace("build/gc-eu-mq-dbg/", "").replace(".o", ".c")
|
||||||
return os.path.isfile(srcfile)
|
return os.path.isfile(srcfile)
|
||||||
|
|
||||||
mapFile = ReadAllLines("build/gc-eu-mq-dbg/z64.map")
|
mapFile = ReadAllLines("build/gc-eu-mq-dbg/oot-gc-eu-mq-dbg.map")
|
||||||
curSegment = None
|
curSegment = None
|
||||||
src = 0
|
src = 0
|
||||||
code = 0
|
code = 0
|
||||||
|
|
|
@ -14,7 +14,7 @@ def symInfoMain():
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
BUILTMAP = Path("build") / args.oot_version / "z64.map"
|
BUILTMAP = Path("build") / args.oot_version / f"oot-{args.oot_version}.map"
|
||||||
|
|
||||||
mapPath = BUILTMAP
|
mapPath = BUILTMAP
|
||||||
if args.use_expected:
|
if args.use_expected:
|
||||||
|
|
|
@ -162,7 +162,7 @@ parser.add_argument("--num-out", help="number of functions to display", type=int
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
rom_bytes = read_rom()
|
rom_bytes = read_rom()
|
||||||
map_syms = parse_map(build_dir + "z64.map")
|
map_syms = parse_map(build_dir + "oot-gc-eu-mq-dbg.map")
|
||||||
map_offsets = get_map_offsets(map_syms)
|
map_offsets = get_map_offsets(map_syms)
|
||||||
|
|
||||||
s_files = get_all_s_files()
|
s_files = get_all_s_files()
|
||||||
|
|
Loading…
Reference in a new issue