COMP: update lnInclude directories when building (issue #364)

- Could be related to interrupted builds.
  So if there are any parts of the build that rely on an explicit
  'wmakeLnInclude', make sure that the contents are properly updated.

--

ENH: improved feedback from top-level Allwmake

- Report which section (libraries, applications) is being built.

- Provide final summary of date, version, etc, which can be helpful
  for later diagnosis or record keeping.

- The -log=XXX option for Allwmake now accepts a directory name
  and automatically appends an appropriate log name.
  Eg,
      ./Allwmake -log=logs/  ->> logs/log.linux64GccDPInt32Opt

  The default name is built from the value of WM_OPTIONS.

--

BUG: shell not exiting properly in combination with -log option

- the use of 'tee' causes the shell to hang around.
  Added an explicit exit to catch this.

--

- Detecting the '-k' (-non-stop) option at the top-level Allwmake, which
  may improve robustness.

- Explicit continue-on-error for foamyMesh (as optional component)

- unify format of script messages for better readability

COMP: reduce warnings when building Pstream (old-style casts in openmpi)
This commit is contained in:
Mark Olesen
2016-12-22 11:26:29 +01:00
parent 5f811ac09d
commit 608bb5d83b
19 changed files with 121 additions and 124 deletions

View File

@ -25,14 +25,25 @@ if [ -d "$WM_THIRD_PARTY_DIR" ]
then then
$WM_THIRD_PARTY_DIR/Allwmake $WM_THIRD_PARTY_DIR/Allwmake
else else
echo "Allwmake: no ThirdParty directory found - skipping" echo "No ThirdParty directory found - skipping"
fi fi
# Compile OpenFOAM libraries and applications echo "========================================"
echo "Compile OpenFOAM libraries"
echo
src/Allwmake $targetType $* src/Allwmake $targetType $*
# Compile OpenFOAM libraries and applications echo "========================================"
echo "Compile OpenFOAM applications"
echo
applications/Allwmake $targetType $* applications/Allwmake $targetType $*
# Some summary information
echo
/usr/bin/date
echo "========================================"
echo " ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -6,9 +6,7 @@ if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
then then
wmake wmake
else else
echo echo "==> skip dnsFoam solver (no FFTW)"
echo "Skipping dnsFoam solver (no FFTW)"
echo
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -7,11 +7,11 @@ cd ${0%/*} || exit 1 # Run from this directory
# Only build if libraries already exist # Only build if libraries already exist
if [ -e $FOAM_LIBBIN/libccm.so ] if [ -e $FOAM_LIBBIN/libccm.so ]
then then
echo "Building optional ccm conversion components." echo "==> build optional ccm conversion components"
wmake $targetType ccmToFoam wmake $targetType ccmToFoam
wmake $targetType foamToCcm wmake $targetType foamToCcm
else else
echo "Skipping optional ccm conversion components (no libccm.so)." echo "==> skip optional ccm conversion components (no libccm.so)"
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,6 +1,11 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Optional unit: continue-on-error
# - may not have CGAL installed,
# - or the CGAL installation moved and gives CMake problems
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation # Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
@ -14,6 +19,7 @@ then
# wmake foamyHexMeshBackgroundMesh # wmake foamyHexMeshBackgroundMesh
# (cd foamyHexMeshSurfaceSimplify && ./Allwmake) # (cd foamyHexMeshSurfaceSimplify && ./Allwmake)
# wmake cellSizeAndAlignmentGrid # wmake cellSizeAndAlignmentGrid
echo "Finish ${PWD##*/}" # Also for a clean exit code
else else
echo "WARNING: cannot build ${PWD##*/} without CGAL" echo "WARNING: cannot build ${PWD##*/} without CGAL"
fi fi

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
#set -x
wclean libso vtkPVReaders wclean libso vtkPVReaders
PVblockMeshReader/Allwclean PVblockMeshReader/Allwclean

View File

@ -8,31 +8,25 @@ export WM_CONTINUE_ON_ERROR=true
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# #
# There are several prerequisites for building a plugin # There are several prerequisites for building plugins
# #
#set -x #set -x
canBuildPlugin() canBuildPlugin()
{ {
[ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || { [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || {
echo echo "==> cannot build ParaView plugins without paraview directory"
echo "WARNING: cannot build ParaView plugin(s) without paraview directory"
echo " ParaView_DIR=$ParaView_DIR" echo " ParaView_DIR=$ParaView_DIR"
echo
return 1 return 1
} }
[ -n "$PV_PLUGIN_PATH" ] || { [ -n "$PV_PLUGIN_PATH" ] || {
echo echo "==> ${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugins"
echo "${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugin(s)"
echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}" echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}"
echo
return 1 return 1
} }
type cmake > /dev/null 2>&1 || { type cmake > /dev/null 2>&1 || {
echo echo "==> cannot build ParaView plugins without cmake"
echo "WARNING: cannot build ParaView plugin(s) without cmake"
echo
return 1 return 1
} }
@ -62,10 +56,8 @@ case "$major" in
fi fi
;; ;;
*) *)
echo echo "==> skip build of ParaView plugins"
echo "NOTE: skipping build of ParaView plugin(s)"
echo " include directory was for paraview major version '${major:-none}'" echo " include directory was for paraview major version '${major:-none}'"
echo
;; ;;
esac esac

View File

@ -6,9 +6,7 @@ if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
then then
wmake wmake
else else
echo echo "==> skip noise utility (no FFTW)"
echo "Skipping noise utility (no FFTW)"
echo
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -6,9 +6,7 @@ if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
then then
wmake wmake
else else
echo echo "==> skip boxTurb utility (no FFTW)"
echo "Skipping boxTurb utility (no FFTW)"
echo
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -20,8 +20,8 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
# Update OpenFOAM version strings if required # Update OpenFOAM version strings if required
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
wmakeLnInclude OpenFOAM wmakeLnInclude -u OpenFOAM
wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX} wmakeLnInclude -u OSspecific/${WM_OSTYPE:-POSIX}
Pstream/Allwmake $targetType $* Pstream/Allwmake $targetType $*
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake $targetType $* OSspecific/${WM_OSTYPE:-POSIX}/Allwmake $targetType $*
@ -38,7 +38,7 @@ wmake $targetType edgeMesh
parallel/decompose/AllwmakeLnInclude parallel/decompose/AllwmakeLnInclude
dummyThirdParty/Allwmake $targetType $* dummyThirdParty/Allwmake $targetType $*
wmakeLnInclude fvOptions wmakeLnInclude -u fvOptions
wmake $targetType finiteVolume wmake $targetType finiteVolume
wmake $targetType lagrangian/basic wmake $targetType lagrangian/basic

View File

@ -1,5 +1,5 @@
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB) sinclude $(RULES)/mplib$(WM_MPLIB)
EXE_INC = $(PFLAGS) $(PINC) EXE_INC = $(PFLAGS) $(PINC) $(c++LESSWARN)
LIB_LIBS = $(PLIBS) LIB_LIBS = $(PLIBS)

View File

@ -8,7 +8,7 @@ wmake $targetType turbulenceModels
wmake $targetType incompressible wmake $targetType incompressible
wmake $targetType compressible wmake $targetType compressible
wmake $targetType schemes wmake $targetType schemes
wmakeLnInclude phaseIncompressible wmakeLnInclude -u phaseIncompressible
wmakeLnInclude phaseCompressible wmakeLnInclude -u phaseCompressible
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -2,15 +2,11 @@
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake $targetType wmake $targetType
ccm/Allwmake || { ccm/Allwmake
echo
echo "WARNING: skipped optional conversion component (build issues detected)"
echo
}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
#
# Build optional components (eg, may depend on third-party libraries) # Build optional components (eg, may depend on third-party libraries)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
@ -11,23 +10,27 @@ cd ${0%/*} || exit 1 # Run from this directory
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
# Link with static libccmio only (possibly fewer issues) # Link with static libccmio only (possibly fewer issues)
if [ "$WM_LABEL_SIZE" = 64 ]
warning="==> skip optional libccm adapter"
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
then then
# The libccmio uses int32_t. # The libccmio uses int32_t.
# The OpenFOAM adapter thus requires additional work for 64-bit labels. # The OpenFOAM adapter thus requires additional work for 64-bit labels.
echo "Skipping optional 'libccm' adapter component"
echo " does not support 64-bit labels"
elif [ "$WM_PRECISION_OPTION" = SP ]
then
# The OpenFOAM adapter was originally only designed for 'double' # The OpenFOAM adapter was originally only designed for 'double'
echo "Skipping optional 'libccm' adapter component"
echo " was not originally designed for 'single precision' values" if [ "$WM_LABEL_SIZE" = 64 ]
elif [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \ then
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ] echo "$warning (not designed for 64-bit labels)"
then elif [ "$WM_PRECISION_OPTION" = SP ]
wmake libso then
echo "$warning (not designed for single precision)"
else
wmake libso || echo "$warning (build issues detected)"
fi
else else
echo "Skipping optional component libccm" echo $warning
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -8,12 +8,10 @@ cd ${0%/*} || exit 1 # Run from this directory
[ -n "$WM_CC" ] && export CC="$WM_CC" [ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX" [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
echo
echo "======================================================================" echo "======================================================================"
echo "${PWD##*/} : $PWD" echo "${PWD##*/} : $PWD"
echo echo
# CMake into objectsDir, # CMake into objectsDir,
# with an additional attempt if (possibly incorrect) CMakeCache.txt existed # with an additional attempt if (possibly incorrect) CMakeCache.txt existed
doCmake() doCmake()
@ -64,6 +62,5 @@ else
fi fi
echo "======================================================================" echo "======================================================================"
echo
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -8,22 +8,18 @@ cd ${0%/*} || exit 1 # Run from this directory
# - return 0 and export METIS_ARCH_PATH on success # - return 0 and export METIS_ARCH_PATH on success
hasMetis() hasMetis()
{ {
echo local warning="==> skip metis"
echo "Metis decomposition"
unset METIS_ARCH_PATH METIS_VERSION unset METIS_ARCH_PATH METIS_VERSION
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || { settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
echo echo "$warning (no config.sh/metis settings)"
echo "Error: no config.sh/metis settings"
echo
return 1 return 1
} }
. $settings . $settings
if [ -z "$METIS_ARCH_PATH" -o "${METIS_ARCH_PATH##*-}" = none ] if [ -z "$METIS_ARCH_PATH" -o "${METIS_ARCH_PATH##*-}" = none ]
then then
echo " skipping - no metis" echo "$warning (not available)"
echo
return 1 return 1
fi fi
@ -34,8 +30,7 @@ hasMetis()
[ -f "$header" ] || header=/usr/include/metis.h [ -f "$header" ] || header=/usr/include/metis.h
fi fi
[ -f "$header" ] || { [ -f "$header" ] || {
echo " skipping - no metis header" echo "$warning (no header)"
echo
return 2 # file not found return 2 # file not found
} }
@ -43,25 +38,23 @@ hasMetis()
[ -r $FOAM_EXT_LIBBIN/libmetis.so ] || \ [ -r $FOAM_EXT_LIBBIN/libmetis.so ] || \
[ -r $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so ] || \ [ -r $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so ] || \
[ "${METIS_ARCH_PATH##*-}" = system ] || { [ "${METIS_ARCH_PATH##*-}" = system ] || {
echo " skipping - missing library" echo "$warning (missing library)"
echo
return 2 return 2
} }
# Ensure consistent sizes between OpenFOAM and metis header # Ensure consistent sizes between OpenFOAM and metis header
# Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake # Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
local label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header) local label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header)
[ "$WM_LABEL_SIZE" = "$label" ] || { : ${label:=unknown}
echo " skipping - label=$WM_LABEL_SIZE, metis.h has '$label'"
echo
return 1
}
echo "using METIS_ARCH_PATH=$METIS_ARCH_PATH" if [ "$WM_LABEL_SIZE" = "$label" ]
echo " label=$label" then
echo echo "Metis (label=$label) - $METIS_ARCH_PATH"
export METIS_ARCH_PATH export METIS_ARCH_PATH
return 0 # success else
echo "$warning (label=$WM_LABEL_SIZE, metis.h has '$label')"
return 1
fi
} }
@ -69,22 +62,18 @@ hasMetis()
# - return 0 and export SCOTCH_ARCH_PATH, SCOTCH_VERSION on success # - return 0 and export SCOTCH_ARCH_PATH, SCOTCH_VERSION on success
hasScotch() hasScotch()
{ {
echo local warning="==> skip scotch"
echo "Scotch decomposition"
unset SCOTCH_ARCH_PATH SCOTCH_VERSION unset SCOTCH_ARCH_PATH SCOTCH_VERSION
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || { settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
echo echo "$warning (no config.sh/scotch settings)"
echo "Error: no config.sh/scotch settings"
echo
return 1 return 1
} }
. $settings . $settings
if [ -z "$SCOTCH_ARCH_PATH" -o "${SCOTCH_ARCH_PATH##*-}" = none ] if [ -z "$SCOTCH_ARCH_PATH" -o "${SCOTCH_ARCH_PATH##*-}" = none ]
then then
echo " skipping - no scotch" echo "$warning (not available)"
echo
return 1 return 1
fi fi
@ -95,8 +84,7 @@ hasScotch()
[ -f "$header" ] || header=/usr/include/scotch.h [ -f "$header" ] || header=/usr/include/scotch.h
fi fi
[ -f "$header" ] || { [ -f "$header" ] || {
echo " skipping - no scotch header" echo "$warning (no header)"
echo
return 2 # file not found return 2 # file not found
} }
@ -104,8 +92,7 @@ hasScotch()
[ -r $FOAM_EXT_LIBBIN/libscotch.so ] || \ [ -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
[ -r $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so ] || \ [ -r $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so ] || \
[ "${SCOTCH_ARCH_PATH##*-}" = system ] || { [ "${SCOTCH_ARCH_PATH##*-}" = system ] || {
echo " skipping - missing library" echo "$warning (missing library)"
echo
return 2 return 2
} }
@ -116,18 +103,18 @@ hasScotch()
"$header") "$header")
: ${label:=unknown} : ${label:=unknown}
[ "$WM_LABEL_SIZE" = 32 -a \( "$label" = int32_t -o "$label" = int \) ] || \
[ "$WM_LABEL_SIZE" = 64 -a \( "$label" = int64_t -o "$label" = long \) ] || {
echo " skipping - label='$WM_LABEL_SIZE', scotch.h has '$label'"
echo
return 1
}
echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" case "$WM_LABEL_SIZE:$label" in
echo " label=$label ($WM_LABEL_SIZE)" (32:int32_t | 32:int | 64:int64_t | 64:long)
echo echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
export SCOTCH_ARCH_PATH SCOTCH_VERSION export SCOTCH_ARCH_PATH SCOTCH_VERSION
return 0 # success ;;
*)
echo "$warning (label='$WM_LABEL_SIZE', scotch.h has '$label')"
return 1
;;
esac
} }
@ -156,7 +143,7 @@ wmakeMpiLib()
done done
} }
wmakeLnInclude decompositionMethods wmakeLnInclude -u decompositionMethods
if hasScotch if hasScotch
then then

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
wmakeLnInclude decompositionMethods wmakeLnInclude -u decompositionMethods
wmakeLnInclude metisDecomp wmakeLnInclude -u metisDecomp
wmakeLnInclude scotchDecomp wmakeLnInclude -u scotchDecomp
wmakeLnInclude ptscotchDecomp wmakeLnInclude -u ptscotchDecomp
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation # Parse arguments for library compilation
targetType=libso targetType=libso
@ -8,11 +8,10 @@ targetType=libso
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \ if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ] [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
then then
# If it fails, we want to know.
wmake $targetType wmake $targetType
else else
echo echo "==> skip randomProcesses library (no FFTW)"
echo "Skipping randomProcesses library (no FFTW)"
echo
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -6,35 +6,31 @@ targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
## Get ZOLTAN_ARCH_PATH ## Get ZOLTAN_ARCH_PATH
#if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan` #if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan)
#then #then
# . $settings # . $settings
# echo "using ZOLTAN_ARCH_PATH=$ZOLTAN_ARCH_PATH" # echo "using ZOLTAN_ARCH_PATH=$ZOLTAN_ARCH_PATH"
#else #else
# echo
# echo "Error: no config.sh/zoltan settings" # echo "Error: no config.sh/zoltan settings"
# echo
#fi #fi
wmake $targetType renumberMethods wmake $targetType renumberMethods
warning="==> skip SloanRenumber"
if [ -f "$BOOST_ARCH_PATH/include/boost/version.hpp" ] || \ if [ -f "$BOOST_ARCH_PATH/include/boost/version.hpp" ] || \
[ "${BOOST_ARCH_PATH##*-}" = system -a -f /usr/include/boost/version.hpp ] [ "${BOOST_ARCH_PATH##*-}" = system -a -f /usr/include/boost/version.hpp ]
then then
wmake $targetType SloanRenumber wmake $targetType SloanRenumber || echo "$warning (build issues detected)"
else else
echo echo "$warning (no boost)"
echo "Skipping SloanRenumber (no boost)"
echo
fi fi
warning="==> skip zoltanRenumber"
if [ -d "$ZOLTAN_ARCH_PATH" ] if [ -d "$ZOLTAN_ARCH_PATH" ]
then then
wmake $targetType zoltanRenumber wmake $targetType zoltanRenumber || echo "$warning (build issues detected)"
else else
echo echo "$warning (no library)"
echo "Skipping zoltanRenumber"
echo
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -71,13 +71,24 @@ do
# If called from wmake (to avoid recursion) # If called from wmake (to avoid recursion)
fromWmake=true fromWmake=true
;; ;;
-k | -non-stop)
# Non-stop compilation, ignoring errors
export WM_CONTINUE_ON_ERROR=true
continue # Permanently remove arg
;;
-l | -log) -l | -log)
optLog="log.${WM_OPTIONS:-Allwmake}" optLog="log.${WM_OPTIONS:-Allwmake}"
continue # Permanently remove arg continue # Permanently remove arg
;; ;;
-log=*) -log=*)
optLog="${arg##*=}" optLog="${arg##*=}"
[ -n "$optLog" ] || optLog="log.${WM_OPTIONS:-Allwmake}" if [ -d "$optLog" ]
then
optLog="${optLog%/}/log.${WM_OPTIONS:-Allwmake}"
elif [ -z "$optLog" ]
then
optLog="log.${WM_OPTIONS:-Allwmake}"
fi
continue # Permanently remove arg continue # Permanently remove arg
;; ;;
-q | -queue) -q | -queue)
@ -104,15 +115,21 @@ then
if [ -z "$optLog" ] if [ -z "$optLog" ]
then then
exec wmake -all $optQueue $* exec wmake -all $optQueue $*
exit $? # Unneeded, but just in case something went wrong
else else
echo "logging wmake -all output to '$optLog'" 1>&2 echo "Logging wmake -all output to '$optLog'" 1>&2
exec wmake -all $optQueue $* 2>&1 | tee $optLog echo 1>&2
exec wmake -all $optQueue $* 2>&1 | /usr/bin/tee $optLog
# Need to cleanup after the tee
rc=$? # Error code from tee (not wmake), but not entirely important
echo "Done logging to '$optLog'" 1>&2
exit $rc
fi fi
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# If WM_CONTINUE_ON_ERROR not set activate the shell option "stop on error" # Activate the shell option "stop on error" unless WM_CONTINUE_ON_ERROR is set
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if [ -z "${WM_CONTINUE_ON_ERROR}" ] if [ -z "${WM_CONTINUE_ON_ERROR}" ]