bld_lint.sh revision 6951:59445bec7ef4
1168054Sflz#! /usr/bin/sh
2168054Sflz#
3168266Sgabor# CDDL HEADER START
4168266Sgabor#
5168266Sgabor# The contents of this file are subject to the terms of the
6168266Sgabor# Common Development and Distribution License (the "License").
7168266Sgabor# You may not use this file except in compliance with the License.
8168266Sgabor#
9168266Sgabor# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10168266Sgabor# or http://www.opensolaris.org/os/licensing.
11168054Sflz# See the License for the specific language governing permissions
12168054Sflz# and limitations under the License.
13168064Sflz#
14168064Sflz# When distributing Covered Code, include this CDDL HEADER in each
15168064Sflz# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16168064Sflz# If applicable, add the following below this CDDL HEADER, with the
17168064Sflz# fields enclosed by brackets "[]" replaced with your own identifying
18240293Seadler# information: Portions Copyright [yyyy] [name of copyright owner]
19168096Sceri#
20168064Sflz# CDDL HEADER END
21168064Sflz#
22168064Sflz
23168064Sflz#
24168064Sflz# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
25168064Sflz# Use is subject to license terms.
26240293Seadler#
27168064Sflz# ident	"%Z%%M%	%I%	%E% SMI"
28168054Sflz#
29168054Sflz
30168064SflzDASHES="============================================================"
31168054Sflz
32216982SgavinMACH=	`uname -p`
33216982Sgavin
34216982Sgavinif [ $MACH = "sparc" ]
35236102Sgavinthen
36216982Sgavin	MACH64="sparcv9"
37216982Sgavinelif [ $MACH = "i386" ]
38216982Sgavinthen
39216982Sgavin	MACH64="amd64"
40216982Sgavinelse
41216982Sgavin	MACH64="unknown"
42236102Sgavinfi
43216982Sgavin
44236102SgavinLOG=lint.$MACH.log
45216982Sgavin
46216982Sgavin#
47236102Sgavin# Keep the first run as a backup, so that subsequent runs can diff against it.
48216982Sgavin#
49168054Sflzif [ -f $LOG ]
50168054Sflzthen
51168054Sflz	if [ ! -f $LOG.bak ]
52168054Sflz	then
53168126Sale		mv $LOG $LOG.bak
54201514Sbcr	else
55168146Skeramida		rm -f $LOG
56168096Sceri	fi
57168096Scerifi
58168129Sdelphij
59251102Screes#
60168095Skeramida# Grab the lint.out from all of our directories.
61168129Sdelphij#
62245813Sdrufor ii in $*
63241595Seadlerdo
64240540Sebrandi	if [ $ii = ".WAIT" ]
65168062Sgabor	then
66178437Sganbold		continue
67225367Sgavin	fi
68216986Skeramida
69219470Sgavin	# Concatinate the lint.out to our log file.
70235061Sissyl0#	echo $ii/$MACH >> $LOG
71173022Sjkois	echo $DASHES >> $LOG
72168112Sjoel	cat $ii/$MACH/lint.out >> $LOG
73168062Sgabor	echo "\n" >> $LOG
74216982Sgavin
75171701Sloader	# If there is a 64-bit directory, tack that on as well.
76179281Smanolis	if [ -f $ii/$MACH64/lint.out ]
77168058Smarck	then
78209623Smaxim#		echo $ii/$MACH64 >> $LOG
79173033Smiwi		echo $DASHES >> $LOG
80168114Ssimon		cat $ii/$MACH64/lint.out >> $LOG
81232313Spluknet		echo "\n" >> $LOG
82168114Ssimon	fi
83184655Sremkodone
84217646Sryusuke
85168114Ssimon#
86209623Smaxim# If there is a backup log, diff the current one against it.
87168095Skeramida#
88226354Swblockif [ -f $LOG.bak ]
89238058Szeisingthen
90168058Smarck	echo "Running diff on log file..."
91168054Sflz	diff $LOG.bak $LOG
92168064Sflzfi
93168064Sflz
94168054Sflzexit 0
95225367Sgavin