link_console.sh 584 B

123456789101112131415161718192021222324252627282930
  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 console programs.
  5. CURDIR=$(pwd)
  6. FBASE=$1
  7. FPATH=${FBASE%/*}
  8. FBASE=${FBASE##*/}
  9. VOCDIR=$CURDIR/data/bin/voc
  10. CC=gcc
  11. if [ "$FNAME" != "$FPATH" ]; then
  12. cd $FPATH
  13. fi
  14. shift
  15. ARGS=
  16. while [ "$1" != "" ]; do
  17. ARGS="$ARGS $1.o"
  18. if [ -f "$1/$1.c" ]; then
  19. ARGS="$ARGS $1/$1.o"
  20. fi
  21. shift
  22. done
  23. $CC -fPIC -g -I $VOCDIR/C/include \
  24. -o $FBASE $FBASE.o \
  25. $ARGS \
  26. $VOCDIR/lib/libvoc-OC.a
  27. retcode=$?
  28. exit $retcode