mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
add script to find (and optionally delete) old/unused asm files and delete all currently present old/unused asm files. (#65)
This commit is contained in:
parent
a45e7920bc
commit
d263b9dabd
50 changed files with 31 additions and 2308 deletions
31
tools/find_unused_asm.sh
Executable file
31
tools/find_unused_asm.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/bash
|
||||
|
||||
shopt -s globstar
|
||||
|
||||
ls asm/non_matchings/**/*.s > old_list.txt
|
||||
grep GLOBAL_ASM -r src | cut -d '"' -f2 - > cur_list.txt
|
||||
|
||||
grep -F "build/data" spec | cut -d '"' -f2 - > data_list.txt
|
||||
grep -F "build/asm" spec | grep -v -E 'overlays' | cut -d '"' -f2 - >> data_list.txt
|
||||
|
||||
ls data/**/*.s > old_data_list.txt
|
||||
ls asm/*.s >> old_data_list.txt
|
||||
|
||||
while read p; do
|
||||
tmp=${p%.o}.s
|
||||
echo ${tmp#build/} >> list.txt
|
||||
done < data_list.txt
|
||||
|
||||
comm -3 <(sort old_list.txt) <(sort cur_list.txt) > diff.txt
|
||||
comm -3 <(sort old_data_list.txt) <(sort list.txt) >> diff.txt
|
||||
|
||||
if [ "$1" = "-d" ]
|
||||
then
|
||||
if [ -s diff.txt ]
|
||||
then
|
||||
git rm $(cat diff.txt)
|
||||
fi
|
||||
rm diff.txt
|
||||
fi
|
||||
|
||||
rm old_list.txt cur_list.txt old_data_list.txt data_list.txt list.txt
|
Loading…
Add table
Add a link
Reference in a new issue