nxdumptool/build.sh

45 lines
1 KiB
Bash
Raw Normal View History

2020-09-22 21:13:39 -04:00
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")"
tar_filename="nxdumptool-rewrite_poc_$(git rev-parse --short HEAD).tar.bz2"
2020-09-22 21:13:39 -04:00
2020-10-10 06:10:50 -04:00
rm -f ./*.tar.bz2
2020-09-22 21:13:39 -04:00
rm -rf ./code_templates/tmp
mkdir ./code_templates/tmp
2021-03-26 00:35:14 -04:00
make clean_all
2020-11-21 02:13:50 -04:00
2020-09-22 21:13:39 -04:00
for f in ./code_templates/*.c; do
basename="$(basename "$f")"
filename="${basename%.*}"
if [[ $filename == "dump_title_infos" ]]; then
continue
fi
echo $filename
rm -f ./source/main.c
cp $f ./source/main.c
2021-03-26 00:35:14 -04:00
make -j$(nproc)
2020-09-22 21:13:39 -04:00
mkdir ./code_templates/tmp/$filename
2021-03-26 00:35:14 -04:00
cp ./nxdumptool.nro ./code_templates/tmp/$filename/nxdumptool.nro
#cp ./nxdumptool.elf ./code_templates/tmp/$filename/nxdumptool.elf
2020-10-26 16:17:57 -04:00
2021-03-26 00:35:14 -04:00
rm -f ./build/main.o ./build/main.d ./build/nxdt_utils.o ./build/nxdt_utils.d ./build/usb.o ./build/usb.d ./build/nxdt_log.o ./build/nxdt_log.d ./nxdumptool.*
2020-09-22 21:13:39 -04:00
done
2021-03-26 00:35:14 -04:00
make clean_all
2020-11-21 02:13:50 -04:00
2020-09-22 21:13:39 -04:00
cd ./code_templates/tmp
tar -cjf ../../$tar_filename *
cd ../..
rm -f ./source/main.c
rm -rf ./code_templates/tmp
read -p "Press any key to finish ..."