[AC2] Add pfull script

Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
This commit is contained in:
Tiago Garcia 2024-04-19 09:59:05 +01:00
parent 52d2fb1b3a
commit ba487bddfd
Signed by: TiagoRG
GPG Key ID: DFCD48E3F420DB42
1 changed files with 19 additions and 0 deletions

19
2ano/2semestre/ac2/pfull Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <source_file>"
exit
fi
file=${1##*/}
dir=${1%/*}
filename="${file%.*}"
cd "$dir" || exit
pcompile "$file" || exit
for f in *; do
if [[ "$f" =~ ^.+\.(o|elf|map|sym)$ ]]; then
rm "$f"
fi
done
ldpic32 "$filename.hex" || exit
pterm || exit
cd "$OLDPWD" || exit