if [[ $# = 0 ]]
then
   echo "Usage: $0 CircuitFile [SupportFiles]"
   exit 1
fi

if ! test -f $1.cc
then
   echo "Error: curcuit file '$1.cc' not found"
   exit 1
fi

FILES=""
for i in $*
do
   FILES=$FILES" $i.cc"
done

echo Input files: $FILES

g++ -g -o $1 \
   -I/home/cheung/lib/LogicSim $FILES \
   -L/home/cheung/lib/LogicSim -lLogicSim -L/usr/lib/X11 -lX11

