1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#!/bin/sh
if [ x"$LD_LIBRARY_PATH" = x ]
then
LD_LIBRARY_PATH=.
else
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
fi
export LD_LIBRARY_PATH
if test "x$1" = x
then
echo "*** $0: argument is missing" 2>&1
exit 1
fi
if test ! -f "$1"
then
echo "*** $0: could not find $1" 2>&1
exit 1
fi
base=`basename "$1" .c`
if test ! "${base}.c" = "$1"
then
base=`basename "$1" .cc`
if test ! "${base}.cc" = "$1"
then
echo "*** $0: could not recognize extension" 2>&1
exit 1
fi
fi
startupfile=`echo "$base" | sed -e 's,test,ccmalloc,'`
if test ! -f "$startupfile"
then
echo "*** $0: could not find startup file $startupfile" 2>&1
exit 1
fi
rm -f .ccmalloc
ln -s $startupfile .ccmalloc
target=${base}.exe
echo "compiling" $1
make $target 2>&1 > /dev/null || exit 1
if test ! "x$REMOVE_TEMPORARIES" = x
then
rm -f ${base}.o
fi
echo "running " $target
./execute $target
if test ! "x$REMOVE_TEMPORARIES" = x
then
rm -f $target
fi
|