-
Notifications
You must be signed in to change notification settings - Fork 7
/
:mkuts
384 lines (368 loc) · 7.52 KB
/
:mkuts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
echo ""
echo ""
echo " Copyright (c) 1984, 1986, 1987, 1988 AT&T"
echo " All Rights Reserved"
echo ""
echo " THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T"
echo " The copyright notice above does not evidence any actual or"
echo " intended publication of such source code."
echo ""
echo " Copyright (c) 1987, 1988 Microsoft Corporation"
echo " All Rights Reserved"
echo ""
echo " This Module contains Proprietary Information of Microsoft"
echo " Corporation and should be treated as Confidential."
echo ""
echo ""
echo ""
#ident "@(#)mk::mkuts 1.15.1.4"
#
# Configure and make the UNIX Operating System with various devices
#
# Determine the CCSTYPE being used
${PFX}cc -V 2>&1 | grep 5.0 > /dev/null
if [ $? -eq 0 ]
then
CCSTYPE=ELF
else
CCSTYPE=COFF
fi
export CCSTYPE
echo
echo ====================== CCSTYPE is $CCSTYPE =========================
echo
SHELL=/bin/sh
REL=
VER=
export SHELL REL VER
echo $0: started at `date`
trap "exit 1" 1 2 3 15
MAKE=${MAKE:-make}
SRCDIR=${SRC:-$ROOT/usr/src}/uts
if vax
then
# configure an OS with the general disk/general tape (gdgt) and the
# general disk/TS11 tape drive (gdts) units.
# Note that the general disk/TU16 tape with TM02 controller (gdht)
# is not configured or tested here.
cd $SRCDIR/vax/cf
for i in gdgt gdts
do
echo "config $i \n$MAKE install VER=$i"
config $i
$MAKE install VER=$i
if [ $? -ne 0 ]
then
echo ":mkuts: *** $MAKE of $i failed"
fi
done
elif pdp11
then
# configure an OS with the general disk and rp disks
cd $SRCDIR/pdp11/cf
for i in gdht gdtm rpht rptm
do
echo "config $i \n$MAKE install VER=$i"
config $i
$MAKE install VER=$i
if [ $? -ne 0 ]
then
echo ":mkuts: *** $MAKE of $i failed"
fi
done
elif u3b
then
# configure an OS with the Kennedy tape drive (un32) and the
# magnetic tape controller configured into DMA channels 11 and 12.
cd $SRCDIR/3b/cf
for i in un32 mtc11 mtc12
do
echo "$MAKE clobber"
$MAKE clobber
echo "config /etc/system.$i"
config $ROOT/etc/system.$i
if [ "$ROOT" != "" ]
then
$MAKE -f ../makefile ENV="VER=$i CH=# SGS=3bs"
else
$MAKE VER=$i
fi
if [ $? -eq 0 ]
then
mv ../unix$i $ROOT/unix.$i
else
echo ":mkuts: *** $MAKE of unix.$i failed"
fi
done
elif u3b2
then
#
cd $SRCDIR/3b2
echo "$MAKE -f unix.mk install SYS=unix"
$MAKE -f unix.mk install SYS=unix
if [ $? -ne 0 ]
then
echo ":mkuts: *** $MAKE of unix failed"
fi
elif u3b5
then
#
cd $SRCDIR/3b5
echo "$MAKE -f unix.mk install SYS=unix VER=2"
$MAKE -f unix.mk install SYS=unix VER=2
if [ $? -ne 0 ]
then
echo ":mkuts: *** $MAKE of unix failed"
fi
elif i286
then
#
# Make the Safari 5 core and driver modules for
# Installable Drivers and Tunable Parameters (ID/TP)
#
echo "ROOT is set to" $ROOT
unset C N
C=install
if [ $# != 0 ]
then
if [ $1 = "?" ]
then
echo
echo ":mkuts [SYS=s] [VER=v] [REL=r] [NODE=n] [MACH=m] [IM=W|F [DEN=HI|LO]]"
echo ":mkuts clean"
echo ":mkuts clobber"
echo
exit 0
fi
if [ $1 = clean ]
then echo "make clean"
C=clean
elif [ $1 = clobber ]
then echo "make clobber"
C=clobber
elif [ $1 = test ]
then echo "make test"
exit 0
else
N=$@
fi
fi
if [ "$MACHINE" = "" ]
then
MACHINE=safari
fi
if [ "$MACHINE" != "safari" -a "$MACHINE" != "pcat" ]
then
Unknown Machine
exit 0
fi
if [ "$C" = "install" ]
then
echo Building a $MACHINE kernel
#
# make directories
#
if [ ! -d $ROOT/etc ]
then mkdir $ROOT/etc
fi
if [ ! -d $ROOT/etc/conf ]
then mkdir $ROOT/etc/conf
fi
fi
set -e
cd $ROOT/usr/src/uts/i286
make -f unix.mk $C $N MACHINE=$MACHINE
elif i386
then
# Configure an OS for the 80386, either Multibus or ATbus(default).
#
ROOT=${ROOT:-`cd ../..;pwd`}
SRCDIR=${SRC:-$ROOT/usr/src}/uts
export ROOT
# Put directories in object build tree.
#
if [ ! -d $ROOT/etc ]
then mkdir $ROOT/etc
fi
if [ ! -d $ROOT/etc/conf ]
then mkdir $ROOT/etc/conf
fi
if [ ! -d $ROOT/etc/conf/bin ]
then mkdir $ROOT/etc/conf/bin
fi
if [ ! -d $ROOT/etc/conf/cf.d ]
then mkdir $ROOT/etc/conf/cf.d
fi
if [ ! -d $ROOT/etc/conf/sdevice.d ]
then mkdir $ROOT/etc/conf/sdevice.d
fi
if [ ! -d $ROOT/etc/conf/pack.d ]
then mkdir $ROOT/etc/conf/pack.d
fi
if [ ! -d $ROOT/etc/conf/node.d ]
then mkdir $ROOT/etc/conf/node.d
fi
if [ ! -d $ROOT/etc/conf/rc.d ]
then mkdir $ROOT/etc/conf/rc.d
fi
if [ ! -d $ROOT/etc/conf/sd.d ]
then mkdir $ROOT/etc/conf/sd.d
fi
if [ ! -d $ROOT/etc/conf/init.d ]
then mkdir $ROOT/etc/conf/init.d
fi
if [ ! -d $ROOT/etc/conf/mfsys.d ]
then mkdir $ROOT/etc/conf/mfsys.d
fi
if [ ! -d $ROOT/etc/conf/sfsys.d ]
then mkdir $ROOT/etc/conf/sfsys.d
fi
C=
NET=
NET2=
NET3=
VPIX=
MERGE386=
WEITEK='-DWEITEK'
BUS=
ARCH=
MORECPP=
NONETWORK=
while [ -n "$1" ]
do
case "$1" in
at386|AT386|at|AT)
BUS=AT386
ARCH=AT386
CONF=${CONF:-$ROOT/etc/conf}
;;
# 380 chip support
at380|AT380)
BUS=AT386
ARCH=AT386
MORECPP="$MORECPP -DAT380"
;;
# entries for multibus.
mb1|MB1)
BUS=MB1
ARCH=MBUS
CONF=${CONF:-$ROOT/etc/conf}
;;
mb2|MB2)
BUS=MB2
ARCH=MBUS
CONF=${CONF:-$ROOT/etc/conf}
;;
mb2at|MB2AT)
BUS=AT386
ARCH=MB2AT
MORECPP="$MORECPP -DMB2AT"
;;
MB2SA|mb2sa)
MORECPP="$MORECPP -DMB2SA"
;;
eisa|EISA)
BUS=EISA
ARCH=AT386
MORECPP="$MORECPP -DEISA"
;;
mbus|MBUS)
MORECPP="$MORECPP -DMBUS"
;;
i860)
MORECPP="$MORECPP -Di860"
;;
BLTCONS)
BLTCONS="-DBLTCONS"
;;
EVC)
EVC="-DEVC"
;;
evga|EVGA)
EVGA="-DEVGA"
;;
noevga|NOEVGA)
EVGA=" "
;;
ev\-at|EV\-AT)
BUS=AT386
ARCH=EV-AT
MORECPP="$MORECPP -DAT386"
;;
# end multibus support
NOWEITEK|noweitek)
WEITEK=''
;;
NOVPIX|novpix)
VPIX=" "
;;
VPIX|vpix)
VPIX="-DVPIX"
;;
NOMERGE386|nomerge386)
MERGE386=" "
;;
MERGE386|merge386)
MERGE386="-DMERGE386"
;;
enet|ENET|ethernet|ETHERNET|ether|ETHER|E-NET|e-net)
NET2=ENET
MORECPP="$MORECPP -DENET"
;;
slan|SLAN|sln|SLN|starlan|STARLAN)
MORECPP="$MORECPP -DSTARLAN"
NET=STARLAN
;;
# debug turns on ASSERTs (see sys/debug.h) for kernel logic checking
debug|DEBUG)
MORECPP="$MORECPP -DDEBUG=1"
;;
msdebug|MSDEBUG)
MORECPP="$MORECPP -DMSDEBUGGER"
;;
-c) shift
CONF=${1:?"-c flag requires an argument."}
;;
nonet|NONET)
NONETWORK="nonet"
export NONETWORK
;;
clean|clobber)
C=$1
;;
*) echo unknown argument $1: ignored
;;
esac
shift
done
# fill in default values, default is PC/AT, no debugger
BUS=${BUS:-AT386}
ARCH=${ARCH:-AT386}
CONF=${CONF:-$ROOT/etc/conf}
VPIX=${VPIX:--DVPIX}
MERGE386=${MERGE386:--DMERGE386}
EVGA=${EVGA:--DEVGA}
BLTCONS=${BLTCONS:--DBLTCONS}
#EVC=${EVC:--DEVC}
MORECPP="$MORECPP -D$BUS -D$ARCH $VPIX $WEITEK $MERGE386 $BLTCONS $EVGA $EVC"
export BUS CONF MORECPP ROOT SRCDIR C NET ARCH NONETWORK
#
case "$C" in
clobber|clean);;
*)
# Build the Installable Driver Commands with the current mkuts values
if [ -f $ROOT/usr/src/cmd/idcmd/idcmd.mk ]
then
( cd $ROOT/usr/src/cmd/idcmd
echo "Building idcmd so that idmkunix and /unix are in sync"
make -f idcmd.mk "ROOT=$ROOT" "BUS=$BUS" "ARCH=$ARCH" "CONF=$CONF" "MORECPP=$MORECPP" "NET=$NET" "NET2=$NET2" "NET3=$NET3" install clobber
)
fi ;;
esac
# removed WEITEK stuff for MBx (set appropriatly above)
# Go do it
cd $SRCDIR/i386
make -f unix.mk $NONETWORK "ROOT=$ROOT" "BUS=$BUS" "ARCH=$ARCH" "CONF=$CONF" "MORECPP=$MORECPP" "NET=$NET" "NET2=$NET2" "NET3=$NET3" $C
fi
echo $0: done at `date`
exit 0