Pass toolchain to buildrom and add support for more mips toolchains
This commit is contained in:
parent
aeea97eb10
commit
946d22a6ae
6
Makefile
6
Makefile
|
|
@ -15,6 +15,10 @@ IRIX_ROOT := tools/irix/root
|
|||
|
||||
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
|
||||
TOOLCHAIN := mips-linux-gnu
|
||||
else ifeq ($(shell type mips64-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
|
||||
TOOLCHAIN := mips64-linux-gnu
|
||||
else ifeq ($(shell type mips-elf-ld >/dev/null 2>/dev/null; echo $$?), 0)
|
||||
TOOLCHAIN := mips-elf
|
||||
else
|
||||
TOOLCHAIN := mips64-elf
|
||||
endif
|
||||
|
|
@ -297,7 +301,7 @@ $(B_DIR)/stage1.bin: $(B_DIR)/stage1.elf
|
|||
all: $(UCODE_BIN_FILES) $(ASSET_O_FILES)
|
||||
|
||||
rom: $(UCODE_BIN_FILES) $(B_DIR)/ucode/gamezips.bin $(ASSET_O_FILES)
|
||||
tools/buildrom
|
||||
TOOLCHAIN=$(TOOLCHAIN) tools/buildrom
|
||||
tools/checksum build/ntsc-final/pd.z64 --write
|
||||
|
||||
clean:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
|
|
@ -116,7 +117,12 @@ def zip(filename):
|
|||
return subprocess.check_output(['tools/rarezip', filename])
|
||||
|
||||
def getlinkervariable(varname):
|
||||
objdump = subprocess.check_output(['mips64-elf-objdump', 'build/ntsc-final/stage1.elf', '-t']).decode('utf-8')
|
||||
if 'TOOLCHAIN' in os.environ:
|
||||
cmd = '%s-objdump' % os.environ['TOOLCHAIN']
|
||||
else:
|
||||
cmd = 'mips64-elf-objdump'
|
||||
|
||||
objdump = subprocess.check_output([cmd, 'build/ntsc-final/stage1.elf', '-t']).decode('utf-8')
|
||||
|
||||
matches = re.findall(r'^([0-9a-f]+) .*? %s$' % varname, objdump, re.MULTILINE)
|
||||
return int(matches[0], 16)
|
||||
|
|
|
|||
Loading…
Reference in New Issue