link_graph.sh 789 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. # This script is run by Free Oberon on Linux. Current directory of the
  3. # script will be where FreeOberon executable is located. This
  4. # particular script is for graphical programs.
  5. CURDIR=$(pwd)
  6. FBASE=$1
  7. FPATH=${FBASE%/*}
  8. FBASE=${FBASE##*/}
  9. VOCDIR=$CURDIR/data/bin/voc
  10. Al4Opts=`allegro-config --cflags --libs`
  11. CC=gcc
  12. if [ "$FNAME" != "$FPATH" ]; then
  13. cd $FPATH
  14. fi
  15. shift
  16. ARGS=
  17. while [ "$1" != "" ]; do
  18. ARGS="$ARGS $1.o"
  19. if [ -f "$1/$1.c" ]; then
  20. ARGS="$ARGS $1/$1.o"
  21. fi
  22. shift
  23. done
  24. $CC -fPIC -g -I $VOCDIR/C/include \
  25. -o $FBASE $FBASE.o \
  26. $ARGS \
  27. $VOCDIR/lib/Graph.o $VOCDIR/lib/Allegro.o \
  28. $VOCDIR/lib/Semaphore.o \
  29. $VOCDIR/lib/Semaphore/Semaphore.o \
  30. $VOCDIR/lib/Signals.o \
  31. $VOCDIR/lib/libvoc-OC.a \
  32. $Al4Opts -lloadpng
  33. retcode=$?
  34. exit $retcode