xref: /titanic_50/usr/src/cmd/sgs/tools/bld_lint.sh (revision b1dd958f54f8bfa984d306bb8ca8264855761d7b)
1#! /usr/bin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License, Version 1.0 only
7# (the "License").  You may not use this file except in compliance
8# with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23#
24# Copyright 1998,2002 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# ident	"%Z%%M%	%I%	%E% SMI"
28#
29
30DASHES="============================================================"
31
32MACH=	`uname -p`
33
34if [ $MACH = "sparc" ]; \
35then
36	MACH64="sparcv9"
37else
38	MACH64="unknown"
39fi
40
41LOG=lint.$MACH.log
42
43
44#
45# Keep the first run as a backup, so that
46# subsequent runs can diff against it.
47#
48if [ -f $LOG ]
49then
50	if [ ! -f $LOG.bak ]
51	then
52		mv $LOG $LOG.bak
53	else
54		rm -f $LOG
55	fi
56fi
57
58#
59# Grab the lint.out from all of our directories.
60#
61for ii in $*
62do
63	if [ $ii = ".WAIT" ]
64	then
65		continue
66	fi
67
68	# Concatinate the lint.out to our log file.
69	echo $ii/$MACH >> $LOG
70	echo $DASHES >> $LOG
71	cat $ii/$MACH/lint.out >> $LOG
72	echo "\n" >> $LOG
73
74	# If there is a 64-bit directory, tack that on as well.
75	if [ -f $ii/$MACH64/lint.out ]
76	then
77		echo $ii/$MACH64 >> $LOG
78		echo $DASHES >> $LOG
79		cat $ii/$MACH64/lint.out >> $LOG
80		echo "\n" >> $LOG
81	fi
82done
83
84
85#
86# If there is a backup log, diff the current
87# one against it.
88#
89if [ -f $LOG.bak ]
90then
91	echo "Running diff on log file..."
92	diff $LOG.bak $LOG
93fi
94
95exit 0
96