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.
This commit is contained in:
Mark Olesen
2009-03-04 13:14:11 +01:00
parent 1a2bcf7d84
commit db8febe9f9
3 changed files with 25 additions and 19 deletions

View File

@ -5,8 +5,8 @@ set -x
# update OpenFOAM version strings if required # update OpenFOAM version strings if required
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
wmakeLnInclude -f OpenFOAM -sf wmakeLnInclude -f OpenFOAM
wmakeLnInclude -f OSspecific/$WM_OS -sf wmakeLnInclude -f OSspecific/$WM_OS
Pstream/Allwmake Pstream/Allwmake
wmake libo OSspecific/$WM_OS wmake libo OSspecific/$WM_OS

View File

@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmakeLnInclude -f ../incompressible/LES -sf wmakeLnInclude -f ../incompressible/LES
wmake libso LESfilters wmake libso LESfilters
wmake libso LESdeltas wmake libso LESdeltas

View File

@ -47,10 +47,13 @@ usage() {
usage: $Script [-f] <dir> [-lnOption] usage: $Script [-f] <dir> [-lnOption]
Link all the source files in the <dir> into <dir>/lnInclude 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 USAGE
exit 1 exit 1
} }
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -59,6 +62,9 @@ USAGE
unset forceUpdate unset forceUpdate
unset findOpt unset findOpt
# default ln option
lnOpt="-s"
# simple parse options # simple parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -69,9 +75,10 @@ do
-f) -f)
shift shift
forceUpdate=1 forceUpdate=1
lnOpt="-sf"
;; ;;
-*) -*)
usage "unknown option/argument: '$*'" usage "unknown option: '$*'"
;; ;;
*) *)
break break
@ -79,7 +86,17 @@ do
esac esac
done 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 # convert incorrect path/dir/lnInclude to something sensible
while [ "${baseDir##*/}" = lnInclude ] while [ "${baseDir##*/}" = lnInclude ]
do do
@ -92,17 +109,6 @@ done
incDir=$baseDir/lnInclude 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 ] if [ ! -d $baseDir ]
then then
echo "$Script error: base directory $baseDir does not exist" 1>&2 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) # 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 # create links, avoid recreating links unless necessary