-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path:mkhead
61 lines (59 loc) · 1.31 KB
/
:mkhead
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
# 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::mkhead 1.18"
#
# Install UNIX System header files
#
SRCDIR=${SRC:-$ROOT/usr/src}/head
TARGDIR=$ROOT/usr/include
TMPFILE=/tmp/mkhead$$
trap "rm -f $TMPFILE ; exit 1" 1 2 3 15
#
# Determine files to be processed
if [ $# -gt 0 ]
then
(cd $SRCDIR; ls $* | sed -e 's/sys\.[^ ]*//g' > $TMPFILE)
else
(cd $SRCDIR; find . -type f -print | sed -e '/sys\.[^ ]*/d' > $TMPFILE)
fi
#
echo "\nInstalling $SRCDIR into $TARGDIR:"
echo "sys.s"
cat $TMPFILE | pr -ta5
#
# Copy system-dependent sysent table file
if vax
then
cp $SRCDIR/sys.vax $TARGDIR/sys.s
elif pdp11
then
cp $SRCDIR/sys.pdp $TARGDIR/sys.s
elif u3b15 || u3b2
then
if [ -f $SRCDIR/sys.u3b15 ]
then cp $SRCDIR/sys.u3b15 $TARGDIR/sys.s
elif [ -f $SRCDIR/sys.u3b5 ]
then cp $SRCDIR/sys.u3b5 $TARGDIR/sys.s
fi
fi
chmod 664 $TARGDIR/sys.s
if [ "$ROOT" = "" ]
then
chgrp bin $TARGDIR/sys.s
chown bin $TARGDIR/sys.s
fi
#
# Install requested files
(cd $SRCDIR; cat $TMPFILE | cpio -pdu $TARGDIR
# Set file permissions
cd $TARGDIR; chmod 664 `cat $TMPFILE`
if [ "$ROOT" = "" ]
then
chgrp bin `cat $TMPFILE`
chown bin `cat $TMPFILE`
fi )
rm -f $TMPFILE
exit 0