#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# xref: build and maintain source cross-reference databases.
#
MAKE="dmake -m serial"
#
# The CSCOPEOPTIONS variable can cause problems if it's set in the environment
# when using cscope; remove it.
#
unset CSCOPEOPTIONS
#
# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
# under certain circumstances, which can really screw things up; unset it.
#
unset CDPATH
#
# Print the provided failure message and exit with an error.
#
{
exit 1
}
#
# Print the provided warning message.
#
{
}
#
# Print the provided informational message.
#
{
echo $PROG: $@
}
#
# Print the provided informational message, and the current value of $SECONDS
# in a user-friendly format.
#
{
info "$1 in ${min}m${sec}s"
}
if [[ $SCM_MODE == "unknown" ]];then
print -u2 "Unable to determine SCM type currently in use."
exit 1
fi
export CODEMGR_WS
c)
clobber=y
;;
f)
noflg=y
;;
m)
;;
p)
#
# The ENVCPPFLAGS* environment variables contain the include
# paths to our proto areas; clear 'em so that they don't end
# up in CPPFLAGS, and thus don't end up in XRINCS in xref.mk.
#
;;
x)
;;
\?)
echo "usage: $PROG [-cfp] [-m <makefile>]"\
"[-x cscope|ctags|etags[,...]] [<subtree> ...]"\
exit 1
;;
esac
done
#
# Get the list of directories before we reset $@.
#
dirs=$@
[ -z "$dirs" ] && dirs=.
#
# Get the canonical path to the workspace. This allows xref to work
# even in the presence of lofs(7FS).
#
cd $CODEMGR_WS
CODEMGR_WS=`/bin/pwd`
#
# Process the xref format list. For convenience, support common synonyms
# for the xref formats.
#
if [ -z "$xrefs" ]; then
#
# Disable etags if we can't find it.
#
xrefs="cscope ctags"
else
IFS=,
set -- $xrefs
for xref; do
;;
;;
;;
*)
;;
esac
done
fi
#
# Process the requested list of directories.
#
if [ ! -d $dir ]; then
continue
fi
#
# NOTE: we cannot use $PWD because it will mislead in the presence
# of lofs(7FS).
#
reldir=${pwd##${CODEMGR_WS}/}
continue
fi
#
# If we're building cross-references, then run `xref.clean' first
# to purge any crud that may be lying around from previous aborted runs.
#
if [ -z "$clobber" ]; then
fi
#
# Find flg-related source files, if requested.
#
SECONDS=0
if [ $? -ne 0 ]; then
else
msg="found 1 flg-related source file"
else
fi
fi
fi
#
# Build or clobber all of the requested cross-references.
#
if [ -n "$clobber" ]; then
continue
fi
SECONDS=0
done
done
exit 0