sm64/mydataasm_linux

7 lines
416 B
Bash

#!/bin/sh
mips-linux-gcc -fno-pic -mcpu=4300 -nostdinc -I$ROOT/usr/include -I$ROOT/usr/include/PR -mips1 -funsigned-char -O -c -Dyj -c -o tmp.o $1.c
mips-linux-ld -Tdata $2 -e $2 -o ttmp.o tmp.o
objdump -t ttmp.o | grep -v _fdata | perl -ne 'chomp; if (/([0-9a-fA-F]{8})\s+g\s+O\s\.data\s+[0-9a-fA-F]{8}\s+(\w+)/) { print "<$2>=($1)\n", $x; }'
mips-linux-objcopy -j .data -O binary ttmp.o $1.bin
rm -f tmp.o ttmp.o