From ed0fb16d5360373839bd1717982cd8a3e397b686 Mon Sep 17 00:00:00 2001 From: Timerix22 Date: Tue, 31 May 2022 19:34:52 +0300 Subject: [PATCH] compilation error checking --- build_scripts/functions.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build_scripts/functions.sh b/build_scripts/functions.sh index ff45314..15939de 100644 --- a/build_scripts/functions.sh +++ b/build_scripts/functions.sh @@ -21,9 +21,15 @@ function compile { print "${BLUE}args: ${GRAY}$args\n" local sources=$5 print "${BLUE}sources: ${GRAY}$sources\n" - for SRCFILE in $sources + for srcfile in $sources do - $cmp -std=$std $warn $args -c -o "$OBJDIR/$(basename $SRCFILE).o" $SRCFILE + local object="$OBJDIR/$(basename $srcfile).o" + #print "$BLUE$object\n" + if ! $($cmp -std=$std $warn $args -c -o $object $srcfile) + then + print "${RED}some error happened\n" + exit 1 + fi done } @@ -54,6 +60,6 @@ function link { rm -rf $OBJDIR else print "${RED}some error happened\n" - exit + exit 1 fi }