Rust-for-Arduboy/run

31 lines
1.4 KiB
Text
Raw Normal View History

2023-08-06 18:14:49 +02:00
#!/bin/bash
option=$1
upload(){
cargo build -p $option --release && cp ./target/arduboy/release/lib$option.a ./arduboy-rust/Wrapper-Project/lib/libgame.a && cd arduboy-rust/Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./build/$option.hex && pio run -t clean && rm lib/libgame.a && cd ../../
}
2023-09-20 14:05:43 +02:00
start(){
if upload ; then
echo "all fine"
else
echo Usage: for uploading your game \|./run.sh
echo Usage: for uploading an example game \| ./run.sh \<Example Game\>
fi
}
2023-08-06 18:14:49 +02:00
if [ -z "$option" ]
then
cargo build -p game --release && cp ./target/arduboy/release/libgame.a ./arduboy-rust/Wrapper-Project/lib/libgame.a && cd arduboy-rust/Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./build/game.hex && pio run -t clean && rm lib/libgame.a && cd ../../
2023-08-16 14:46:00 +02:00
elif [ "$option" = "doc" ]
then
cargo doc -p arduboy-rust && rm -r ./docs/doc/ && cp -r ./target/arduboy/doc ./docs/
elif [ "$option" = "eeprom-byte" ]
then
cargo build -p eeprom-byte --release && cp ./target/arduboy/release/libeeprom_byte.a ./arduboy-rust/Wrapper-Project/lib/libgame.a && cd arduboy-rust/Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./build/eeprom-byte.hex && pio run -t clean && rm lib/libgame.a && cd ../../
2023-08-06 18:14:49 +02:00
else
2023-09-20 14:05:43 +02:00
start
2023-09-11 09:24:37 +02:00
# echo Usage: for uploading your game \|./run.sh
# echo Usage: for uploading an example game \| ./run.sh \<Example Game\>
2023-08-06 18:14:49 +02:00
fi