2021-04-26 00:10:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
|
2022-03-22 19:55:06 +00:00
|
|
|
# Clean-up from last build
|
2021-04-26 00:10:34 +01:00
|
|
|
rm -rf ./code_templates/tmp
|
|
|
|
mkdir ./code_templates/tmp
|
|
|
|
|
|
|
|
mv ./source/main.cpp ./main.cpp
|
|
|
|
|
|
|
|
make clean_all
|
|
|
|
|
2023-07-21 23:53:56 +01:00
|
|
|
# Build PoC
|
|
|
|
poc_name="nxdt_rw_poc"
|
|
|
|
poc_path="./code_templates/$poc_name.c"
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2023-07-21 23:53:56 +01:00
|
|
|
rm -f ./source/main.c
|
|
|
|
cp $poc_path ./source/main.c
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2023-07-21 23:53:56 +01:00
|
|
|
cp ./romfs/icon/nxdumptool.jpg ./romfs/icon/$poc_name.jpg
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2023-07-21 23:53:56 +01:00
|
|
|
make BUILD_TYPE="$poc_name" -j$(nproc)
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2023-07-21 23:53:56 +01:00
|
|
|
rm -f ./romfs/icon/$poc_name.jpg
|
2022-07-05 02:04:28 +01:00
|
|
|
|
2023-07-21 23:53:56 +01:00
|
|
|
mv -f ./$poc_name.nro ./code_templates/tmp/$poc_name.nro
|
|
|
|
mv -f ./$poc_name.elf ./code_templates/tmp/$poc_name.elf
|
2021-04-26 00:10:34 +01:00
|
|
|
|
2022-03-22 19:55:06 +00:00
|
|
|
# Post build clean-up
|
2023-07-21 23:53:56 +01:00
|
|
|
make BUILD_TYPE="$poc_name" clean
|
2021-04-26 00:10:34 +01:00
|
|
|
make clean_all
|
|
|
|
|
|
|
|
rm -f ./source/main.c
|
2023-07-21 23:53:56 +01:00
|
|
|
mv -f ./main.cpp ./source/main.cpp
|