xref: /titanic_52/usr/src/cmd/sgs/tools/bld_lint.sh (revision 88447a05f537aabe9a1bc3d5313f22581ec992a7)
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 (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23#
24# Copyright 2008 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"
37elif [ $MACH = "i386" ]
38then
39	MACH64="amd64"
40else
41	MACH64="unknown"
42fi
43
44LOG=lint.$MACH.log
45
46#
47# Keep the first run as a backup, so that subsequent runs can diff against it.
48#
49if [ -f $LOG ]
50then
51	if [ ! -f $LOG.bak ]
52	then
53		mv $LOG $LOG.bak
54	else
55		rm -f $LOG
56	fi
57fi
58
59#
60# Grab the lint.out from all of our directories.
61#
62for ii in $*
63do
64	if [ $ii = ".WAIT" ]
65	then
66		continue
67	fi
68
69	# Concatinate the lint.out to our log file.
70#	echo $ii/$MACH >> $LOG
71	echo $DASHES >> $LOG
72	cat $ii/$MACH/lint.out >> $LOG
73	echo "\n" >> $LOG
74
75	# If there is a 64-bit directory, tack that on as well.
76	if [ -f $ii/$MACH64/lint.out ]
77	then
78#		echo $ii/$MACH64 >> $LOG
79		echo $DASHES >> $LOG
80		cat $ii/$MACH64/lint.out >> $LOG
81		echo "\n" >> $LOG
82	fi
83done
84
85#
86# If there is a backup log, diff the current one against it.
87#
88if [ -f $LOG.bak ]
89then
90	echo "Running diff on log file..."
91	diff $LOG.bak $LOG
92fi
93
94exit 0
95