-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path:mklib
42 lines (40 loc) · 953 Bytes
/
:mklib
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
# 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::mklib 1.8"
#
# Build UNIX System libraries
# For each directory build the library by invoking its
# makefile (<dir>.mk).
#
trap "exit 1" 1 2 3 15
MAKE=${MAKE:-make}
SRCDIR=${SRC:-$ROOT/usr/src}/lib
CLOBBER=${CLOBBER:-"ON"}
cd $SRCDIR
#
for ARG in $*
do
LIB=`basename $ARG`
if [ -d $LIB ]
then (
echo "======== $LIB"
cd $LIB
if [ -f $LIB.mk ]
then
$MAKE -b -f $LIB.mk install I="install -i -n $ROOT/lib $ROOT/usr/lib"
if [ $? -ne 0 ]
then
echo ":mklib: *** $MAKE failed using $LIB.mk"
fi
test "$CLOBBER" != "OFF" && $MAKE -b -f $LIB.mk clobber
else
echo ":mklib: *** no $LIB.mk file in $SRCDIR/$LIB"
fi
) else
echo ":mklib: *** no directory found for $LIB under $SRCDIR"
fi
done
exit 0