SCM Repository
Annotation of /sml/trunk/config/_ml-build
Parent Directory
|
Revision Log
Revision 537 - (view) (download)
1 : | blume | 537 | #!@SHELL@ |
2 : | |||
3 : | BIN_DIR=@BINDIR@ | ||
4 : | |||
5 : | SML=$BIN_DIR/sml | ||
6 : | LINK=$BIN_DIR/.link-sml | ||
7 : | |||
8 : | thisscript=$0 | ||
9 : | |||
10 : | xx=$$ | ||
11 : | smlfile=$xx-export.sml | ||
12 : | cmfile=$xx-export.cm | ||
13 : | listfile=$xx-BOOTLIST | ||
14 : | mlscript=$xx-script | ||
15 : | |||
16 : | trap 'rm -rf $smlfile $cmfile $listfile $mlscript' 0 1 2 3 15 | ||
17 : | |||
18 : | usage() { | ||
19 : | echo ${thisscript}: $* | ||
20 : | echo Usage: $thisscript root-group main-function heapfile | ||
21 : | exit 1 | ||
22 : | } | ||
23 : | |||
24 : | if [ $# != 3 ] ; then | ||
25 : | usage wrong number of arguments | ||
26 : | fi | ||
27 : | |||
28 : | root=$1 | ||
29 : | main=$2 | ||
30 : | heap=$3 | ||
31 : | |||
32 : | rare=XYZ_XXX_0123 | ||
33 : | |||
34 : | cat >$smlfile <<EOF | ||
35 : | structure ${rare} = struct val _ = SMLofNJ.exportFn ("${heap}", ${main}) end | ||
36 : | EOF | ||
37 : | |||
38 : | cat >$cmfile <<EOF | ||
39 : | Group structure ${rare} is basis.cm ${root} ${smlfile} | ||
40 : | EOF | ||
41 : | |||
42 : | cat >$mlscript <<EOF | ||
43 : | OS.Process.exit ((case CM.mk_standalone NONE "${cmfile}" of | ||
44 : | NONE => OS.Process.failure | ||
45 : | | SOME l => let val s = TextIO.openOut "${listfile}" | ||
46 : | in app (fn str => TextIO.output (s, str ^ "\n")) l; | ||
47 : | TextIO.closeOut s; | ||
48 : | OS.Process.success | ||
49 : | end) | ||
50 : | handle _ => OS.Process.failure) | ||
51 : | EOF | ||
52 : | |||
53 : | if $SML full-cm.cm <$mlscript ; then | ||
54 : | $LINK @SMLboot=$listfile $ | ||
55 : | else | ||
56 : | echo Compilation failed. | ||
57 : | exit 1 | ||
58 : | fi |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |