diff --git a/src/Allwmake b/src/Allwmake
index c3ce648ba0..f22e0729db 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -5,8 +5,8 @@ set -x
# update OpenFOAM version strings if required
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
-wmakeLnInclude -f OpenFOAM -sf
-wmakeLnInclude -f OSspecific/$WM_OS -sf
+wmakeLnInclude -f OpenFOAM
+wmakeLnInclude -f OSspecific/$WM_OS
Pstream/Allwmake
wmake libo OSspecific/$WM_OS
diff --git a/src/turbulenceModels/LES/Allwmake b/src/turbulenceModels/LES/Allwmake
index d83439a913..a80c71ab57 100755
--- a/src/turbulenceModels/LES/Allwmake
+++ b/src/turbulenceModels/LES/Allwmake
@@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
-wmakeLnInclude -f ../incompressible/LES -sf
+wmakeLnInclude -f ../incompressible/LES
wmake libso LESfilters
wmake libso LESdeltas
diff --git a/wmake/wmakeLnInclude b/wmake/wmakeLnInclude
index 1ed1671e7a..c85ebd08a1 100755
--- a/wmake/wmakeLnInclude
+++ b/wmake/wmakeLnInclude
@@ -47,10 +47,13 @@ usage() {
usage: $Script [-f]
[-lnOption]
Link all the source files in the into /lnInclude
- * Use '-f' to force an update when the lnInclude directory already exists.
+
+Note
+ The '-f' option forces an update when the lnInclude directory already exists
+ and also changes the default linking from 'ln -s' to 'ln -sf'.
USAGE
- exit 1
+ exit 1
}
#------------------------------------------------------------------------------
@@ -59,6 +62,9 @@ USAGE
unset forceUpdate
unset findOpt
+# default ln option
+lnOpt="-s"
+
# simple parse options
while [ "$#" -gt 0 ]
do
@@ -69,9 +75,10 @@ do
-f)
shift
forceUpdate=1
+ lnOpt="-sf"
;;
-*)
- usage "unknown option/argument: '$*'"
+ usage "unknown option: '$*'"
;;
*)
break
@@ -79,7 +86,17 @@ do
esac
done
-baseDir=$1
+if [ $# -eq 1 ]
+then
+ baseDir=$1
+elif [ $# -eq 2 ]
+ baseDir=$1
+ lnOpt="$2"
+else
+ usage "ERROR: incorrect number of arguments"
+fi
+
+
# convert incorrect path/dir/lnInclude to something sensible
while [ "${baseDir##*/}" = lnInclude ]
do
@@ -92,17 +109,6 @@ done
incDir=$baseDir/lnInclude
-if [ $# -eq 1 ]
-then
- lnOpt="-s"
-elif [ $# -eq 2 ]
-then
- lnOpt="$2"
-else
- usage "ERROR: incorrect number of arguments"
-fi
-
-
if [ ! -d $baseDir ]
then
echo "$Script error: base directory $baseDir does not exist" 1>&2
@@ -136,7 +142,7 @@ echo "$Script: linking include files to $incDir"
#
# remove any broken links first (this helps when file locations have moved)
#
-find -L . -type l -exec rm \{\} \;
+find -L . -type l -exec rm {} \;
#
# create links, avoid recreating links unless necessary