Get matching library.c file

This commit is contained in:
Ryan Dwyer 2019-09-29 15:18:36 +10:00
parent 0994436231
commit dfbcf962f0
3 changed files with 97203 additions and 1 deletions

View File

@ -114,6 +114,25 @@ $(B_DIR)/files/L%P: $(B_DIR)/files/lang/L%P.bin
$(B_DIR)/files/L%Z: $(B_DIR)/files/lang/L%.bin $(B_DIR)/files/L%Z: $(B_DIR)/files/lang/L%.bin
tools/rarezip $< > $@ tools/rarezip $< > $@
################################################################################
# Library
library: $(B_DIR)/ucode/library.bin
$(B_DIR)/library.o: src/library.c
mkdir -p $(B_DIR)
python tools/asmpreproc/asm-processor.py -O2 $< | $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@ -O2
python tools/asmpreproc/asm-processor.py -O2 $< --post-process $@ --assembler "$(TOOLCHAIN)-as -march=vr4300 -mabi=32" --asm-prelude tools/asmpreproc/prelude.s
$(B_DIR)/library.elf: $(B_DIR)/library.o
cp $< build/library.tmp.o
$(TOOLCHAIN)-ld -e 0x00003050 -T ld/library.ld -o $@
rm -f build/library.tmp.o
$(B_DIR)/ucode/library.bin: $(B_DIR)/library.elf
mkdir -p $(B_DIR)/ucode
$(TOOLCHAIN)-objcopy $< $@ -O binary
################################################################################ ################################################################################
# Game setup file # Game setup file
@ -167,6 +186,7 @@ test: $(B_SETUP_BINZ_FILES) $(B_LANG_BINZ_FILES)
--exclude=ob \ --exclude=ob \
$(E_DIR)/files $(B_DIR)/files $(E_DIR)/files $(B_DIR)/files
@diff -q $(E_DIR)/ucode/setup.bin $(B_DIR)/ucode/setup.bin @diff -q $(E_DIR)/ucode/setup.bin $(B_DIR)/ucode/setup.bin
@diff -q $(E_DIR)/ucode/library.bin $(B_DIR)/ucode/library.bin
testall: testall:
REGION=ntsc RELEASE=final make test REGION=ntsc RELEASE=final make test
@ -179,7 +199,7 @@ testall:
################################################################################ ################################################################################
# Miscellaneous # Miscellaneous
all: setup lang stagesetup all: library setup lang stagesetup
rom: $(B_SETUP_BINZ_FILES) $(B_DIR)/ucode/setup.bin rom: $(B_SETUP_BINZ_FILES) $(B_DIR)/ucode/setup.bin
tools/inject pd.$(ROMID).z64 tools/inject pd.$(ROMID).z64

21
ld/library.ld Normal file
View File

@ -0,0 +1,21 @@
/*OUTPUT_FORMAT ("elf32-bigmips")*/
OUTPUT_ARCH (mips)
SECTIONS
{
.data 0x00003050 : AT(0x0000) {
build/library.tmp.o (.text);
build/library.tmp.o (.data);
}
/DISCARD/ : {
* (.MIPS.abiflags);
* (.options);
* (.gnu.attributes);
* (.pdr);
* (.mdebug);
* (.gptab.bss);
* (.gptab.data);
* (.reginfo);
}
}

97161
src/library.c Normal file

File diff suppressed because it is too large Load Diff