|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: T l
Length: 7118 (0x1bce)
Types: TextFile
Names: »lint2.11«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./usr/lib/cmplrs/cc2.11/lint2.11«
#! /bin/sh
# -------------------------------------------------------------
# | RESTRICTED RIGHTS LEGEND |
# | Use, duplication, or disclosure by the Government is |
# | subject to restrictions as set forth in subparagraph |
# | (c)(1)(ii) of the Rights in Technical Data and Computer |
# | Software Clause at DFARS 252.227-7013. |
# | MIPS Computer Systems, Inc. |
# | 928 Arques Avenue |
# | Sunnyvale, CA 94086 |
# -------------------------------------------------------------
# ---------------------------------------------------------
# | Copyright (c) 1986, 1989 MIPS Computer Systems, Inc. |
# | All Rights Reserved. |
# ---------------------------------------------------------
# $Header: lint.sh,v 2010.9.1.7 90/02/22 19:37:22 bettina Exp $
# $Log: lint.sh,v $
# Revision 2010.9.1.7 90/02/22 19:37:22 bettina
# 2.10 F1
#
# Revision 2010.9.1.6 90/02/14 14:50:48 bettina
# fixed legend
#
# Revision 2010.9.1.5 90/01/25 13:31:16 bettina
# 2.10 B3 - added legend
#
# Revision 2010.9.1.6 90/01/18 15:57:07 bettina
# add legend
#
# Revision 2010.9.1.1 89/10/16 21:44:53 bettina
# now picks lint script from usr/lib/cmplrs/cc
#
# Revision 2020.1 89/10/06 14:57:36 bettina
# 2.20
#
# Revision 2010.9 89/10/05 16:00:53 bettina
# 2.10 - beta freeze
#
# Revision 2010.8 89/10/04 14:27:02 lai
# fix some sh script bugs
#
# Revision 2010.7 89/10/04 14:16:40 lai
# changed LLDIR to /usr/lib/lint; added systype to DEFL; added -V flag for
# verbose.
#
# Revision 2010.6 89/09/26 19:50:30 lai
# removed -DLANGUAGE_C, not needed since driver supplies.
#
# Revision 2010.5 89/09/26 19:46:39 lai
# added -DLANGUAGE_C
#
# Revision 2010.4 89/09/26 16:33:07 bettina
# updated copyright
#
# Revision 2010.3 89/09/07 16:52:15 lai
# added support for -systype
#
# Revision 2010.2 89/09/01 16:18:47 lai
# added support for -p option, fixed up bugs, remove -T <file> from lint pass1
#
# Revision 2010.1 89/08/31 01:44:35 lai
# updated to 2.10
#
# Revision 1.3 89/08/31 01:39:15 lai
# added $Log.
#
#
#
# New lint shell script. Changed to make lint(1) act as much as is possible
# like a different version of the cc(1) command. This includes the notion of
# a ``lint .o'' (.ln) and incremental linting. Thu Jan 27 10:07:15 EST 1983
#
if test -z "$TMPDIR"; then
TMPDIR=/usr/tmp
fi
TOUT=$TMPDIR/tlint.$$ # combined input for second pass
HOUT=$TMPDIR/hlint.$$ # header messages file
#PATH=/bin:/usr/bin:
#LDIR=/comp5/usr/lib/cmplrs/cc/lint # where first & second pass are
#LLDIR=/comp5/usr/lib/cmplrs/cc/lint # where lint libraries are found
LDIR=$COMP_HOST_ROOT/usr/lib/cmplrs/cc # where first & second pass are
LLDIR=/usr/lib/lint # where the deafult lint libraries are found
CCF="-E -C -Dlint" # options for the cc command
LINTF= # options for the lint passes
LINT1F= # special flags just for lint1
FILES= # the *.c and *.ln files in order
NDOTC= # how many *.c were there
DEFL=$LLDIR/llib-lc.ln # the default library to use
LLIB= # lint library file to create
CONLY= # set for ``compile only''
pre= # these three variables used for
post= # handling options with arguments
optarg= # list variable to add argument to
sawsystype= # handling for -systype args
systype=
verb=0 # echo commands
#
trap "rm -f $TOUT $HOUT; exit 2" 1 2 3 15
#
# First, run through all of the arguments, building lists
#
# lint's options are "abchl:no:puvx"
# cc/cpp options are "I:D:U:gO"
#
usage=0
for OPT in "$@"
do
if [ "$sawsystype" ]
then
sawsystype=
CCF="$CCF -systype $OPT"
systype=$OPT
LLDIR="/$OPT/$LLDIR"
DEFL="/$OPT/$DEFL"
continue
fi
if [ "$optarg" ]
then
if [ "$optarg" = "LLIB" ] # special case...
then
OPT=`basename $OPT`
fi
eval "$optarg=\"\$$optarg \$pre\$OPT\$post\""
pre=
post=
optarg=
continue
fi
case "$OPT" in
*.c) FILES="$FILES $OPT" NDOTC="x$NDOTC";;
*.ln) FILES="$FILES $OPT";;
-systype) sawsystype=$OPT;;
-*) OPT=`echo $OPT | sed s/-//`
while [ "$OPT" ]
do
O=`echo $OPT | sed 's/\\(.\\).*/\\1/'`
OPT=`echo $OPT | sed s/.//`
case $O in
p) LINTF="$LINTF -p"
LINT1F="$LINT1F -T"
# CCF="$CCF -Wp,-T"
DEFL=$LLDIR/llib-port.ln;;
n) LINTF="$LINTF -n"
DEFL=;;
c) CONLY=1;;
[abhuvx]) LINTF="$LINTF -$O";;
[gO]) CCF="$CCF -$O";;
[IDU]) if [ "$OPT" ]
then
CCF="$CCF -$O$OPT"
else
optarg=CCF
pre=-$O
fi
break;;
l) if [ "$OPT" ]
then
FILES="$FILES $LLDIR/llib-l$OPT.ln"
else
optarg=FILES
pre=$LLDIR/llib-l
post=.ln
fi
break;;
o) if [ "$OPT" ]
then
OPT=`basename $OPT`
LLIB="llib-l$OPT.ln"
else
LLIB=
optarg=LLIB
pre=llib-l
post=.ln
fi
break;;
systype) sawsystype=1;
break;;
V) verb=1;
CCF="$CCF -v"
break;;
*) echo "lint: bad option ignored: $O"
usage=1;;
esac
done;;
*) echo "lint: file with unknown suffix ignored: $OPT"
usage=1;;
esac
done
if test "$usage" = "1"; then
echo "Usage: $0 [options] file ..."
echo ' lint options are "systype abchlnopuvVx"'
echo ' cc/cpp options are "IDUgO"'
fi
#
# Second, walk through the FILES list, running all .c's through
# lint's first pass, and just adding all .ln's to the running result
#
if [ "$NDOTC" != "x" ] # note how many *.c's there were
then
NDOTC=1
else
NDOTC=
fi
if [ "$CONLY" ] # run lint1 on *.c's only producing *.ln's
then
for i in $FILES
do
case $i in
*.c) T=`basename $i .c`.ln
if [ "$NDOTC" ]
then
echo $i:
fi
if [ $verb = 1 ]
then
echo '(' cc $CCF $i '|' $LDIR/lint1 $LINTF $LINT1F -H$HOUT $i '>' $T ') 2>&1'
fi
(cc $CCF $i | $LDIR/lint1 $LINTF $LINT1F -H$HOUT $i >$T) 2>&1
if [ $verb = 1 ]
then
echo $LDIR/lint2 -H$HOUT
fi
$LDIR/lint2 -H$HOUT
if [ $verb = 1 ]
then
echo rm -f $HOUT
fi
rm -f $HOUT;;
esac
done
else # send all *.c's through lint1 run all through lint2
if [ $verb = 1 ]
then
echo rm -f $TOUT $HOUT
fi
rm -f $TOUT $HOUT
for i in $FILES
do
case $i in
*.ln) if [ $verb = 1 ]
then
echo cat '<' $i '>>' $TOUT
fi
cat <$i >>$TOUT;;
*.c) if [ "$NDOTC" ]
then
echo $i:
fi
if [ $verb = 1 ]
then
echo '(' cc $CCF $i '|' $LDIR/lint1 $LINTF $LINT1F -H$HOUT $i '>>' $TOUT ')2>&1'
fi
(cc $CCF $i|$LDIR/lint1 $LINTF $LINT1F -H$HOUT $i >>$TOUT)2>&1;;
esac
done
if [ "$LLIB" ]
then
if [ $verb = 1 ]
then
echo cp $TOUT $LLIB
fi
cp $TOUT $LLIB
fi
if [ "$DEFL" ]
then
if [ $verb = 1 ]
then
echo cat '<' $DEFL '>>' $TOUT
fi
cat <$DEFL >>$TOUT
fi
if [ -s "$HOUT" ]
then
if [ $verb = 1 ]
then
echo $LDIR/lint2 -T$TOUT -H$HOUT $LINTF
fi
$LDIR/lint2 -T$TOUT -H$HOUT $LINTF
else
if [ $verb = 1 ]
then
echo $LDIR/lint2 -T$TOUT $LINTF
fi
$LDIR/lint2 -T$TOUT $LINTF
fi
fi
if [ $verb = 1 ]
then
echo rm -f $TOUT $HOUT
fi
rm -f $TOUT $HOUT