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 573, Thu Mar 9 15:23:52 2000 UTC revision 1656, Wed Oct 20 20:05:45 2004 UTC
# Line 1  Line 1 
1  #!@SHELL@  #!@SHELL@
2    
3    if [ x${SMLNJ_HOME} = x ] ; then
4  BIN_DIR=@BINDIR@  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}: $*
# Line 21  Line 31 
31      exit 1      exit 1
32  }  }
33    
34  if [ $# != 3 ] ; then  while [ $# != 0 ] ; do
35      usage wrong number of arguments      case $1 in
36  fi      -D*|-U*|-C*)
37            dulist="$dulist $1"
38            shift
39            ;;
40        *)
41            break
42            ;;
43        esac
44    done
45    
46    if [ $# = 3 ] ; then
47        setup=
48  root=$1  root=$1
49  main=$2  main=$2
50  heap=$3  heap=$3
51    elif [ $# = 4 ] ; then
52        setup=$1
53        root=$2
54        main=$3
55        heap=$4
56    else
57        usage wrong number of arguments
58    fi
59    
60  rare=XYZ_XXX_0123  rare=XYZ_XXX_0123
61    
# Line 36  Line 64 
64  EOF  EOF
65    
66  cat >$cmfile <<EOF  cat >$cmfile <<EOF
67  Group structure ${rare} is basis.cm ${root} ${smlfile}  Group structure ${rare} is \$/basis.cm ${root} ${smlfile}
 EOF  
   
 cat >$mlscript <<EOF  
 ignore (OS.Process.exit ((case CM.mk_standalone NONE "${cmfile}" of  
    NONE => OS.Process.failure  
  | SOME l => let val s = TextIO.openOut "${listfile}"  
                  fun wr str = TextIO.output (s, str ^ "\n")  
                  val n = length l  
                  fun maxsz (s, n) = Int.max (size s, n)  
                  val m = foldl maxsz 0 l  
    in wr (concat ["%", Int.toString n, " ", Int.toString m]);  
       app wr l;  
       TextIO.closeOut s;  
       OS.Process.success  
    end)  
    handle _ => OS.Process.failure))  
68  EOF  EOF
69    
70  if $SML smlnj/cm/full.cm <$mlscript ; then  # Invoke sml with special option that causes CM to do its magic.
71      $LINK @SMLboot=$listfile $  # Unless the heap image exists and is up-to-date CM will write the arguments
72    # for the link script into $linkargsfile.
73    # (See src/cm/main/cm-boot.sml [function "mlbuild"] for details.)
74    if $SML $dulist @CMbuild $setup $root $cmfile $heap $listfile $linkargsfile
75    then
76        if [ -r $linkargsfile ]; then
77            $LINK `cat $linkargsfile`
78        fi
79  else  else
80      echo Compilation failed.      exit $?
     exit 1  
81  fi  fi

Legend:
Removed from v.573  
changed lines
  Added in v.1656

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