mirror of https://github.com/zeldaret/mm.git
Add file_setup.sh to streamline first-time setup for each file
This commit is contained in:
parent
73893926c4
commit
57587fa612
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$#" -ne "2" ];
|
||||||
|
then
|
||||||
|
echo "usage: $0 file_name src_path"
|
||||||
|
echo "e.g. $0 z_actor code"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split asm file, create base c file, and add it to the list of non-matchings
|
||||||
|
tools/split_asm.py -c "src/$2/$1.c" "asm/$1.asm" "asm/non_matchings/$1"
|
||||||
|
echo "$1" >> tables/files_with_nonmatching.txt
|
||||||
|
|
||||||
|
# Edit linker script to use new .c file
|
||||||
|
sed -i "s/asm\/$1.o/src\/${2//\//\\\/}\/$1.o/g" linker_scripts/code_script.txt
|
||||||
|
|
||||||
|
# Build with new file
|
||||||
|
make build/code.elf
|
||||||
|
|
||||||
|
# Copy newly-built .o file to expected/ for use by the diff script
|
||||||
|
mkdir -p "expected/build/src/$2/"
|
||||||
|
cp "build/src/$2/$1.o" "expected/build/src/$2/$1.o"
|
||||||
|
|
@ -40,7 +40,10 @@ if __name__ == '__main__':
|
||||||
current_file.close()
|
current_file.close()
|
||||||
|
|
||||||
if args.c_base != None:
|
if args.c_base != None:
|
||||||
|
os.makedirs(os.path.dirname(args.c_base), exist_ok=True)
|
||||||
with open(args.c_base, 'w') as f:
|
with open(args.c_base, 'w') as f:
|
||||||
|
f.write('#include <ultra64.h>\n#include <global.h>\n\n')
|
||||||
|
|
||||||
for name in file_names:
|
for name in file_names:
|
||||||
f.write('GLOBAL_ASM("{}")\n\n'.format(name))
|
f.write('GLOBAL_ASM("{}")\n\n'.format(name))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue