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

SCM Repository

[smlnj] Diff of /config/releases/release-110.71/_ml-build
ViewVC logotype

Diff of /config/releases/release-110.71/_ml-build

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 569, Tue Mar 7 04:01:07 2000 UTC revision 1744, Thu Dec 23 23:58:38 2004 UTC
# Line 1  Line 1 
1  #!@SHELL@  #!@SHELL@
2    
3  BIN_DIR=@BINDIR@  if [ x${SMLNJ_HOME} = x ] ; then
4        BIN_DIR="@BINDIR@"
5    else
6        if [ x"$CM_PATHCONFIG" = x ] ; then
7            CM_PATHCONFIG=${SMLNJ_HOME}/lib/pathconfig
8            export CM_PATHCONFIG
9        fi
10        BIN_DIR=${SMLNJ_HOME}/bin
11    fi
12    
13  SML=$BIN_DIR/sml  SML=$BIN_DIR/sml
14  LINK=$BIN_DIR/.link-sml  LINK=$BIN_DIR/.link-sml
# Line 11  Line 19 
19  smlfile=$xx-export.sml  smlfile=$xx-export.sml
20  cmfile=$xx-export.cm  cmfile=$xx-export.cm
21  listfile=$xx-BOOTLIST  listfile=$xx-BOOTLIST
22  mlscript=$xx-script  linkargsfile=$xx-LINKARGS
23    
24    dulist=''
25    
26  trap 'rm -rf `find . -name $smlfile` $cmfile $listfile $mlscript' 0 1 2 3 15  trap 'rm -rf $smlfile $cmfile $listfile $linkargsfile @CMDIRARC@/*/$smlfile' 0 1 2 3 15
27    
28  usage() {  usage() {
29      echo ${thisscript}: $*      echo ${thisscript}: $*
30      echo Usage: $thisscript root-group main-function heapfile      echo Usage: $thisscript '[-S setup] root-group [main-function [heapfile]]'
31      exit 1      exit 1
32  }  }
33    
34  if [ $# != 3 ] ; then  setup=
     usage wrong number of arguments  
 fi  
35    
36    while [ $# != 0 ] ; do
37        case $1 in
38        -D*|-U*|-C*)
39            dulist="$dulist $1"
40            shift
41            ;;
42        -S)
43            shift
44            if [ $# = 0 ] ; then
45                usage missing argument for -S
46            fi
47            setup=$1
48            shift
49            ;;
50        *)
51            break
52            ;;
53        esac
54    done
55    
56    if [ $# = 4 ] ; then
57        setup=$1
58        root=$2
59        main=$3
60        heap=$4
61    elif [ $# = 3 ] ; then
62  root=$1  root=$1
63  main=$2  main=$2
64  heap=$3  heap=$3
65    elif [ $# = 2 ] ; then
66        root=$1
67        main=$2
68        heap=`basename "$root" .cm`
69    elif [ $# = 1 ] ; then
70        root=$1
71        # quick hack for now:
72        main=Test.main
73        heap=`basename "$root" .cm`
74    else
75        usage no CM description file specified
76    fi
77    
78  rare=XYZ_XXX_0123  rare=XYZ_XXX_0123
79    
# Line 36  Line 82 
82  EOF  EOF
83    
84  cat >$cmfile <<EOF  cat >$cmfile <<EOF
85  Group structure ${rare} is basis.cm ${root} ${smlfile}  Group structure ${rare} is \$/basis.cm ${root} ${smlfile}
86  EOF  EOF
87    
88  cat >$mlscript <<EOF  # Invoke sml with special option that causes CM to do its magic.
89  ignore (OS.Process.exit ((case CM.mk_standalone NONE "${cmfile}" of  # Unless the heap image exists and is up-to-date CM will write the arguments
90     NONE => OS.Process.failure  # for the link script into $linkargsfile.
91   | SOME l => let val s = TextIO.openOut "${listfile}"  # (See src/cm/main/cm-boot.sml [function "mlbuild"] for details.)
92                   fun wr str = TextIO.output (s, str ^ "\n")  if "$SML" $dulist @CMbuild $setup "$root" "$cmfile" "$heap" "$listfile" "$linkargsfile"
93                   val n = length l  then
94                   fun maxsz (s, n) = Int.max (size s, n)      if [ -r "$linkargsfile" ]; then
95                   val m = foldl maxsz 0 l          "$LINK" `cat "$linkargsfile"`
96     in wr (concat ["%", Int.toString n, " ", Int.toString m]);      fi
       app wr l;  
       TextIO.closeOut s;  
       OS.Process.success  
    end)  
    handle _ => OS.Process.failure))  
 EOF  
   
 if $SML full-cm.cm <$mlscript ; then  
     $LINK @SMLboot=$listfile $  
97  else  else
98      echo Compilation failed.      exit $?
     exit 1  
99  fi  fi

Legend:
Removed from v.569  
changed lines
  Added in v.1744

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