compile.sh 597 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # This script is run by FreeOberon on Linux.
  3. # Current directory of the script will be where
  4. # FreeOberon executable is located.
  5. # This particular script is for graphical programs.
  6. cd bin
  7. VOCDIR=../data/bin/voc
  8. VOC=$VOCDIR/bin/voc
  9. CC=gcc
  10. $VOC -OC -cfFm ../Programs/$1
  11. retcode=$?
  12. if [ "$retcode" -eq "0" ]; then
  13. THENAME="${1%.*}"
  14. ONAME="${THENAME##*/}"
  15. SDL2Opts=`sdl2-config --cflags --libs`
  16. $CC -fPIC -g -I $VOCDIR/C/include \
  17. -o $ONAME $ONAME.o \
  18. $VOCDIR/lib/Graph.o $VOCDIR/lib/SDL2.o \
  19. $VOCDIR/lib/libvoc-OC.a \
  20. $SDL2Opts -lSDL2_image
  21. fi
  22. cd ..
  23. exit $retcode