Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/xmakeml
ViewVC logotype

View of /sml/trunk/src/compiler/xmakeml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 258 - (download) (annotate)
Wed Apr 21 23:58:52 1999 UTC (20 years, 3 months ago) by monnier
File size: 3096 byte(s)
*** empty log message ***
#!/bin/ksh
#

ELAB=""
FULL=""
ALLOC=1M

ARCH=x86
OPSYS=linux
RUN_DIR=../../bin/.run
OBJS_DIR=../runtime/objs
HEAP_IMAGE=""
RUN=""
RUN_ARGS=""
SET_FLAGS=""

DATE=''

#
# use the arch-n-opsys script to determine the ARCH/OS if possible
#
if [ -f ../../bin/.arch-n-opsys ]; then
  ARCH_N_OPSYS=`../../bin/.arch-n-opsys`
  if [ "$?" = "0" ]; then
    eval $ARCH_N_OPSYS
  fi
fi

while [ "$#" != "0" ]
do
  arg=$1; shift
  case $arg in
    -elab) ELAB="@SMLelab" ;;
    -date)	DATE='print "[built `date`]\n";' ;;
    -nodate)	DATE='' ;;
    -full) 
      FULL="@SMLfull" 
      NOTE="[-full]\n$NOTE"
    ;;
    -note) 
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-note\" option"
	exit 1
      fi
      NOTE="$1\n"; shift
    ;;
    -arch)
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-arch\" option"
	exit 1
      fi
      ARCH=$1; shift
    ;;
    -opsys)
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-opsys\" option"
	exit 1
      fi
      OPSYS=$1; shift
    ;;
    -o)
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-o\" option"
	exit 1
      fi
      HEAP_IMAGE=$1; shift
    ;;
    -run)
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-run\" option"
	exit 1
      fi
      RUN=$1; shift
    ;;
    -alloc)
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-alloc\" option"
	exit 1
      fi
      ALLOC=$1; shift
    ;;
    -boot)
      if [ "$#" = "0" ]; then
        echo "xmakeml: missing argument for \"-boot\" option"
	exit 1
      fi
      BOOT_DIR=$1; shift
    ;;
    @SML*)
      RUN_ARGS="$RUN_ARGS $arg"
    ;;
    *) echo "xmakeml: unknown argument \"$arg\""
       exit 1
    ;;
  esac
done

case $OPSYS in
  solaris) MAKE=/usr/ccs/bin/make ;;
esac

if [ "$RUN" = "" ]; then
  if [ "$OPSYS" = "win32" ]; then
    RUN_CMD="run.$ARCH-$OPSYS.exe"
  else
    RUN_CMD="run.$ARCH-$OPSYS"
  fi
  if [ -x "$RUN_DIR/$RUN_CMD" ]; then
    RUN="$RUN_DIR/$RUN_CMD"
  elif [ -x "$OBJS_DIR/$RUN_CMD" ]; then
    RUN="$OBJS_DIR/$RUN_CMD"
  else
    echo "xmakeml: unable to find run-time system \"$RUN_DIR/$RUN_CMD\""
    exit 1
  fi
fi

if [ "$HEAP_IMAGE" = "" ]; then
  if [ "$FULL" = "" ]; then
    HEAP_IMAGE="sml"
  else
    HEAP_IMAGE="sml-full"
  fi
fi

if [ "$BOOT_DIR" = "" ]; then
  BOOT_DIR="./bin.$ARCH-unix"
fi

if [ ! -d ./bin.$ARCH-unix ]; then
  ln -s $BOOT_DIR ./bin.$ARCH-unix
fi

#echo "$RUN @SMLboot=$BOOT_DIR @SMLalloc=$ALLOC $RUN_ARGS $ELAB $FULL -b $BOOT_DIR"
#$RUN @SMLboot=$BOOT_DIR @SMLalloc=$ALLOC $RUN_ARGS $ELAB $FULL -b $BOOT_DIR <<XXXX
echo "$RUN @SMLboot=$BOOT_DIR @SMLalloc=$ALLOC $RUN_ARGS $ELAB $FULL"
      $RUN @SMLboot=$BOOT_DIR @SMLalloc=$ALLOC $RUN_ARGS $ELAB $FULL <<XXXX
$SET_FLAGS
val use = Compiler.Interact.useFile;
val _ = (SMLofNJ.exportML "$HEAP_IMAGE";
	 print Compiler.banner; print "\n";
         $DATE print "$NOTE");
XXXX

output="$HEAP_IMAGE.$ARCH-$OPSYS"
[ -r "$output" ] && chmod +x "$output"

#  if [ -L ./bin.$ARCH-unix ]; then
#    rm -f ./bin.$ARCH-unix
#  fi

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0