Skip to content
Snippets Groups Projects
Commit 4d29c32e authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: improve handling of wmakeLnIncludeAll default search directories

- if called from the top-level project directory ($WM_PROJECT_DIR)
  default to using {applications,src} directories. This avoids
  erroneous linking of etc/codeTemplates and avoids the lengthy
  scanning of the tutorials directory
parent d4c7d8c6
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# wmakeLnIncludeAll [dir1 .. dirN] # wmakeLnIncludeAll [dir1 .. dirN]
# #
# Description # Description
# Find directories with a 'Make/files' that contains a 'LIB =' directive # Find directories with a 'Make/files' containing a 'LIB =' directive
# and execute 'wmakeLnInclude' for each one # and execute 'wmakeLnInclude' for each one
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
...@@ -46,7 +46,7 @@ options: ...@@ -46,7 +46,7 @@ options:
-jN or -j N Compile using N cores/hyperthreads -jN or -j N Compile using N cores/hyperthreads
-h | -help Print the usage -h | -help Print the usage
Find directories with a 'Make/files' that contains a 'LIB =' directive Find directories with a 'Make/files' containing a 'LIB =' directive
and execute 'wmakeLnInclude -update' for each one and execute 'wmakeLnInclude -update' for each one
USAGE USAGE
...@@ -93,6 +93,18 @@ do ...@@ -93,6 +93,18 @@ do
shift shift
done done
# Default search is from CWD, with special handling of the top-level
# project directory: {applications,src} directories
if [ "$#" -eq 0 ]
then
if wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null
then
set -- applications src
else
set -- .
fi
fi
if [ "$nCores" -gt 0 ] if [ "$nCores" -gt 0 ]
then then
echo "$Script: starting wmakeLnInclude processes on $nCores cores" echo "$Script: starting wmakeLnInclude processes on $nCores cores"
...@@ -100,10 +112,6 @@ else ...@@ -100,10 +112,6 @@ else
echo "$Script: running wmakeLnInclude" echo "$Script: running wmakeLnInclude"
fi fi
# Defaults to searching from CWD
[ "$#" -gt 0 ] || set -- .
for checkDir for checkDir
do do
if [ -d $checkDir ] if [ -d $checkDir ]
...@@ -114,7 +122,7 @@ do ...@@ -114,7 +122,7 @@ do
continue continue
fi fi
find $checkDir -depth -type d -name Make -print | while read MakeDir find $checkDir -depth -name Make -type d -print | while read MakeDir
do do
topDir=${MakeDir%/Make} # trim /Make from the end topDir=${MakeDir%/Make} # trim /Make from the end
if [ -d "$topDir" ] if [ -d "$topDir" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment