home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / launch / mosmlc.tpl < prev    next >
Encoding:
Text File  |  1997-08-18  |  1.7 KB  |  84 lines  |  [TEXT/R*ch]

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