1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 18:26:39 +00:00
nxdumptool/build.sh

48 lines
912 B
Bash
Raw Normal View History

#!/bin/bash
2024-02-16 23:19:29 +00:00
ARG=${1:-'--confirm'}
cd "$(dirname "${BASH_SOURCE[0]}")"
2022-03-22 19:55:06 +00:00
# Clean-up from last build
rm -rf ./code_templates/tmp
mkdir ./code_templates/tmp
mv ./source/main.cpp ./main.cpp
make clean_all
# Build PoC
poc_name="nxdt_rw_poc"
poc_path="./code_templates/$poc_name.c"
rm -f ./source/main.c
cp $poc_path ./source/main.c
cp ./romfs/icon/nxdumptool.jpg ./romfs/icon/$poc_name.jpg
2024-04-15 14:17:47 +01:00
set -e
if [ ${ARG,,} != "--noconfirm" ]; then
make BUILD_TYPE="$poc_name" -j$(nproc)
else
make BUILD_TYPE="$poc_name" -j8
fi
2024-04-15 14:17:47 +01:00
set +e
rm -f ./romfs/icon/$poc_name.jpg
mv -f ./$poc_name.nro ./code_templates/tmp/$poc_name.nro
mv -f ./$poc_name.elf ./code_templates/tmp/$poc_name.elf
2022-03-22 19:55:06 +00:00
# Post build clean-up
make BUILD_TYPE="$poc_name" clean
make clean_all
rm -f ./source/main.c
mv -f ./main.cpp ./source/main.cpp
2024-02-16 23:19:29 +00:00
if [ ${ARG,,} != "--noconfirm" ]; then
read -rsp $'Press any key to continue...\n' -n 1 key
fi