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

wmakeLnInclude -f now also changes the default linking to 'ln -sf'

- this seems to be the most sensible solution.
  The changed time stamps on the links doesn't seem to bother make at all.
parent 1a2bcf7d
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -47,10 +47,13 @@ usage() {
usage: $Script [-f] <dir> [-lnOption]
Link all the source files in the <dir> into <dir>/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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment