SCM Repository
Annotation of /sml/trunk/config/_ml-build
Parent Directory
|
Revision Log
Revision 569 - (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 : | blume | 569 | trap 'rm -rf `find . -name $smlfile` $cmfile $listfile $mlscript' 0 1 2 3 15 |
17 : | blume | 537 | |
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 : | blume | 569 | ignore (OS.Process.exit ((case CM.mk_standalone NONE "${cmfile}" of |
44 : | blume | 537 | NONE => OS.Process.failure |
45 : | | SOME l => let val s = TextIO.openOut "${listfile}" | ||
46 : | blume | 569 | fun wr str = TextIO.output (s, str ^ "\n") |
47 : | val n = length l | ||
48 : | fun maxsz (s, n) = Int.max (size s, n) | ||
49 : | val m = foldl maxsz 0 l | ||
50 : | in wr (concat ["%", Int.toString n, " ", Int.toString m]); | ||
51 : | app wr l; | ||
52 : | blume | 537 | TextIO.closeOut s; |
53 : | OS.Process.success | ||
54 : | end) | ||
55 : | blume | 569 | handle _ => OS.Process.failure)) |
56 : | blume | 537 | EOF |
57 : | |||
58 : | if $SML full-cm.cm <$mlscript ; then | ||
59 : | $LINK @SMLboot=$listfile $ | ||
60 : | else | ||
61 : | echo Compilation failed. | ||
62 : | exit 1 | ||
63 : | fi |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |