ENH: "wmake all" makes 'libso' instead of 'exe' where appropriate
- adds more DWIM (do what I mean) intelligence to wmake ENH: use ~/.OpenFOAM/.wmake instead of ~/.wmakeScheduler for the lock dir - keeps more of the OpenFOAM bits together
This commit is contained in:
parent
2599c9e1c1
commit
9707e5c100
34
wmake/wclean
34
wmake/wclean
@ -46,12 +46,10 @@ Clean up the wmake control directory Make/\$WM_OPTIONS and remove the
|
||||
lnInclude directories generated for libraries.
|
||||
|
||||
The targets correspond to a subset of the 'wmake' special targets:
|
||||
all all subdirectories
|
||||
(NB: any Allwclean or Allclean files will be used if they exist)
|
||||
exe clean dir/Make
|
||||
lib clean dir/Make and dir/lnInclude
|
||||
libo clean dir/Make and dir/lnInclude
|
||||
libso clean dir/Make and dir/lnInclude
|
||||
all all subdirectories, uses any Allwclean or Allclean
|
||||
files if they exist
|
||||
exe | lib | libo | libso
|
||||
clean Make, any *.dep files and lnInclude directories
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
@ -122,20 +120,21 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# This is the end of the recursion down the application directories tree
|
||||
# so remove the "all" option so that the call to make builds the application
|
||||
makeOption=
|
||||
fi
|
||||
|
||||
# makeOption is not needed beyond this point
|
||||
unset makeOption
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check the existance of the Make directory
|
||||
# Require the existence of the 'Make' directory
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if [ ! -d $MakeDir ]
|
||||
then
|
||||
[ -d $MakeDir ] || {
|
||||
echo "$Script error: '$MakeDir' directory does not exist" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@ -143,13 +142,10 @@ rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes 2>/dev/null
|
||||
|
||||
find . -name "*.dep" -exec rm {} \;
|
||||
|
||||
case "$makeOption" in
|
||||
lib | libo | libso )
|
||||
rm -rf lnInclude 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
# always safe to remove lnInclude
|
||||
rm -rf lnInclude 2>/dev/null
|
||||
|
||||
rm -rf ii_files Templates.DB 2>/dev/null
|
||||
rm -f so_locations
|
||||
rm -f so_locations 2>/dev/null
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
44
wmake/wmake
44
wmake/wmake
@ -44,16 +44,15 @@ options:
|
||||
A general, easy-to-use make system for multi-platform development
|
||||
|
||||
The 'target' is a Makefile target:
|
||||
e.g., Make/linux64GccDPOpt/fvMesh.o
|
||||
e.g., Make/linux64GccDPOpt/fvMesh.o
|
||||
|
||||
or a special target:
|
||||
all all subdirectories
|
||||
(NB: any Allwmake files will be used if they exist)
|
||||
exe build statically linked executable
|
||||
lib build statically linked archive lib (.a)
|
||||
libo build statically linked lib (.o)
|
||||
libso build dynamically linked lib (.so)
|
||||
jar build Java jar
|
||||
all all subdirectories, uses any Allwmake files if they exist
|
||||
exe build statically linked executable
|
||||
lib build statically linked archive lib (.a)
|
||||
libo build statically linked lib (.o)
|
||||
libso build dynamically linked lib (.so)
|
||||
jar build Java jar
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
@ -104,7 +103,7 @@ if [ "$WM_NCOMPPROCS" ]
|
||||
then
|
||||
if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
|
||||
then
|
||||
lockDir=$HOME/.wmakeScheduler
|
||||
lockDir=$HOME/.$WM_PROJECT/.wmake
|
||||
|
||||
if [ -d $lockDir ]
|
||||
then
|
||||
@ -168,16 +167,11 @@ then
|
||||
$make -k -f $WM_DIR/MakefileApps FOAM_APPS="$FOAM_APPS"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# This is the end of the recursion down the application directories tree
|
||||
# so remove the "all" option so that the call to make builds the application
|
||||
makeOption=
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check the existance of the Make directory and files file
|
||||
# If both exist, make the wmake derived files
|
||||
# Require the existence of the 'Make' directory and 'files' file
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
[ -d $MakeDir ] || {
|
||||
@ -190,6 +184,18 @@ fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
# transform "all" option to "libso" if that looks appropriate or remove it
|
||||
# so that the call to make builds the application
|
||||
if [ "$makeOption" = all ]
|
||||
then
|
||||
unset makeOption
|
||||
if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1
|
||||
then
|
||||
makeOption=libso
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Spawn a sub-shell and unset MAKEFLAGS in that sub-shell to avoid
|
||||
# files and options being built in parallel
|
||||
(
|
||||
@ -227,12 +233,8 @@ esac
|
||||
|
||||
$make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/dontIncludeDeps $OBJECTS_DIR/dependencies
|
||||
|
||||
retVal=$?
|
||||
if [ $retVal -ne 0 ]
|
||||
then
|
||||
exit $retVal
|
||||
fi
|
||||
|
||||
rc=$?
|
||||
[ $rc -eq 0 ] || exit $rc
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# make the object files and link
|
||||
|
@ -78,12 +78,12 @@ do
|
||||
continue
|
||||
fi
|
||||
|
||||
find $checkDir -depth -type d -name Make -print | while read makeDir
|
||||
find $checkDir -depth -type d -name Make -print | while read MakeDir
|
||||
do
|
||||
topDir=${makeDir%/Make} # trim /Make from the end
|
||||
topDir=${MakeDir%/Make} # trim /Make from the end
|
||||
if [ -d "$topDir" ]
|
||||
then
|
||||
if grep -e '^ *LIB *=' "$makeDir/files" >/dev/null 2>&1
|
||||
if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1
|
||||
then
|
||||
wmakeLnInclude -f $topDir
|
||||
elif [ -d "$topDir/lnInclude" ]
|
||||
|
@ -48,8 +48,7 @@
|
||||
# eg, export WM_NCOMPPROCS=$(wmakeScheduler -count)
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
lockDir=$HOME/.wmakeScheduler
|
||||
|
||||
lockDir=$HOME/.$WM_PROJECT/.wmake
|
||||
# fallback - 1 core on current host
|
||||
: ${WM_HOSTS:=$HOST:1}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user