1 # The Evaluator -- Compile a Solution
2 # (c) 2001 Martin Mares <mj@ucw.cz>
4 pstart "Locating source... "
5 if [ -f $SDIR/$PROBLEM.c ] ; then
8 elif [ -f $SDIR/$PROBLEM.cc ] ; then
11 elif [ -f $SDIR/$PROBLEM.p ] ; then
16 echo "Source not found."
20 echo "Source file: $TDIR/$SRCN copied from $SDIR/$SRCN"
22 cp $SDIR/$SRCN $TDIR/$SRCN
23 if [ -n "$EXTRAS" ] ; then
24 echo "Extras: $EXTRAS"
25 for a in $EXTRAS ; do cp $PDIR/$a $TDIR/ ; done
27 for a in $SRCN $EXTRAS ; do cp $TDIR/$a $BOXDIR/ ; done
28 echo "Language: $LANG"
32 CCMD="`eval echo ${!CCMD}`"
33 COMP_SANDBOX_OPTS="`eval echo $COMP_SANDBOX_OPTS`"
34 echo "Compiler command: $CCMD"
35 echo "Compiler sandbox options: $COMP_SANDBOX_OPTS"
38 pstart "Compiling... "
41 if ! $BOXCMD $COMP_SANDBOX_OPTS -- $CCMD 2>$TDIR/compile.out ; then
42 COMPILE_MSG=`cat $TDIR/compile.out`
43 pend "FAILED: $COMPILE_MSG"
48 if [ ! -f $BOXDIR/$PROBLEM ] ; then
49 pend "FAILED: Missing executable file"
50 echo "Missing executable file"
54 cp -a $BOXDIR/$PROBLEM $EXE
57 echo "Executable file: $EXE"