parallel compilation
This commit is contained in:
parent
2e3f16905b
commit
a475b0d73c
@ -21,19 +21,20 @@ 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"
|
||||||
local error=0
|
local compilation_error=0
|
||||||
|
|
||||||
for srcfile in $sources
|
for srcfile in $sources
|
||||||
do
|
do (
|
||||||
local object="$OBJDIR/$(basename $srcfile).o"
|
local object="$OBJDIR/$(basename $srcfile).o"
|
||||||
#print "$BLUE$object\n"
|
|
||||||
if ! $($cmp -std=$std $warn $args -c -o $object $srcfile)
|
if ! $($cmp -std=$std $warn $args -c -o $object $srcfile)
|
||||||
then
|
then
|
||||||
print "${RED}some error happened\n"
|
print "${RED}some error happened\n"
|
||||||
error=1
|
compilation_error=1
|
||||||
fi
|
fi
|
||||||
done
|
) & done
|
||||||
|
wait
|
||||||
|
|
||||||
if [ $error != 0 ]
|
if [ $compilation_error != 0 ]
|
||||||
then
|
then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user