Simplify the script. Make it work when objects are not in the source tree. Make it work on Solaris too.

This commit is contained in:
slamm%netscape.com 1999-01-28 00:21:32 +00:00
Родитель b4fd822224
Коммит 46041b48c7
1 изменённых файлов: 13 добавлений и 32 удалений

Просмотреть файл

@ -29,47 +29,30 @@
# Send comments, improvements, bugs to ramiro@netscape.com
#
# Make sure a Makefile.in exists
if [ ! -f Makefile.in ]
# Make sure a Makefile exists
if [ ! -f Makefile ]
then
echo
echo "There ain't no 'Makefile.in' over here: $pwd"
echo "There ain't no 'Makefile' over here: $pwd"
echo
exit
fi
# Use DEPTH in the Makefile.in to determine the depth
depth=`grep -w DEPTH Makefile.in | grep -e "\.\." | awk -F"=" '{ print $2; }'`
# Use DEPTH in the Makefile to determine the depth
depth=`egrep '^DEPTH[ ]*=[ ]*\.' Makefile | awk -F= '{ print $2; }'`
# Determine the depth count
n=`echo $depth | tr '/' ' ' | wc -w`
# Determine the path (strip anything before the mozilla/ root)
path=`pwd | awk -v count=$n -F"/" '\
{ for(i=NF-count+1; i <= NF ; i++) \
{ \
if (i!=NF) \
{ printf "%s/", $i } \
else \
{ printf "%s", $i } \
} \
}'`
dir=$path
# Add a slash only to dirs where depth >= mozilla_root
if [ $n -gt 0 ]
then
dir=${dir}"/"
fi
back=`pwd`
makefile=${dir}"Makefile"
# Get the full path to the Makefile
makefile=`pwd`/Makefile
# 'cd' to the root of the tree
echo depth=$depth
cd $depth
# Strip the tree root off the Makefile's path
root_path=`pwd`
makefile=`expr $makefile : $root_path'/\(.*\)'`
# Make sure config.status exists
if [ -f config.status ]
then
@ -79,5 +62,3 @@ else
echo "There ain't no 'config.status' over here: $pwd"
echo
fi
cd $back