home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / launch / mosmlc.tpl < prev    next >
Encoding:
Text File  |  1996-07-03  |  1.5 KB  |  76 lines  |  [TEXT/R*ch]

  1. #!/bin/sh
  2.  
  3. stdlib=LIBDIR
  4.  
  5. linkalso=true
  6. includes=""
  7. compopt=""
  8. linkopt=""
  9. custom=""
  10. linkfiles=""
  11. cc=gcc
  12. ccfiles=""
  13. cclib=""
  14. ccopt=""
  15. linkout=a.out
  16.  
  17. while : ; do
  18.   case $1 in
  19.     "")
  20.       break;;
  21.     *.sml)
  22.       camlrunm $stdlib/mosmlcmp -stdlib $stdlib $includes $compopt $1 || exit $?
  23.       linkfiles="$linkfiles $1";;
  24.     *.sig)
  25.       camlrunm $stdlib/mosmlcmp -stdlib $stdlib $includes $compopt $1 || exit $?
  26.       ;;
  27.     *.uo)
  28.       linkfiles="$linkfiles $1";;
  29.     -c)
  30.       linkalso=false;;      
  31.     -I|-include)
  32.       includes="$includes -I $2"
  33.       shift;;
  34.     -P|-perv)
  35.       compopt="$compopt -P $2"
  36.       linkopt="$linkopt -P $2"
  37.       shift;;
  38.     -q|-quotation)
  39.       compopt="$compopt $1";;
  40.     -i)
  41.       compopt="$compopt $1";;
  42.     -g|-debug)
  43.       compopt="$compopt $1"
  44.       linkopt="$linkopt $1";;
  45.     -noheader)
  46.       linkopt="$linkopt $1";;
  47.     -o|-exec)
  48.       linkout=$2
  49.       shift;;
  50.     -stdlib)
  51.       stdlib=$2
  52.       shift;;
  53.     -v|-version)
  54.       echo "The Moscow ML system, version 1.31"
  55.       echo "  (standard library from $stdlib)"
  56.       camlrunm -V
  57.       camlrunm $stdlib/mosmlcmp -version
  58.       camlrunm $stdlib/mosmllnk -version;;
  59.     -files)
  60.       linkfiles="$linkfiles $1 $2"
  61.       shift;;
  62.     -*)
  63.       echo "Unknown option \"$1\", ignored" >&2;;
  64.     *)
  65.       echo "I don't know what to do with file \"$1\", ignored" >&2;;
  66.   esac
  67.   shift
  68. done
  69.  
  70. if $linkalso && test -n "$linkfiles"; then
  71.   camlrunm $stdlib/mosmllnk -stdlib $stdlib $includes $custom $linkopt \
  72.     -exec $linkout $linkfiles || exit $?
  73. fi
  74.  
  75. exit 0
  76.