From 8468e83786783edd5e1386b2b7ab941d5e16a51d Mon Sep 17 00:00:00 2001 From: Kenix3 Date: Wed, 10 Mar 2021 22:11:32 -0500 Subject: [PATCH] Updates file_setup.sh script to split based on the asm files being in different sub directories --- Makefile | 1 - file_setup.sh | 15 ++++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4c3d814427..1608bcdf9f 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,6 @@ $(S_FILES): disasm disasm: tables/files.txt tables/functions.txt tables/objects.txt tables/variables.txt tables/vrom_variables.txt tables/pre_boot_variables.txt tables/files_with_nonmatching.txt ./tools/disasm.py -d ./asm -u . -l ./tables/files.txt -f ./tables/functions.txt -o ./tables/objects.txt -v ./tables/variables.txt -v ./tables/vrom_variables.txt -v ./tables/pre_boot_variables.txt @while read -r file; do \ - #echo "$$file" \ ./tools/split_asm.py ./asm/$$file.asm ./asm/non_matchings/$$file; \ done < ./tables/files_with_nonmatching.txt diff --git a/file_setup.sh b/file_setup.sh index 59efdb082b..66fd90a71f 100755 --- a/file_setup.sh +++ b/file_setup.sh @@ -7,18 +7,23 @@ then exit 1 fi +code_file=$1 +code_path=$2 + # If there are only two arguments, then we will use the non_matchings path to be the same as src_path if [ "$#" -eq "2" ]; then - 3=$2 + code_bucket=$code_path +else + code_bucket=$3 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/$3/$1" -echo "$1" >> tables/files_with_nonmatching.txt +tools/split_asm.py -c "./src/$code_path/$code_file.c" "./asm/$code_bucket/$code_file.asm" "./asm/non_matchings/$code_bucket/$code_file" +echo "$code_bucket/$code_file" >> 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 +sed -i "s/asm\/$code_file.o/src\/${2//\//\\\/}\/$code_file.o/g" linker_scripts/code_script.txt # Build with new file -make diff-init +make -j diff-init