compilation error checking

This commit is contained in:
Timerix22 2022-05-31 19:34:52 +03:00
parent b48405eae2
commit ed0fb16d53

View File

@ -21,9 +21,15 @@ function compile {
print "${BLUE}args: ${GRAY}$args\n" print "${BLUE}args: ${GRAY}$args\n"
local sources=$5 local sources=$5
print "${BLUE}sources: ${GRAY}$sources\n" print "${BLUE}sources: ${GRAY}$sources\n"
for SRCFILE in $sources for srcfile in $sources
do 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 done
} }
@ -54,6 +60,6 @@ function link {
rm -rf $OBJDIR rm -rf $OBJDIR
else else
print "${RED}some error happened\n" print "${RED}some error happened\n"
exit exit 1
fi fi
} }