#!/bin/sh

#
# Script to build cm2mlb.
#
# by: Jana Dunfield
#
# Use this, unless you enjoy copying and pasting instructions from
#  comments inside source files.
#
# Requires that $SMLNJ_HOME be set appropriately.

echo 'CM.make "sources.cm"; CM2MLB.export();' | sml
HEAP_SUFFIX=`$SMLNJ_HOME/bin/.arch-n-opsys | sed -e 's/.*HEAP_SUFFIX=//'`
rm $SMLNJ_HOME/bin/cm2mlb 2> /dev/null
ln -s $SMLNJ_HOME/bin/.run-sml $SMLNJ_HOME/bin/cm2mlb 2> /dev/null
mv cm2mlb.$HEAP_SUFFIX $SMLNJ_HOME/bin/.heap
