2015-10-29 11:45:15 +01:00
|
|
|
DIR="bionic dalvik device frameworks hardware libnativehelper system packages"
|
2015-01-14 14:29:02 +01:00
|
|
|
TMP=$(mktemp /tmp/XXXXX-cscope.files)
|
|
|
|
|
2015-10-29 11:45:15 +01:00
|
|
|
gettop ()
|
|
|
|
{
|
|
|
|
local TOPFILE=build/core/envsetup.mk;
|
|
|
|
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
|
|
|
|
echo $TOP;
|
|
|
|
else
|
|
|
|
if [ -f $TOPFILE ]; then
|
|
|
|
PWD= /bin/pwd;
|
|
|
|
else
|
|
|
|
local HERE=$PWD;
|
|
|
|
T=;
|
|
|
|
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
|
|
|
|
\cd ..;
|
|
|
|
T=`PWD= /bin/pwd`;
|
|
|
|
done;
|
|
|
|
\cd $HERE;
|
|
|
|
if [ -f "$T/$TOPFILE" ]; then
|
|
|
|
echo $T;
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
T=$(gettop);
|
|
|
|
if [ "$T" ]; then
|
|
|
|
\cd $(gettop);
|
|
|
|
else
|
|
|
|
echo "Couldn't locate the top of the tree. Try setting TOP.";
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2015-01-14 14:29:02 +01:00
|
|
|
for dir in $DIR;
|
|
|
|
do
|
|
|
|
echo "Looking for files in $dir"
|
2015-02-27 15:51:51 +01:00
|
|
|
find $PWD/$dir -name .git -prune -o -type f \( -iname '*.c' -o -iname '*.cc' -o -iname '*.cpp' -o -iname '*.h' -o -iname '*.hpp' -o -iname "*.mk" -o -iname "*.java" -o -iname "*.aidl" \) | egrep -v "/\.git$" >> $TMP
|
2015-01-14 14:29:02 +01:00
|
|
|
done
|
|
|
|
|
2015-02-27 15:51:51 +01:00
|
|
|
echo "generate cscope"
|
2015-01-14 14:29:02 +01:00
|
|
|
cscope -bkq -i $TMP
|
|
|
|
|
2015-10-29 11:45:15 +01:00
|
|
|
echo "generate ctags"
|
|
|
|
ctags --c-kinds=+px --c++-kinds=+px --fields=+iaS --extra=+q -L $TMP
|
|
|
|
|
2015-01-14 14:29:02 +01:00
|
|
|
rm $TMP
|