From 9877d543f4daa04eb63dcd6ddf86c9bf23dd526f Mon Sep 17 00:00:00 2001 From: TiagoRG Date: Fri, 19 Apr 2024 09:59:05 +0100 Subject: [PATCH] [AC2] Add pfull script Signed-off-by: TiagoRG --- 2ano/2semestre/ac2/pfull | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 2ano/2semestre/ac2/pfull diff --git a/2ano/2semestre/ac2/pfull b/2ano/2semestre/ac2/pfull new file mode 100755 index 0000000..4af26e8 --- /dev/null +++ b/2ano/2semestre/ac2/pfull @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + 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