updated wmakeLnIncludeAll

- search for 'lnInclude' rather than 'Make' by default
  This gives better general behaviour for rebuilding.
This commit is contained in:
Mark Olesen
2009-07-21 08:59:49 +02:00
parent 4f6f570d6d
commit 7215571eb7

View File

@ -27,38 +27,68 @@
# wmakeLnIncludeAll
#
# Description
# Find directories containing a Make/ directory and execute
# Find directories containing an lnInclude/ directory and execute
# 'wmakeLnInclude -f' for each one
#
#------------------------------------------------------------------------------
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo
echo " Find directories containing a Make/ directory and"
echo " execute 'wmakeLnInclude -f' for each one"
echo
exit 1
fi
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [-make] [dir1 .. dirN]
Find directories containing an lnInclude/ directory and execute
'wmakeLnInclude -f' for each one
Note
Use the '-make' option to search for Make/ instead of lnInclude/
USAGE
exit 1
}
#------------------------------------------------------------------------------
findName=lnInclude
# simple parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help) # provide immediate help
usage
;;
-make)
shift
findName=Make
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# default to searching from pwd
[ "$#" -gt 0 ] || set -- .
for checkDir
do
if [ -d $checkDir ]
then
echo "searching: $checkDir for 'Make' directories"
echo "searching: $checkDir for '$findName' directories"
echo "---------"
else
echo "skipping non-dir: $checkDir"
echo "----------------"
continue
fi
find $checkDir -depth -type d -name Make -print | while read dir
find $checkDir -depth -type d -name $findName -print | while read dir
do
dir=${dir%/Make} # trim /Make directory from the end
dir=${dir%/$findName} # trim findName from the end
if [ -d "$dir" ]
then
wmakeLnInclude -f $dir