1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-12-01 22:52:39 +00:00
nxdumptool/build.sh

45 lines
1 KiB
Bash
Raw Normal View History

2020-09-23 02:13:39 +01:00
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")"
tar_filename="nxdumptool-rewrite_poc_$(git rev-parse --short HEAD).tar.bz2"
2020-09-23 02:13:39 +01:00
2020-10-10 11:10:50 +01:00
rm -f ./*.tar.bz2
2020-09-23 02:13:39 +01:00
rm -rf ./code_templates/tmp
mkdir ./code_templates/tmp
2020-11-21 06:13:50 +00:00
make clean
2020-09-23 02:13:39 +01: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-02-12 22:41:14 +00:00
make BUILD_TYPE="$filename" -j$(nproc)
2020-09-23 02:13:39 +01:00
mkdir ./code_templates/tmp/$filename
2020-10-26 20:17:57 +00:00
cp ./$filename.nro ./code_templates/tmp/$filename/nxdumptool-rewrite.nro
#cp ./$filename.elf ./code_templates/tmp/$filename/nxdumptool-rewrite.elf
rm -f ./build/main.o ./build/main.d ./build/utils.o ./build/utils.d ./build/usb.o ./build/usb.d ./build/log.o ./build/log.d ./$filename.*
2020-09-23 02:13:39 +01:00
done
2020-11-21 06:13:50 +00:00
make clean
2020-09-23 02:13:39 +01: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 ..."