-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path:mk
86 lines (80 loc) · 1.73 KB
/
:mk
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
# Copyright (c) 1984 AT&T
# All Rights Reserved
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
# The copyright notice above does not evidence any
# actual or intended publication of such source code.
#ident "@(#)mk::mk 1.10"
#
# Shell script for rebuilding the UNIX System
#
trap "exit 1" 1 2 3 15
if [ "$ROOT" = "" ]
then
PATH=/bin:/etc:/usr/bin; export PATH
fi
UID_NAME=`id|sed 's/[()]/ /gp'|awk '{print $2}'`
# Check for the existance of target directories
test -d ${ROOT:-"/"} || mkdir -p $ROOT
cat -s target.dirs | # print contents of the target directory list
egrep -v "^$|^#" | # get rid of blank lines and comments
while read TARGETDIR MODE OWNER GROUP
do
if [ ! -d ${ROOT}/$TARGETDIR ]
then
mkdir ${ROOT}/$TARGETDIR
if [ ! -d ${ROOT}/$TARGETDIR ]
then
echo "$0: stop: make of directory ${ROOT}/$TARGETDIR failed"
exit 1
fi
fi
if [ "$UID_NAME" = "root" ]
then
if [ ! -z "$MODE" -a "$MODE" != "-" ]
then
chmod $MODE ${ROOT}/$TARGETDIR
fi
if [ ! -z "$OWNER" -a "$OWNER" != "-" ]
then
chown $OWNER ${ROOT}/$TARGETDIR
fi
if [ ! -z "$GROUP" -a "$GROUP" != "-" ]
then
chgrp $GROUP ${ROOT}/$TARGETDIR
fi
fi
done
# install /usr/include and /usr/include/sys header files
./:mkhead
./:mksyshead
# build and install the C library
./:mklib libc
# build the C compilation tools
if vax || pdp11
then
./:mkcmd $* cc
else
./:mkcmd sgs
fi
# build the other libraries
./:mklib \*
# build the system administration tools
if [ "$ROOT" != "" ]
then
./:mkcmd .adm
fi
# build all the commands
./:mkcmd $* \*
# build stand-alone system, if appropriate
if vax || pdp11
then
./:mkstand
fi
# build the OS itself
./:mkuts
# build the compatibility package
if [ -d ucbcmd -d -s ucbhead -d -s ucblib ]
then
./:mkucb
fi
exit 0