[AED] Update setup.sh

Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
This commit is contained in:
Tiago Garcia 2023-10-12 15:05:01 +01:00
parent bc06566af1
commit 97b9a4710e
Signed by: TiagoRG
GPG Key ID: DFCD48E3F420DB42
1 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
cd "$parent_path" || exit
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo "Usage: $0 <source file>" echo "Usage: $0 <source file>"
exit 1 exit 1
@ -22,4 +25,9 @@ fi
gcc -Wall -Wextra -Werror -g -o "out/$out_dirname/${out_basename%.*}" "$1" -lm gcc -Wall -Wextra -Werror -g -o "out/$out_dirname/${out_basename%.*}" "$1" -lm
if [ $? -ne 0 ]; then
echo "Compilation failed"
exit 1
fi
out/"$out_dirname"/"${out_basename%.*}" out/"$out_dirname"/"${out_basename%.*}"