dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / tools / scripts / checkpaths.sh
blob04dff42948d349d59e684749d5176a0cce10ce63
1 #!/bin/ksh -p
3 # CDDL HEADER START
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.
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.
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]
20 # CDDL HEADER END
24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
28 # Quis custodiet ipsos custodies?
30 if [ -z "$SRC" ]; then
31 SRC=$SRCTOP/usr/src
34 if [ -z "$SRCTOP" -o ! -d "$SRCTOP" -o ! -d "$SRC" ]; then
35 echo "$0: must be run from within a workspace."
36 exit 1
39 cd $SRCTOP || exit 1
41 # Use -b to tell this script to ignore derived (built) objects.
42 if [ "$1" = "-b" ]; then
43 b_flg=y
46 # Not currently used; available for temporary workarounds.
47 args="-k NEVER_CHECK"
49 # We intentionally don't depend on $MACH here, and thus no $ROOT. If
50 # a proto area exists, then we use it. This allows this script to be
51 # run against gates (which should contain both SPARC and x86 proto
52 # areas), build workspaces (which should contain just one proto area),
53 # and unbuilt workspaces (which contain no proto areas).
54 if [ "$b_flg" = y ]; then
55 rootlist=
56 elif [ $# -gt 0 ]; then
57 rootlist=$*
58 else
59 rootlist="$SRCTOP/proto/root_sparc $SRCTOP/proto/root_i386"
62 for ROOT in $rootlist
64 case "$ROOT" in
65 *sparc|*sparc-nd)
66 arch=sparc
68 *i386|*i386-nd)
69 arch=i386
72 echo "$ROOT has unknown architecture." >&2
73 exit 1
75 esac
76 if [ -d $ROOT ]; then
78 # This is the old-style packaging exception list, from
79 # the svr4-specific usr/src/pkgdefs
81 [ -f $SRC/pkgdefs/etc/exception_list_$arch ] && \
82 validate_paths '-s/\s*'$arch'$//' \
83 -e ^usr/include/ike/ -b $ROOT \
84 $args $SRC/pkgdefs/etc/exception_list_$arch
86 # These are the new-style packaging exception lists,
87 # from the repository-wide exception_lists/ directory.
89 e="$SRCTOP/exception_lists/packaging"
90 for f in $e; do
91 if [ -f $f ]; then
92 nawk 'NF == 1 || /[ ]\+'$arch'$/ { print; }' \
93 < $f | validate_paths -b $ROOT -n $f
95 done
97 done
99 if [ -f $SRC/tools/opensolaris/license-list ]; then
100 sed -e 's/$/.descrip/' < $SRC/tools/opensolaris/license-list | \
101 validate_paths -n SRC/tools/opensolaris/license-list
104 exit 0