SCM Repository
Annotation of /sml/trunk/src/system/makeml
Parent Directory
|
Revision Log
Revision 416 - (view) (download)
1 : | monnier | 416 | #!/bin/sh |
2 : | # | ||
3 : | |||
4 : | ALLOC=1M | ||
5 : | |||
6 : | ARCH=sparc | ||
7 : | OPSYS=solaris | ||
8 : | RUN_DIR=../../bin/.run | ||
9 : | OBJS_DIR=../runtime/objs | ||
10 : | HEAP_IMAGE="" | ||
11 : | RUN="" | ||
12 : | RUN_ARGS="" | ||
13 : | REBUILD="" | ||
14 : | BOOT_DIR="" | ||
15 : | |||
16 : | # | ||
17 : | # Set CM_PATHCONFIG_DEFAULT to ../../lib/pathconfig | ||
18 : | # (using an absolute path!) | ||
19 : | # | ||
20 : | |||
21 : | here=`pwd` | ||
22 : | cd ../.. | ||
23 : | CM_PATHCONFIG_DEFAULT=`pwd`/lib/pathconfig | ||
24 : | cd $here | ||
25 : | export CM_PATHCONFIG_DEFAULT | ||
26 : | |||
27 : | # | ||
28 : | # use the arch-n-opsys script to determine the ARCH/OS if possible | ||
29 : | # | ||
30 : | if [ -f ../../bin/.arch-n-opsys ]; then | ||
31 : | ARCH_N_OPSYS=`../../bin/.arch-n-opsys` | ||
32 : | if [ "$?" = "0" ]; then | ||
33 : | eval $ARCH_N_OPSYS | ||
34 : | echo $ARCH $OPSYS | ||
35 : | fi | ||
36 : | fi | ||
37 : | |||
38 : | while [ "$#" != "0" ] | ||
39 : | do | ||
40 : | arg=$1; shift | ||
41 : | case $arg in | ||
42 : | -bare) FULL="@SMLbare" ;; | ||
43 : | -rebuild) | ||
44 : | if [ "$#" = "0" ]; then | ||
45 : | echo "makeml: missing argument for \"-rebuild\" option" | ||
46 : | exit 1 | ||
47 : | fi | ||
48 : | REBUILD="@SMLrebuild=$1"; shift | ||
49 : | ;; | ||
50 : | -arch) | ||
51 : | if [ "$#" = "0" ]; then | ||
52 : | echo "makeml: missing argument for \"-arch\" option" | ||
53 : | exit 1 | ||
54 : | fi | ||
55 : | ARCH=$1; shift | ||
56 : | ;; | ||
57 : | -opsys) | ||
58 : | if [ "$#" = "0" ]; then | ||
59 : | echo "makeml: missing argument for \"-opsys\" option" | ||
60 : | exit 1 | ||
61 : | fi | ||
62 : | OPSYS=$1; shift | ||
63 : | ;; | ||
64 : | -o) | ||
65 : | if [ "$#" = "0" ]; then | ||
66 : | echo "makeml: missing argument for \"-o\" option" | ||
67 : | exit 1 | ||
68 : | fi | ||
69 : | HEAP_IMAGE=$1; shift | ||
70 : | ;; | ||
71 : | -run) | ||
72 : | if [ "$#" = "0" ]; then | ||
73 : | echo "makeml: missing argument for \"-run\" option" | ||
74 : | exit 1 | ||
75 : | fi | ||
76 : | RUN=$1; shift | ||
77 : | ;; | ||
78 : | -alloc) | ||
79 : | if [ "$#" = "0" ]; then | ||
80 : | echo "makeml: missing argument for \"-alloc\" option" | ||
81 : | exit 1 | ||
82 : | fi | ||
83 : | ALLOC=$1; shift | ||
84 : | ;; | ||
85 : | -boot) | ||
86 : | if [ "$#" = "0" ]; then | ||
87 : | echo "makeml: missing argument for \"-boot\" option" | ||
88 : | exit 1 | ||
89 : | fi | ||
90 : | BOOT_DIR=$1; shift | ||
91 : | ;; | ||
92 : | @SML*) | ||
93 : | RUN_ARGS="$RUN_ARGS $arg" | ||
94 : | ;; | ||
95 : | *) echo "makeml: unknown argument \"$arg\"" | ||
96 : | exit 1 | ||
97 : | ;; | ||
98 : | esac | ||
99 : | done | ||
100 : | |||
101 : | if [ x"$RUN" = x ]; then | ||
102 : | if [ x"$OPSYS" = xwin32 ]; then | ||
103 : | RUN_CMD="run.$ARCH-$OPSYS.exe" | ||
104 : | else | ||
105 : | RUN_CMD="run.$ARCH-$OPSYS" | ||
106 : | fi | ||
107 : | if [ -x "$RUN_DIR/$RUN_CMD" ]; then | ||
108 : | RUN="$RUN_DIR/$RUN_CMD" | ||
109 : | elif [ -x "$OBJS_DIR/$RUN_CMD" ]; then | ||
110 : | RUN="$OBJS_DIR/$RUN_CMD" | ||
111 : | else | ||
112 : | echo "makeml: unable to find run-time system \"$RUN_CMD\"" | ||
113 : | exit 1 | ||
114 : | fi | ||
115 : | fi | ||
116 : | |||
117 : | if [ x"$HEAP_IMAGE" = x ]; then | ||
118 : | HEAP_IMAGE="sml" | ||
119 : | fi | ||
120 : | |||
121 : | if [ x"$BOOT_DIR" = x ]; then | ||
122 : | BOOT_DIR="./comp.boot.$ARCH-unix" | ||
123 : | fi | ||
124 : | |||
125 : | echo "$RUN @SMLboot=$BOOT_DIR @SMLrtpid=`cat $BOOT_DIR/RTPID` \ | ||
126 : | @SMLheap=$HEAP_IMAGE @SMLalloc=$ALLOC $RUN_ARGS $REBUILD" | ||
127 : | |||
128 : | if $RUN @SMLboot=$BOOT_DIR @SMLrtpid=`cat $BOOT_DIR/RTPID` \ | ||
129 : | @SMLheap=$HEAP_IMAGE @SMLalloc=$ALLOC $RUN_ARGS $REBUILD | ||
130 : | then | ||
131 : | # | ||
132 : | # If this was a -rebuild run, we have to quit now... | ||
133 : | # | ||
134 : | if [ x$REBUILD != x ] ; then | ||
135 : | echo New binfiles are ready. | ||
136 : | exit 0 | ||
137 : | fi | ||
138 : | echo Heap image generated. | ||
139 : | else | ||
140 : | echo Something broke. | ||
141 : | exit 1 | ||
142 : | fi | ||
143 : | |||
144 : | # | ||
145 : | # Now move the libraries, generate the pathconfig file, and delete the bootdir. | ||
146 : | # | ||
147 : | |||
148 : | LIB_DIR=`pwd`/${HEAP_IMAGE}.lib | ||
149 : | |||
150 : | rm -rf $LIB_DIR | ||
151 : | mkdir $LIB_DIR | ||
152 : | |||
153 : | cd $BOOT_DIR | ||
154 : | |||
155 : | for i in *.cm ; do | ||
156 : | mv $i $LIB_DIR/$i | ||
157 : | echo $i $LIB_DIR/$i | ||
158 : | done >$LIB_DIR/pathconfig | ||
159 : | |||
160 : | cd .. | ||
161 : | rm -r $BOOT_DIR |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |