diff --git a/Allwmake b/Allwmake index 9187532553..e9e7995414 100755 --- a/Allwmake +++ b/Allwmake @@ -1,37 +1,43 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation without documentation by default +genDoc=0 +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments wmakeCheckPwd "$WM_PROJECT_DIR" || { - echo "Error: Current directory is not \$WM_PROJECT_DIR" + echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR" echo " The environment variables are inconsistent with the installation." echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 } [ -n "$FOAM_EXT_LIBBIN" ] || { - echo "Error: FOAM_EXT_LIBBIN not set" + echo "Allwmake error: FOAM_EXT_LIBBIN not set" echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 } -# wmake is required for subsequent targets -( cd wmake/src && make ) +# Compile wmake support applications +(cd wmake/src && make) -# build ThirdParty sources +# Compile ThirdParty libraries and applications if [ -d "$WM_THIRD_PARTY_DIR" ] then $WM_THIRD_PARTY_DIR/Allwmake else - echo "no ThirdParty sources found - skipping" + echo "Allwmake: no ThirdParty directory found - skipping" fi -# build OpenFOAM libraries and applications -src/Allwmake $* -applications/Allwmake $* +# Compile OpenFOAM libraries and applications +src/Allwmake $targetType $* + +# Compile OpenFOAM libraries and applications +applications/Allwmake $targetType $* + +# Optionally build OpenFOAM Doxygen documentation +[ $genDoc -eq 1 ] && doc/Allwmake -if [ "$1" = doc ] -then - doc/Allwmake $* -fi # ----------------------------------------------------------------- end-of-file diff --git a/README.org b/README.org index fe0240d36d..b6b3bfb9d0 100644 --- a/README.org +++ b/README.org @@ -2,7 +2,7 @@ # #+TITLE: OpenFOAM README for version dev #+AUTHOR: The OpenFOAM Foundation -#+DATE: 10th December 2014 +#+DATE: 14th December 2014 #+LINK: http://www.openfoam.org #+OPTIONS: author:nil ^:{} # Copyright (c) 2014 OpenFOAM Foundation. @@ -28,10 +28,10 @@ [[http://www.OpenFOAM.org/git.php]] * Documentation - [[http://www.OpenFOAM.com/docs]] - -* Support and development contracts - [[http://www.OpenFOAM.com/support]] + [[http://www.OpenFOAM.org/docs]] * Reporting Bugs in OpenFOAM - [[http://www.OpenFOAM.com/bugs]] + [[http://www.OpenFOAM.org/bugs]] + +* Contacting the OpenFOAM Foundation + http://www.openfoam.org/contact diff --git a/applications/Allwmake b/applications/Allwmake index 7f7ac6718d..f23a233b64 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -1,22 +1,27 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments wmakeCheckPwd "$WM_PROJECT_DIR/applications" || { - echo "Error: Current directory is not \$WM_PROJECT_DIR/applications" + echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/applications" echo " The environment variables are inconsistent with the installation." echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 } [ -n "$FOAM_EXT_LIBBIN" ] || { - echo "Error: FOAM_EXT_LIBBIN not set" + echo "Allwmake error: FOAM_EXT_LIBBIN not set" echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 } set -x -wmake all utilities $* -wmake all solvers $* +wmake -all utilities $* +wmake -all solvers $* + # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/combustion/reactingFoam/Allwmake b/applications/solvers/combustion/reactingFoam/Allwmake deleted file mode 100755 index b60b5b6250..0000000000 --- a/applications/solvers/combustion/reactingFoam/Allwmake +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake rhoReactingFoam -wmake rhoReactingBuoyantFoam -wmake LTSReactingFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index cc5398c04e..1a0374d96d 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso BCs diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 33e08e1076..5c4ed20c24 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x (wmake libso BCs && wmake && wmake rhoCentralDyMFoam) diff --git a/applications/solvers/compressible/rhoPimpleFoam/Allwmake b/applications/solvers/compressible/rhoPimpleFoam/Allwmake deleted file mode 100755 index 1b272c17f0..0000000000 --- a/applications/solvers/compressible/rhoPimpleFoam/Allwmake +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake rhoPimplecFoam -wmake rhoLTSPimpleFoam -wmake rhoPimpleDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoSimpleFoam/Allwclean b/applications/solvers/compressible/rhoSimpleFoam/Allwclean deleted file mode 100755 index a1fd479e12..0000000000 --- a/applications/solvers/compressible/rhoSimpleFoam/Allwclean +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wclean -wclean rhoPorousSimpleFoam -wclean rhoSimplecFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoSimpleFoam/Allwmake b/applications/solvers/compressible/rhoSimpleFoam/Allwmake deleted file mode 100755 index dc0fd648f5..0000000000 --- a/applications/solvers/compressible/rhoSimpleFoam/Allwmake +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake rhoPorousSimpleFoam -wmake rhoSimplecFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/sonicFoam/Allwmake b/applications/solvers/compressible/sonicFoam/Allwmake deleted file mode 100755 index 27c1194eaf..0000000000 --- a/applications/solvers/compressible/sonicFoam/Allwmake +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake sonicDyMFoam -wmake sonicLiquidFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean deleted file mode 100755 index c583a8de0a..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wclean -wclean chtMultiRegionSimpleFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake deleted file mode 100755 index f65ba1181b..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake chtMultiRegionSimpleFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/pimpleFoam/Allwmake b/applications/solvers/incompressible/pimpleFoam/Allwmake deleted file mode 100755 index 8727bdb2de..0000000000 --- a/applications/solvers/incompressible/pimpleFoam/Allwmake +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake SRFPimpleFoam -wmake pimpleDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/simpleFoam/Allwmake b/applications/solvers/incompressible/simpleFoam/Allwmake deleted file mode 100755 index 801fd3b767..0000000000 --- a/applications/solvers/incompressible/simpleFoam/Allwmake +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake - -wmake SRFSimpleFoam -wmake porousSimpleFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/lagrangian/DPMFoam/Allwclean b/applications/solvers/lagrangian/DPMFoam/Allwclean index 25d0b2955f..6d736b2373 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwclean +++ b/applications/solvers/lagrangian/DPMFoam/Allwclean @@ -3,6 +3,6 @@ cd ${0%/*} || exit 1 set -x -wclean DPMTurbulenceModels +wclean libso DPMTurbulenceModels wclean wclean MPPICFoam diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake index 6308a7052b..8a47fb1b34 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwmake +++ b/applications/solvers/lagrangian/DPMFoam/Allwmake @@ -3,6 +3,6 @@ cd ${0%/*} || exit 1 set -x -wmake DPMTurbulenceModels +wmake libso DPMTurbulenceModels wmake wmake MPPICFoam diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Allwmake b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Allwmake deleted file mode 100755 index 845cebd777..0000000000 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake icoUncoupledKinematicParcelDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Allwmake b/applications/solvers/lagrangian/reactingParcelFoam/Allwmake deleted file mode 100755 index f615df216c..0000000000 --- a/applications/solvers/lagrangian/reactingParcelFoam/Allwmake +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake simpleReactingParcelFoam -wmake LTSReactingParcelFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/lagrangian/sprayFoam/Allwmake b/applications/solvers/lagrangian/sprayFoam/Allwmake deleted file mode 100755 index 542509db74..0000000000 --- a/applications/solvers/lagrangian/sprayFoam/Allwmake +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake - -wmake sprayEngineFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/cavitatingFoam/Allwclean b/applications/solvers/multiphase/cavitatingFoam/Allwclean deleted file mode 100755 index 62548246e9..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/Allwclean +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wclean -wclean cavitatingDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/cavitatingFoam/Allwmake b/applications/solvers/multiphase/cavitatingFoam/Allwmake deleted file mode 100755 index 211c1978b2..0000000000 --- a/applications/solvers/multiphase/cavitatingFoam/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake cavitatingDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index aa0f3c01c6..9339e372a3 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso twoPhaseMixtureThermo diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index a93da26cdd..835bf8346b 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso twoPhaseMixtureThermo diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean index 8098c05160..7ccfc0d68f 100755 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso multiphaseMixtureThermo diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake index dd002ee069..04e1ddbb1f 100755 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso multiphaseMixtureThermo diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwclean b/applications/solvers/multiphase/driftFluxFoam/Allwclean index 2af6245897..4bb3b9406d 100755 --- a/applications/solvers/multiphase/driftFluxFoam/Allwclean +++ b/applications/solvers/multiphase/driftFluxFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso mixtureViscosityModels diff --git a/applications/solvers/multiphase/driftFluxFoam/Allwmake b/applications/solvers/multiphase/driftFluxFoam/Allwmake index 764aef62db..ac51afd1d1 100755 --- a/applications/solvers/multiphase/driftFluxFoam/Allwmake +++ b/applications/solvers/multiphase/driftFluxFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso mixtureViscosityModels diff --git a/applications/solvers/multiphase/interFoam/Allwclean b/applications/solvers/multiphase/interFoam/Allwclean deleted file mode 100755 index d91472696f..0000000000 --- a/applications/solvers/multiphase/interFoam/Allwclean +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wclean -wclean interDyMFoam -wclean porousInterFoam -wclean LTSInterFoam -wclean interMixingFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/interFoam/Allwmake b/applications/solvers/multiphase/interFoam/Allwmake deleted file mode 100755 index 035b007934..0000000000 --- a/applications/solvers/multiphase/interFoam/Allwmake +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake interDyMFoam -wmake porousInterFoam -wmake LTSInterFoam -wmake interMixingFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean index 99c52e59f9..0e33252d5c 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso phaseChangeTwoPhaseMixtures diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake index 414ed904a0..9a2a5c2bab 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso phaseChangeTwoPhaseMixtures diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean index f9d9eaad2b..a75382c13c 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso multiphaseSystem diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake index bc9227ddcb..84a99b7200 100755 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmakeLnInclude interfacialModels diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean index 7edca3f5d1..02819df96f 100755 --- a/applications/solvers/multiphase/multiphaseInterFoam/Allwclean +++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso multiphaseMixture diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake index 2a03ac9b6c..745347676b 100755 --- a/applications/solvers/multiphase/multiphaseInterFoam/Allwmake +++ b/applications/solvers/multiphase/multiphaseInterFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso multiphaseMixture diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwclean b/applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwclean deleted file mode 100755 index f4a6354926..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwclean +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wclean -wclean potentialFreeSurfaceDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwmake b/applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwmake deleted file mode 100755 index 38f7587aef..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake potentialFreeSurfaceDyMFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean index 86633f6305..8103dc7201 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso twoPhaseSystem diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake index b01ec94acd..a4a7a60bd4 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmakeLnInclude interfacialModels diff --git a/applications/test/fieldMapping/pipe1D/Allrun b/applications/test/fieldMapping/pipe1D/Allrun index 575c24f73d..eb6e441abb 100755 --- a/applications/test/fieldMapping/pipe1D/Allrun +++ b/applications/test/fieldMapping/pipe1D/Allrun @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions diff --git a/applications/test/hexRef8/block/Allrun b/applications/test/hexRef8/block/Allrun index 2fd3e2c4a7..541ce85b6d 100755 --- a/applications/test/hexRef8/block/Allrun +++ b/applications/test/hexRef8/block/Allrun @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions diff --git a/applications/test/volField/cavity/Allrun b/applications/test/volField/cavity/Allrun index 68be297094..602fbc4f19 100755 --- a/applications/test/volField/cavity/Allrun +++ b/applications/test/volField/cavity/Allrun @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index 25800377a1..bd253bbe9a 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -2,7 +2,7 @@ # # 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 set -x # build libccmio and create lnInclude directory diff --git a/applications/utilities/mesh/generation/Allwmake b/applications/utilities/mesh/generation/Allwmake index f9861db464..ca171cb1cf 100755 --- a/applications/utilities/mesh/generation/Allwmake +++ b/applications/utilities/mesh/generation/Allwmake @@ -1,17 +1,17 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x -wmake all blockMesh -wmake all extrude -wmake all extrude2DMesh -wmake all snappyHexMesh +wmake -all blockMesh +wmake -all extrude +wmake -all extrude2DMesh +wmake -all snappyHexMesh if [ -n "$CGAL_ARCH_PATH" ] then wmake libso foamyHexMesh/conformalVoronoiMesh - wmake all foamyHexMesh - wmake all foamyQuadMesh + wmake -all foamyHexMesh + wmake -all foamyQuadMesh fi diff --git a/applications/utilities/mesh/generation/extrude/Allwclean b/applications/utilities/mesh/generation/extrude/Allwclean deleted file mode 100755 index 253b4b4d6d..0000000000 --- a/applications/utilities/mesh/generation/extrude/Allwclean +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wclean extrudeMesh -wclean extrudeToRegionMesh - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/generation/extrude/Allwmake b/applications/utilities/mesh/generation/extrude/Allwmake deleted file mode 100755 index 3fd3d2314a..0000000000 --- a/applications/utilities/mesh/generation/extrude/Allwmake +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake extrudeMesh -wmake extrudeToRegionMesh - - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwclean b/applications/utilities/mesh/generation/extrude2DMesh/Allwclean index 44537ed68b..1f7114a111 100755 --- a/applications/utilities/mesh/generation/extrude2DMesh/Allwclean +++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso extrude2DMesh diff --git a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake index 6f54612ffe..a56b144e29 100755 --- a/applications/utilities/mesh/generation/extrude2DMesh/Allwmake +++ b/applications/utilities/mesh/generation/extrude2DMesh/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso extrude2DMesh diff --git a/applications/utilities/mesh/generation/foamyHexMesh/Allwclean b/applications/utilities/mesh/generation/foamyHexMesh/Allwclean index 696f6c0b65..0fc43eacc3 100755 --- a/applications/utilities/mesh/generation/foamyHexMesh/Allwclean +++ b/applications/utilities/mesh/generation/foamyHexMesh/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso conformalVoronoiMesh diff --git a/applications/utilities/mesh/generation/foamyHexMesh/Allwmake b/applications/utilities/mesh/generation/foamyHexMesh/Allwmake index 67770e51c5..419947964a 100755 --- a/applications/utilities/mesh/generation/foamyHexMesh/Allwmake +++ b/applications/utilities/mesh/generation/foamyHexMesh/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -n "$CGAL_ARCH_PATH" ] diff --git a/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMeshSurfaceSimplify/Allwmake b/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMeshSurfaceSimplify/Allwmake index 98dec66c76..8d3e3840ef 100755 --- a/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMeshSurfaceSimplify/Allwmake +++ b/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMeshSurfaceSimplify/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -d "${FASTDUALOCTREE_SRC_PATH}" ] diff --git a/applications/utilities/mesh/generation/foamyQuadMesh/Allwclean b/applications/utilities/mesh/generation/foamyQuadMesh/Allwclean index d0ae53e415..b147a002b5 100755 --- a/applications/utilities/mesh/generation/foamyQuadMesh/Allwclean +++ b/applications/utilities/mesh/generation/foamyQuadMesh/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso conformalVoronoi2DMesh diff --git a/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake b/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake index 242939465f..da5007ab8f 100755 --- a/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake +++ b/applications/utilities/mesh/generation/foamyQuadMesh/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -n "$CGAL_ARCH_PATH" ] diff --git a/applications/utilities/mesh/manipulation/renumberMesh/Allwmake b/applications/utilities/mesh/manipulation/renumberMesh/Allwmake index 250914574f..64641c22fd 100755 --- a/applications/utilities/mesh/manipulation/renumberMesh/Allwmake +++ b/applications/utilities/mesh/manipulation/renumberMesh/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory export COMPILE_FLAGS='' export LINK_FLAGS='' @@ -10,7 +10,7 @@ then export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber" fi -if [ "${ZOLTAN_ARCH_PATH}/lib/libzoltan.a" -a -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ] +if [ -f "${ZOLTAN_ARCH_PATH}/lib/libzoltan.a" -a -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ] then echo "Found libzoltanRenumber.so -- enabling zoltan renumbering support." export COMPILE_FLAGS="-DFOAM_USE_ZOLTAN" diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake index 0d586b6f94..c651ba841f 100755 --- a/applications/utilities/mesh/manipulation/setSet/Allwmake +++ b/applications/utilities/mesh/manipulation/setSet/Allwmake @@ -1,16 +1,12 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory unset COMP_FLAGS LINK_FLAGS # # use readline if available -# unless otherwise specified (with NO_READLINE) # -# eg, ./Allwmake NO_READLINE -# - -if [ -f /usr/include/readline/readline.h -a "${1%NO_READLINE}" = "$1" ] +if [ -f /usr/include/readline/readline.h ] then echo "Found -- enabling readline support." export COMP_FLAGS="-DHAS_READLINE" diff --git a/applications/utilities/miscellaneous/foamHelp/Allwclean b/applications/utilities/miscellaneous/foamHelp/Allwclean index 9dca480e2e..01d5bfd9f3 100755 --- a/applications/utilities/miscellaneous/foamHelp/Allwclean +++ b/applications/utilities/miscellaneous/foamHelp/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory wclean libso helpTypes wclean diff --git a/applications/utilities/miscellaneous/foamHelp/Allwmake b/applications/utilities/miscellaneous/foamHelp/Allwmake index 4724935b92..2c999bf34b 100755 --- a/applications/utilities/miscellaneous/foamHelp/Allwmake +++ b/applications/utilities/miscellaneous/foamHelp/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory wmake libso helpTypes wmake diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake index 99e4ccb477..8ef9158c5d 100755 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory if [ ! -d ${WM_THIRD_PARTY_DIR}/tecio ] then diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/Allwclean index b867e563ff..ca689294d1 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso vtkPV3Readers diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake index 3bddd64d80..ae0915f268 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory #set -x case "$ParaView_VERSION" in diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean index c5f41ab9da..6d052fb73d 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x # deal with client/server vs combined plugins diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake index c99e05fd6b..93ce993d65 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean index d2c85df001..4ce9a2a07f 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x # deal with client/server vs combined plugins diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake index 4f055b3c0f..09e76eac49 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/Allwclean b/applications/utilities/postProcessing/graphics/PV4Readers/Allwclean index f1171eb61e..524a715f44 100755 --- a/applications/utilities/postProcessing/graphics/PV4Readers/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV4Readers/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wclean libso vtkPV4Readers diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV4Readers/Allwmake index aa102b5e6a..6f6e56b9d8 100755 --- a/applications/utilities/postProcessing/graphics/PV4Readers/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV4Readers/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory #set -x case "$ParaView_VERSION" in diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwclean index 39520be1ab..b6ef33f863 100755 --- a/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x # deal with client/server vs combined plugins diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwmake index dd88afc029..0728cf9f6a 100755 --- a/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/PV4FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/PV4FoamReader/CMakeLists.txt index 92494c4f6b..4c2d5158b7 100644 --- a/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/PV4FoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV4Readers/PV4FoamReader/PV4FoamReader/CMakeLists.txt @@ -72,6 +72,7 @@ ENDIF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) TARGET_LINK_LIBRARIES( PV4FoamReader_SM + LINK_PUBLIC OpenFOAM finiteVolume vtkPV4Foam diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwclean index 9e3e5a3afa..f735dbbe52 100755 --- a/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x # deal with client/server vs combined plugins diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwmake index 645a917724..a13503094c 100755 --- a/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] diff --git a/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/PV4blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/PV4blockMeshReader/CMakeLists.txt index 9ed8871208..72003c8815 100644 --- a/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/PV4blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV4Readers/PV4blockMeshReader/PV4blockMeshReader/CMakeLists.txt @@ -73,6 +73,7 @@ ENDIF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) TARGET_LINK_LIBRARIES( PV4blockMeshReader_SM + LINK_PUBLIC OpenFOAM blockMesh vtkPV4blockMesh diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake index f29cdda208..e033316861 100755 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory wmake libso diff --git a/applications/utilities/preProcessing/wallFunctionTable/Allwmake b/applications/utilities/preProcessing/wallFunctionTable/Allwmake index 55a6cbd37f..c527fdf38f 100755 --- a/applications/utilities/preProcessing/wallFunctionTable/Allwmake +++ b/applications/utilities/preProcessing/wallFunctionTable/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmake libso tabulatedWallFunction diff --git a/doc/Allwmake b/doc/Allwmake index 5d8ed9c5a0..76b8eee2ce 100755 --- a/doc/Allwmake +++ b/doc/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x # fix permissions (NB: '+X' and not '+x'!) diff --git a/doc/Doxygen/Allwmake b/doc/Doxygen/Allwmake index fbc20d93fd..a349ee4fc1 100755 --- a/doc/Doxygen/Allwmake +++ b/doc/Doxygen/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory [ -d "$WM_PROJECT_DIR" ] || { echo "Error: WM_PROJECT_DIR directory does not exist" diff --git a/src/Allwmake b/src/Allwmake index fa091ed845..925b3f211e 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -1,86 +1,83 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments wmakeCheckPwd "$WM_PROJECT_DIR/src" || { - echo "Error: Current directory is not \$WM_PROJECT_DIR/src" + echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/src" echo " The environment variables are inconsistent with the installation." echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 } [ -n "$FOAM_EXT_LIBBIN" ] || { - echo "Error: FOAM_EXT_LIBBIN not set" + echo "Allwmake error: FOAM_EXT_LIBBIN not set" echo " Check the OpenFOAM entries in your dot-files and source them." exit 1 } set -x -# update OpenFOAM version strings if required +# Update OpenFOAM version strings if required wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/*/global.? 2>/dev/null wmakeLnInclude OpenFOAM wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX} -Pstream/Allwmake $* +Pstream/Allwmake $targetType $* OSspecific/${WM_OSTYPE:-POSIX}/Allwmake $* -wmake $makeType OpenFOAM +wmake $targetType OpenFOAM -wmake $makeType fileFormats -wmake $makeType surfMesh -wmake $makeType triSurface -wmake $makeType meshTools -wmake $makeType edgeMesh +wmake $targetType fileFormats +wmake $targetType surfMesh +wmake $targetType triSurface +wmake $targetType meshTools +wmake $targetType edgeMesh # Decomposition methods needed by dummyThirdParty +# (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools parallel/decompose/AllwmakeLnInclude -# dummyThirdParty (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools -dummyThirdParty/Allwmake $* +dummyThirdParty/Allwmake $targetType $* -wmake $makeType finiteVolume -wmake $makeType lagrangian/basic -wmake $makeType lagrangian/distributionModels -wmake $makeType genericPatchFields +wmake $targetType finiteVolume +wmake $targetType lagrangian/basic +wmake $targetType lagrangian/distributionModels +wmake $targetType genericPatchFields -# Build the proper scotchDecomp, metisDecomp etc. -parallel/Allwmake $* +wmake $targetType conversion +wmake $targetType sampling +wmake $targetType mesh/extrudeModel +wmake $targetType dynamicMesh +wmake $targetType dynamicFvMesh +wmake $targetType topoChangerFvMesh -renumber/Allwmake $* +# Compile scotchDecomp, metisDecomp etc. +parallel/Allwmake $targetType $* -wmake $makeType conversion +wmake $targetType ODE +wmake $targetType randomProcesses -wmake $makeType sampling +transportModels/Allwmake $targetType $* +thermophysicalModels/Allwmake $targetType $* +turbulenceModels/Allwmake $targetType $* +TurbulenceModels/Allwmake $targetType $* +wmake $targetType combustionModels +regionModels/Allwmake $targetType $* +lagrangian/Allwmake $targetType $* +mesh/Allwmake $targetType $* +renumber/Allwmake $targetType $* +fvAgglomerationMethods/Allwmake $targetType $* -wmake $makeType mesh/extrudeModel +wmake $targetType fvMotionSolver +wmake $targetType engine +wmake $targetType fvOptions +wmake $targetType regionCoupled -wmake $makeType dynamicMesh -wmake $makeType dynamicFvMesh -wmake $makeType topoChangerFvMesh +postProcessing/Allwmake $targetType $* -wmake $makeType ODE -wmake $makeType randomProcesses +wmake $targetType sixDoFRigidBodyMotion -thermophysicalModels/Allwmake $* -transportModels/Allwmake $* -turbulenceModels/Allwmake $* -TurbulenceModels/Allwmake $* -wmake $makeType combustionModels -regionModels/Allwmake $* -lagrangian/Allwmake $* -mesh/Allwmake $* - -fvAgglomerationMethods/Allwmake $* - -wmake $makeType fvMotionSolver -wmake $makeType engine - -wmake $makeType fvOptions - -wmake $makeType regionCoupled - -postProcessing/Allwmake $* - -wmake $makeType sixDoFRigidBodyMotion # ----------------------------------------------------------------- end-of-file diff --git a/src/OSspecific/POSIX/Allwmake b/src/OSspecific/POSIX/Allwmake index 52a54646f0..6cb776136e 100755 --- a/src/OSspecific/POSIX/Allwmake +++ b/src/OSspecific/POSIX/Allwmake @@ -1,16 +1,16 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libo} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libo +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments $* unset COMP_FLAGS LINK_FLAGS # # use if available (Linux) -# unless otherwise specified (with USE_STAT) # -# eg, ./Allwmake USE_STAT -# -if [ -f /usr/include/sys/inotify.h -a "${1%USE_STAT}" = "$1" ] +if [ -f /usr/include/sys/inotify.h ] then echo "Found -- enabling inotify for file monitoring." export COMP_FLAGS="-DFOAM_USE_INOTIFY" @@ -18,8 +18,7 @@ else unset COMP_FLAGS fi - -# make (non-shared) object -wmake $makeType +# make (non-shared by default) object +wmake $targetType # ----------------------------------------------------------------- end-of-file diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index 50ccb5fe1d..0c490c5750 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -1,10 +1,13 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # -# define how to create an mpi-versioned library of $makeType +# define how to create an mpi-versioned library of $targetType # compile into qualified directory # use sentinel file to handle version changes # @@ -15,10 +18,10 @@ wmakeMpiLib() do ( WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" - whichmpi="$libName/Make/$WM_OPTIONS/using:$FOAM_MPI" + whichmpi="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/Pstream/$libName/using:$FOAM_MPI" [ -e "$whichmpi" ] || wclean $libName - echo "wmake $makeType $libName" - wmake $makeType $libName + echo "wmake $targetType $libName" + wmake $targetType $libName touch "$whichmpi" ) done @@ -26,7 +29,7 @@ wmakeMpiLib() } set -x -wmake $makeType dummy +wmake $targetType dummy case "$WM_MPLIB" in *MPI*) @@ -36,10 +39,6 @@ case "$WM_MPLIB" in echo wmakeMpiLib mpi ;; - -#GAMMA) -# wmake $makeType gamma -# ;; esac diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake index 84deb51c93..fb0c219f58 100755 --- a/src/TurbulenceModels/Allwmake +++ b/src/TurbulenceModels/Allwmake @@ -1,11 +1,14 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType turbulenceModels -wmake $makeType incompressible -wmake $makeType compressible +wmake $targetType turbulenceModels +wmake $targetType incompressible +wmake $targetType compressible wmakeLnInclude phaseIncompressible wmakeLnInclude phaseCompressible diff --git a/src/conversion/Allwmake b/src/conversion/Allwmake index 014885de47..125d78c5e4 100755 --- a/src/conversion/Allwmake +++ b/src/conversion/Allwmake @@ -1,8 +1,11 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType +wmake $targetType # ----------------------------------------------------------------- end-of-file diff --git a/src/dummyThirdParty/Allwmake b/src/dummyThirdParty/Allwmake index d747a472db..a819e77494 100755 --- a/src/dummyThirdParty/Allwmake +++ b/src/dummyThirdParty/Allwmake @@ -1,12 +1,15 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType scotchDecomp -wmake $makeType ptscotchDecomp -wmake $makeType metisDecomp -wmake $makeType MGridGen +wmake $targetType scotchDecomp +wmake $targetType ptscotchDecomp +wmake $targetType metisDecomp +wmake $targetType MGridGen # ----------------------------------------------------------------- end-of-file diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake index 4fc3ed6029..f03db10d3f 100755 --- a/src/fvAgglomerationMethods/Allwmake +++ b/src/fvAgglomerationMethods/Allwmake @@ -1,33 +1,36 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0 if [ -e "$FOAM_LIBBIN/libMGridGen.so" ] then - wmake $makeType MGridGenGamgAgglomeration + wmake $targetType MGridGenGamgAgglomeration fi -wmake $makeType pairPatchAgglomeration +wmake $targetType pairPatchAgglomeration ## get SCOTCH_VERSION, SCOTCH_ARCH_PATH -#if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh` -#then -# . $settings -# echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" -#else -# echo -# echo "Error: no config/scotch.sh settings" -# echo -#fi -# -#if [ -n "$SCOTCH_ARCH_PATH" ] -#then -# wmake $makeType scotchGamgAgglomeration -#fi +if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh` +then + . $settings + echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" +else + echo + echo "Error: no config/scotch.sh settings" + echo +fi + +if [ -n "$SCOTCH_ARCH_PATH" ] +then + wmake $targetType scotchGamgAgglomeration +fi # ----------------------------------------------------------------- end-of-file diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake index 104d37234d..1f00dde890 100755 --- a/src/lagrangian/Allwmake +++ b/src/lagrangian/Allwmake @@ -1,18 +1,21 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType distributionModels -wmake $makeType basic -wmake $makeType solidParticle -wmake $makeType intermediate -wmake $makeType turbulence -wmake $makeType Turbulence -wmake $makeType spray -wmake $makeType dsmc -wmake $makeType coalCombustion +wmake $targetType distributionModels +wmake $targetType basic +wmake $targetType solidParticle +wmake $targetType intermediate +wmake $targetType turbulence +wmake $targetType Turbulence +wmake $targetType spray +wmake $targetType dsmc +wmake $targetType coalCombustion -molecularDynamics/Allwmake $* +molecularDynamics/Allwmake $targetType $* # ----------------------------------------------------------------- end-of-file diff --git a/src/lagrangian/molecularDynamics/Allwmake b/src/lagrangian/molecularDynamics/Allwmake index 7c17819ad5..2020afcadc 100755 --- a/src/lagrangian/molecularDynamics/Allwmake +++ b/src/lagrangian/molecularDynamics/Allwmake @@ -1,10 +1,13 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType potential -wmake $makeType molecularMeasurements -wmake $makeType molecule +wmake $targetType potential +wmake $targetType molecularMeasurements +wmake $targetType molecule # ----------------------------------------------------------------- end-of-file diff --git a/src/mesh/Allwmake b/src/mesh/Allwmake index 4653b1d3c4..fef9e5c2bc 100755 --- a/src/mesh/Allwmake +++ b/src/mesh/Allwmake @@ -1,10 +1,13 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType autoMesh -wmake $makeType blockMesh -wmake $makeType extrudeModel +wmake $targetType autoMesh +wmake $targetType blockMesh +wmake $targetType extrudeModel # ----------------------------------------------------------------- end-of-file diff --git a/src/parallel/Allwmake b/src/parallel/Allwmake index ab84e5b749..97d62f0612 100755 --- a/src/parallel/Allwmake +++ b/src/parallel/Allwmake @@ -1,11 +1,14 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -decompose/Allwmake $* -reconstruct/Allwmake $* -wmake $makeType distributed +decompose/Allwmake $targetType $* +reconstruct/Allwmake $targetType $* +wmake $targetType distributed # ----------------------------------------------------------------- end-of-file diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index e6d0a1dee5..3aceabafd8 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -1,6 +1,9 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # get SCOTCH_VERSION, SCOTCH_ARCH_PATH if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh` @@ -15,7 +18,7 @@ fi # -# define how to create an mpi-versioned library of $makeType +# define how to create an mpi-versioned library of $targetType # compile into qualified directory # use sentinel file to handle version changes # @@ -26,11 +29,11 @@ wmakeMpiLib() do ( WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" - whichmpi="$libName/Make/$WM_OPTIONS/using:$FOAM_MPI" - whichscotch="$libName/Make/$WM_OPTIONS/using:$SCOTCH_VERSION" + whichmpi="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$FOAM_MPI" + whichscotch="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$SCOTCH_VERSION" [ -e "$whichmpi" -a -e "$whichscotch" ] || wclean $libName - echo "wmake $makeType $libName" - wmake $makeType $libName + echo "wmake $targetType $libName" + wmake $targetType $libName touch "$whichmpi" "$whichscotch" ) done @@ -43,16 +46,18 @@ wmakeLnInclude decompositionMethods if [ -n "$SCOTCH_ARCH_PATH" ] then - wmake $makeType scotchDecomp + wmake $targetType scotchDecomp if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] then #- Bit of a hack: ptscotch 6 requires scotch linked as well as. Can be # removed once ptscotch declares dependency on scotch itself. - if [ "$SCOTCH_VERSION" = "scotch_6.0.0" ] - then + case "$SCOTCH_VERSION" in + scotch_6.*) export LINK_FLAGS="-lscotch" - fi + ;; + esac + wmakeMpiLib ptscotchDecomp fi @@ -64,11 +69,11 @@ fi # Try and build metisDecomp (has own logic) -(cd metisDecomp && ./Allwmake $makeType) +(cd metisDecomp && ./Allwmake $targetType) -wmake $makeType decompositionMethods +wmake $targetType decompositionMethods -wmake $makeType decompose +wmake $targetType decompose # ----------------------------------------------------------------- end-of-file diff --git a/src/parallel/decompose/AllwmakeLnInclude b/src/parallel/decompose/AllwmakeLnInclude index c6a537aa42..b2ee544686 100755 --- a/src/parallel/decompose/AllwmakeLnInclude +++ b/src/parallel/decompose/AllwmakeLnInclude @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory set -x wmakeLnInclude decompositionMethods diff --git a/src/parallel/decompose/metisDecomp/Allwmake b/src/parallel/decompose/metisDecomp/Allwmake index a97d63a93b..549e4229b8 100755 --- a/src/parallel/decompose/metisDecomp/Allwmake +++ b/src/parallel/decompose/metisDecomp/Allwmake @@ -1,6 +1,9 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # get METIS_VERSION, METIS_ARCH_PATH if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/metis.sh` @@ -9,7 +12,7 @@ then echo "using METIS_ARCH_PATH=$METIS_ARCH_PATH" if [ -r $METIS_ARCH_PATH/lib/libmetis.so ] then - wmake $makeType + wmake $targetType fi else echo diff --git a/src/parallel/reconstruct/Allwmake b/src/parallel/reconstruct/Allwmake index 85e8e9723a..4774eed052 100755 --- a/src/parallel/reconstruct/Allwmake +++ b/src/parallel/reconstruct/Allwmake @@ -1,8 +1,11 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType reconstruct +wmake $targetType reconstruct # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/Allwmake b/src/postProcessing/Allwmake index 3522721c4d..92daaa49f3 100755 --- a/src/postProcessing/Allwmake +++ b/src/postProcessing/Allwmake @@ -1,11 +1,14 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x wmake ${1:-libo} postCalc -wmake $makeType foamCalcFunctions +wmake $targetType foamCalcFunctions -functionObjects/Allwmake $* +functionObjects/Allwmake $targetType $* # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/functionObjects/Allwmake b/src/postProcessing/functionObjects/Allwmake index 178a1a3cfe..535b8281c4 100755 --- a/src/postProcessing/functionObjects/Allwmake +++ b/src/postProcessing/functionObjects/Allwmake @@ -1,15 +1,18 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType cloud -wmake $makeType field -wmake $makeType forces -wmake $makeType fvTools -wmake $makeType IO -wmake $makeType jobControl -wmake $makeType systemCall -wmake $makeType utilities +wmake $targetType cloud +wmake $targetType field +wmake $targetType forces +wmake $targetType fvTools +wmake $targetType IO +wmake $targetType jobControl +wmake $targetType systemCall +wmake $targetType utilities # ----------------------------------------------------------------- end-of-file diff --git a/src/regionModels/Allwclean b/src/regionModels/Allwclean index f95d816a53..8297b201c0 100755 --- a/src/regionModels/Allwclean +++ b/src/regionModels/Allwclean @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory makeType=${1:-libso} set -x diff --git a/src/regionModels/Allwmake b/src/regionModels/Allwmake index 669b701e81..877c4b00c5 100755 --- a/src/regionModels/Allwmake +++ b/src/regionModels/Allwmake @@ -1,14 +1,17 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType regionModel -wmake $makeType pyrolysisModels -wmake $makeType surfaceFilmModels -wmake $makeType surfaceFilmModels/derivedFvPatchFields/wallFunctions -wmake $makeType thermalBaffleModels -wmake $makeType regionCoupling +wmake $targetType regionModel +wmake $targetType pyrolysisModels +wmake $targetType surfaceFilmModels +wmake $targetType surfaceFilmModels/derivedFvPatchFields/wallFunctions +wmake $targetType thermalBaffleModels +wmake $targetType regionCoupling # ----------------------------------------------------------------- end-of-file diff --git a/src/renumber/Allwmake b/src/renumber/Allwmake index d7f72d93be..ec1acb8320 100755 --- a/src/renumber/Allwmake +++ b/src/renumber/Allwmake @@ -1,6 +1,9 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments ## get ZOLTAN_ARCH_PATH #if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/zoltan.sh` @@ -16,11 +19,11 @@ makeType=${1:-libso} set -x -wmake $makeType renumberMethods +wmake $targetType renumberMethods if [ -n "$BOOST_ARCH_PATH" ] then - wmake $makeType SloanRenumber + wmake $targetType SloanRenumber else echo echo "Skipping SloanRenumber" @@ -30,7 +33,7 @@ fi if [ -n "$ZOLTAN_ARCH_PATH" ] then - wmake $makeType zoltanRenumber + wmake $targetType zoltanRenumber else echo echo "Skipping zoltanRenumber" diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake index dbd8310a3b..2234d5c9aa 100755 --- a/src/thermophysicalModels/Allwmake +++ b/src/thermophysicalModels/Allwmake @@ -1,24 +1,27 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType specie -wmake $makeType solidSpecie -wmake $makeType thermophysicalFunctions -./properties/Allwmake $* +wmake $targetType specie +wmake $targetType solidSpecie +wmake $targetType thermophysicalFunctions +./properties/Allwmake $targetType $* -wmake $makeType basic -wmake $makeType reactionThermo -wmake $makeType laminarFlameSpeed -wmake $makeType chemistryModel -wmake $makeType barotropicCompressibilityModel -wmake $makeType SLGThermo +wmake $targetType basic +wmake $targetType reactionThermo +wmake $targetType laminarFlameSpeed +wmake $targetType chemistryModel +wmake $targetType barotropicCompressibilityModel +wmake $targetType SLGThermo -wmake $makeType solidThermo -wmake $makeType solidChemistryModel +wmake $targetType solidThermo +wmake $targetType solidChemistryModel -wmake $makeType radiationModels +wmake $targetType radiationModels # ----------------------------------------------------------------- end-of-file diff --git a/src/thermophysicalModels/properties/Allwmake b/src/thermophysicalModels/properties/Allwmake index f088d140d5..6ee093bc11 100755 --- a/src/thermophysicalModels/properties/Allwmake +++ b/src/thermophysicalModels/properties/Allwmake @@ -1,12 +1,15 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType liquidProperties -wmake $makeType liquidMixtureProperties -wmake $makeType solidProperties -wmake $makeType solidMixtureProperties +wmake $targetType liquidProperties +wmake $targetType liquidMixtureProperties +wmake $targetType solidProperties +wmake $targetType solidMixtureProperties # ----------------------------------------------------------------- end-of-file diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files index e4e8c49e2b..879c82bad6 100644 --- a/src/thermophysicalModels/reactionThermo/Make/files +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -1,5 +1,5 @@ chemistryReaders/chemkinReader/chemkinReader.C -chemistryReaders/chemkinReader/chemkinLexer.C +chemistryReaders/chemkinReader/chemkinLexer.L chemistryReaders/chemistryReader/makeChemistryReaders.C mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C diff --git a/src/transportModels/Allwmake b/src/transportModels/Allwmake index 07272706a6..1d9598d436 100755 --- a/src/transportModels/Allwmake +++ b/src/transportModels/Allwmake @@ -1,13 +1,16 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType twoPhaseMixture -wmake $makeType interfaceProperties -wmake $makeType twoPhaseProperties -wmake $makeType incompressible -wmake $makeType compressible -wmake $makeType immiscibleIncompressibleTwoPhaseMixture +wmake $targetType twoPhaseMixture +wmake $targetType interfaceProperties +wmake $targetType twoPhaseProperties +wmake $targetType incompressible +wmake $targetType compressible +wmake $targetType immiscibleIncompressibleTwoPhaseMixture # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/Allwmake b/src/turbulenceModels/Allwmake index 3cba27ed1c..3a95797baf 100755 --- a/src/turbulenceModels/Allwmake +++ b/src/turbulenceModels/Allwmake @@ -1,11 +1,14 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -LES/Allwmake $* -incompressible/Allwmake $* -compressible/Allwmake $* -wmake $makeType derivedFvPatchFields +LES/Allwmake $targetType $* +incompressible/Allwmake $targetType $* +compressible/Allwmake $targetType $* +wmake $targetType derivedFvPatchFields # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/LES/Allwmake b/src/turbulenceModels/LES/Allwmake index 6ee54e6c27..a209819d16 100755 --- a/src/turbulenceModels/LES/Allwmake +++ b/src/turbulenceModels/LES/Allwmake @@ -1,11 +1,14 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x wmakeLnInclude ../incompressible/LES -wmake $makeType LESfilters -wmake $makeType LESdeltas +wmake $targetType LESfilters +wmake $targetType LESdeltas # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/compressible/Allwmake b/src/turbulenceModels/compressible/Allwmake index 6e230c01ff..ec2033465e 100755 --- a/src/turbulenceModels/compressible/Allwmake +++ b/src/turbulenceModels/compressible/Allwmake @@ -1,10 +1,13 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType turbulenceModel -wmake $makeType RAS -wmake $makeType LES +wmake $targetType turbulenceModel +wmake $targetType RAS +wmake $targetType LES # ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/incompressible/Allwmake b/src/turbulenceModels/incompressible/Allwmake index 6e230c01ff..ec2033465e 100755 --- a/src/turbulenceModels/incompressible/Allwmake +++ b/src/turbulenceModels/incompressible/Allwmake @@ -1,10 +1,13 @@ #!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -makeType=${1:-libso} +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments set -x -wmake $makeType turbulenceModel -wmake $makeType RAS -wmake $makeType LES +wmake $targetType turbulenceModel +wmake $targetType RAS +wmake $targetType LES # ----------------------------------------------------------------- end-of-file diff --git a/wmake/Makefile b/wmake/Makefile index 96e188530f..38f3f1a714 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -37,11 +37,10 @@ SHELL = /bin/sh #------------------------------------------------------------------------------ -# Initialise suffices list +# Unset suffices list (suffix rules are not used) #------------------------------------------------------------------------------ .SUFFIXES: -.SUFFIXES: .o #------------------------------------------------------------------------------ @@ -52,23 +51,20 @@ WM_SCRIPTS = $(WM_DIR)/scripts #------------------------------------------------------------------------------ -# declare default paths +# Declare default paths #------------------------------------------------------------------------------ LIB_SRC = $(WM_PROJECT_DIR)/src LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS) -CLASSES_DIR = $(MAKE_DIR)/classes SYS_INC = SYS_LIBS = -PROJECT_INC = -I$(LIB_SRC)/$(WM_PROJECT)/lnInclude -I$(LIB_SRC)/OSspecific/$(WM_OSTYPE)/lnInclude +PROJECT_INC = -I$(LIB_SRC)/$(WM_PROJECT)/lnInclude \ + -I$(LIB_SRC)/OSspecific/$(WM_OSTYPE)/lnInclude + PROJECT_LIBS = -l$(WM_PROJECT) -## -## unused: -## PROJECT_VERSION = $(shell printf -- "-DPROJECT_VERSION=%d%03d%03d" $$(echo $(WM_PROJECT_VERSION) | sed -e 's/\./ /g')) -## EXE_INC = EXE_LIBS = @@ -77,14 +73,7 @@ LIB_LIBS = #------------------------------------------------------------------------------ -# declare all .o files depend on $(OBJECTS_DIR)/options -#------------------------------------------------------------------------------ - -EXE_DEP = $(OBJECTS_DIR)/options - - -#------------------------------------------------------------------------------ -# declare default name of libraries and executables +# Declare default name of libraries and executables #------------------------------------------------------------------------------ # Library @@ -101,7 +90,7 @@ SEXE = a.out #------------------------------------------------------------------------------ -# set compilation and dependency building rules +# Set compilation and dependency building rules #------------------------------------------------------------------------------ GENERAL_RULES = $(WM_DIR)/rules/General @@ -111,25 +100,25 @@ WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER) include $(GENERAL_RULES)/general include $(RULES)/general include $(RULES)/$(WM_LINK_LANGUAGE) - -MAKE_DEP = @$(MKDEP) $< | $(WM_SCRIPTS)/addCompile $< +include $(GENERAL_RULES)/transform #------------------------------------------------------------------------------ # Include PROJECT directory tree file and # source, object and dependency list files. -# These are constructed by scripts/makeDerivedFiles +# These are constructed by MakefileFiles #------------------------------------------------------------------------------ include $(OBJECTS_DIR)/options -include $(OBJECTS_DIR)/filesMacros +include $(OBJECTS_DIR)/variables include $(OBJECTS_DIR)/sourceFiles -include $(OBJECTS_DIR)/objectFiles -include $(OBJECTS_DIR)/localObjectFiles -include $(OBJECTS_DIR)/dependencyFiles +DEPENDENCIES=$(SOURCE:%=$(OBJECTS_DIR)/%.dep) +BASENAMES=$(basename $(SOURCE)) +OBJECTS=$(BASENAMES:%=$(OBJECTS_DIR)/%.o) + #------------------------------------------------------------------------------ -# set header file include paths +# Set header file include paths #------------------------------------------------------------------------------ LIB_HEADER_DIRS = \ @@ -142,78 +131,82 @@ LIB_HEADER_DIRS = \ #------------------------------------------------------------------------------ -# define link statements for executables +# Define link statements for executables #------------------------------------------------------------------------------ -$(EXE): $(OBJECTS) - @$(WM_SCRIPTS)/makeTargetDir $(EXE) - $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ - $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE) +$(EXE): $(OBJECTS) + @$(WM_SCRIPTS)/makeTargetDir $(EXE) + $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ + $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) \ + $(LINK_LIBS) $(GLIBS) -o $(EXE) -exe: $(SEXE) - @echo \'$(SEXE)\' is up to date. +exe: $(SEXE) + @echo \'$(SEXE)\' is up to date. -$(SEXE): $(OBJECTS) - @$(WM_SCRIPTS)/makeTargetDir $(SEXE) - $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \ - $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE) +$(SEXE):$(OBJECTS) + @$(WM_SCRIPTS)/makeTargetDir $(SEXE) + $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \ + $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE) #------------------------------------------------------------------------------ -# define link statements for libraries +# Define link statements for libraries #------------------------------------------------------------------------------ objects: $(OBJECTS) -libso: $(LIB).$(SO) - @echo \'$(LIB).$(SO)\' is up to date. +libso: $(LIB).$(SO) + @echo \'$(LIB).$(SO)\' is up to date. $(LIB).$(SO): $(OBJECTS) - @$(WM_SCRIPTS)/makeTargetDir $(LIB) - @rm -f so_locations - @cd $(OBJECTS_DIR) ; \ - $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_PLATFORMS) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) + @$(WM_SCRIPTS)/makeTargetDir $(LIB) + $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \ + $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) -lib: $(LIB).a - @echo \'$(LIB).a\' is up to date. +lib: $(LIB).a + @echo \'$(LIB).a\' is up to date. $(LIB).a: $(OBJECTS) - @$(WM_SCRIPTS)/makeTargetDir $(LIB) - @rm -f $(LIB).a - $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS) - $(RANLIB) $(LIB).a + @$(WM_SCRIPTS)/makeTargetDir $(LIB) + @rm -f $(LIB).a + $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS) + $(RANLIB) $(LIB).a -libo: $(LIB).o - @echo \'$(LIB).o\' is up to date. +libo: $(LIB).o + @echo \'$(LIB).o\' is up to date. $(LIB).o: $(OBJECTS) - @$(WM_SCRIPTS)/makeTargetDir $(LIB) - @rm -f $(LIB).o - $(LD) -r -o $(LIB).o $(OBJECTS) + @$(WM_SCRIPTS)/makeTargetDir $(LIB) + @rm -f $(LIB).o + $(LD) -r -o $(LIB).o $(OBJECTS) -jar: $(LIB).jar - @echo \'$(LIB).jar\' is up to date. - -$(LIB).jar: $(OBJECTS) - @$(WM_SCRIPTS)/makeTargetDir $(LIB) - jar cfm $(LIB).jar $(LIB_LIBS) -C $(CLASSES_DIR) . #------------------------------------------------------------------------------ # Set rule to create the include directory for libraries #------------------------------------------------------------------------------ -lnInclude/uptodate: $(MAKE_DIR)/files $(MAKE_DIR)/options - @rm -rf lnInclude ; wmakeLnInclude . ; touch lnInclude/uptodate +lnInclude: $(MAKE_DIR)/files $(MAKE_DIR)/options + @rm -rf lnInclude ; wmakeLnInclude . + + +#------------------------------------------------------------------------------ +# Declare all qbject files depend on $(OBJECTS_DIR)/options +#------------------------------------------------------------------------------ + +$(OBJECTS) : $(OBJECTS_DIR)/options +$(foreach S,$(SOURCE),$(eval $(OBJECTS_DIR)/$(basename $S).o : $(OBJECTS_DIR)/$S.dep)) #------------------------------------------------------------------------------ # Set depedency rule and include dependency lists #------------------------------------------------------------------------------ -$(OBJECTS_DIR)/dependencies: $(DEPENDENCIES) - @echo dependencies up to date > $(OBJECTS_DIR)/dependencies +.PHONY: dep +dep: $(DEPENDENCIES) -include $(INCLUDE_DEPS) +ifeq ($(findstring lnInclude,$(MAKECMDGOALS)),) +-include $(DEPENDENCIES) +endif #------------------------------------------------------------------------------ diff --git a/wmake/MakefileApps b/wmake/MakefileApps index 848fbe204f..20955e788e 100644 --- a/wmake/MakefileApps +++ b/wmake/MakefileApps @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -26,17 +26,17 @@ # # Description # Makefile used by -# wmake all +# wmake -all # to make the applications in the subdirectories of the current directory # #------------------------------------------------------------------------------ -.PHONY: application $(FOAM_APPS) - +.PHONY: application application: $(FOAM_APPS) +.PHONY: $(FOAM_APPS) $(FOAM_APPS): - +@wmake all $@ + +@wmake -all $(TARGET) $@ #------------------------------------------------------------------------------ diff --git a/wmake/MakefileFiles b/wmake/MakefileFiles index 472a72e4a0..9f0ed1cf9d 100644 --- a/wmake/MakefileFiles +++ b/wmake/MakefileFiles @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -25,52 +25,60 @@ # MakefileFiles # # Description -# A Makefile for the 'files', used by wmake +# A Makefile for the 'options' and 'files' files, used by wmake # #------------------------------------------------------------------------------ GENERAL_RULES = $(WM_DIR)/rules/General RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) -WM_SCRIPTS = $(WM_DIR)/scripts -OBJECTS_DIR = $(WM_OPTIONS) -FFLAGS = +OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS) include $(GENERAL_RULES)/general include $(RULES)/general -include $(OBJECTS_DIR)/options #------------------------------------------------------------------------------ # declare names of make system control files derived from file 'files' #------------------------------------------------------------------------------ -FILES = $(WM_OPTIONS)/files +OPTIONS = $(OBJECTS_DIR)/options +FILES = $(OBJECTS_DIR)/files +VARS = $(OBJECTS_DIR)/variables +SFILES = $(OBJECTS_DIR)/sourceFiles -SFILES = $(WM_OPTIONS)/sourceFiles -OFILES = $(WM_OPTIONS)/objectFiles -DFILES = $(WM_OPTIONS)/dependencyFiles -IFILES = $(WM_OPTIONS)/includeDeps +-include $(OPTIONS) #------------------------------------------------------------------------------ # Declare dependecy of all make system files on FILES # Causes all derived files to be remade if any are changed or missing #------------------------------------------------------------------------------ -allFiles : $(FILES) $(SFILES) $(OFILES) $(DFILES) $(IFILES) +all : $(OPTIONS) $(SFILES) $(VARS) -$(FILES) : files - @$(CPP) $(GFLAGS) $(FFLAGS) files | sed -e 's@ *@ @g' > $(FILES) +$(OPTIONS) : $(MAKE_DIR)/options + @$(CPP) $(GFLAGS) $(MAKE_DIR)/options | sed -e 's@ *@ @g' > $(OPTIONS) -$(SFILES): files - @$(WM_SCRIPTS)/makeDerivedFiles - -$(OFILES): files - @$(WM_SCRIPTS)/makeDerivedFiles - -$(DFILES): files - @$(WM_SCRIPTS)/makeDerivedFiles - -$(IFILES): files - @$(WM_SCRIPTS)/makeDerivedFiles +$(SFILES): $(MAKE_DIR)/files + @$(CPP) $(GFLAGS) $(MAKE_DIR)/files | sed -e 's@ *@ @g' > $(FILES) + # Find all macro definitions in the files + @grep "=" $(FILES) > $(VARS) + echo "SOURCE = " > $(SFILES) + # Remove all macro definitions from the files list + @grep -v "=" $(FILES) >> $(SFILES) + @rm -f $(FILES) + # Add a newline to files to ensure the last line is followed by a newline + @echo "" >> $(SFILES) + # Remove commented lines, blank lines, and trailing blanks from files + @sed -i \ + -e '/^#/ d' \ + -e '/^[ \t]*$$/ d' \ + -e 's,[ \t]*$$,,' \ + $(SFILES) + # Add backslashes + @sed -i \ + -e 's,$$, \\,' \ + -e '$$s,\\,,' \ + $(SFILES) +$(VARS): $(SFILES) #------------------------------------------------------------------------------ diff --git a/wmake/MakefileOptions b/wmake/MakefileOptions deleted file mode 100644 index eee4fec8dc..0000000000 --- a/wmake/MakefileOptions +++ /dev/null @@ -1,54 +0,0 @@ -#-------------------------------*- makefile -*--------------------------------- -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | -#------------------------------------------------------------------------------ -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# File -# MakefileOptions -# -# Description -# A Makefile for the 'options', used by wmake -# -#------------------------------------------------------------------------------ - -GENERAL_RULES = $(WM_DIR)/rules/General -RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) -WM_SCRIPTS = $(WM_DIR)/scripts - -include $(GENERAL_RULES)/general -include $(RULES)/general - -#------------------------------------------------------------------------------ -# declare names of make system control files derived from file 'options' -#------------------------------------------------------------------------------ - -OPTIONS = $(WM_OPTIONS)/options - -#------------------------------------------------------------------------------ -# Declare dependency of all make system files on OPTIONS -# Causes all derived files to be remade if any are changed or missing -#------------------------------------------------------------------------------ - -$(OPTIONS) : options - @$(WM_SCRIPTS)/makeDir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options | sed -e 's@ *@ @g' > $(OPTIONS) - - -#------------------------------------------------------------------------------ diff --git a/wmake/makeWmake b/wmake/makeWmake index 6c162acc9c..98b5b55e14 100755 --- a/wmake/makeWmake +++ b/wmake/makeWmake @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -29,11 +29,13 @@ # Build platform-specific parts of wmake # #------------------------------------------------------------------------------ +Script=${0##*/} + usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< $@ + +#------------------------------------------------------------------------------ diff --git a/wmake/rules/General/version b/wmake/rules/General/version index 19633ffc9d..ffd070d0be 100644 --- a/wmake/rules/General/version +++ b/wmake/rules/General/version @@ -1,13 +1,12 @@ -.SUFFIXES: .Cver +#-------------------------------*- makefile -*--------------------------------- -# -# update version strings in C++ file and in $WM_PROJECT_DIR/.build file -# +SUFFIXES += .Cver + +# Update version strings in C++ file and in $WM_PROJECT_DIR/.build file Cvertoo = \ sed -e 's!VERSION_STRING!$(shell wmakePrintBuild -major)!' \ -e 's!BUILD_STRING!$(shell wmakePrintBuild -update)!' \ - $$SOURCE > $*.C; \ - $(CC) $(c++FLAGS) -c $*.C -o $@ + $< > $(@D)/$(. +# +# File +# wmake/scripts/AllwmakeParseArguments +# +# Description +# Allwmake argument parser +# +# Usage +# # Declare the targetType and set to default for library building +# targetType=libso # lib, libo or libso +# +# # Declare genDoc and set to default if documentation building is supported +# genDoc=0 # 0 or 1 +# +# # Parse the arguments by sourcing this script +# . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +# +#------------------------------------------------------------------------------ +Script=${0##*/} + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + + # Print normal usage options + cat< /dev/null 2>&1 \ + && shift && export WM_NCOMPPROCS=$1 + echo "Compiling enabled on $WM_NCOMPPROCS cores" + ;; + # Parallel compilation on specified number of cores + -j*) + export WM_NCOMPPROCS=${1#-j} + echo "Compiling enabled on $WM_NCOMPPROCS cores" + ;; + # Non-stop compilatio, ignoring errors + -k | -non-stop) + export WM_CONTINUE_ON_ERROR=1 + ;; + # Disable scheduled parallel compilation + -no-scheduler) + unset WM_SCHEDULER + ;; + # Generate documentation + doc) + test -n "$genDoc" || usage "invalid option '$1'" + genDoc=1 + ;; + # Specify target type + lib | libo | libso | dep) + test -n "$targetType" || usage "invalid option '$1'" + targetType=$1 + ;; + --) + shift + break + ;; + -* | *) + usage "invalid option '$1'" + ;; + esac + shift +done + + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage setWM_NCOMPPROCS + + +# ----------------------------------------------------------------- end-of-file diff --git a/wmake/scripts/addCompile b/wmake/scripts/addCompile deleted file mode 100755 index 63a5b2622d..0000000000 --- a/wmake/scripts/addCompile +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | -#------------------------------------------------------------------------------ -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# Script -# addCompile -# -# Description -# Cleans up the dependency list and add the compilation statement. -# -# Usage: wmkdep | addCompile -# -#------------------------------------------------------------------------------ - -sourceName=${1##*/} -objectName=${sourceName%.*}.o -className=${sourceName%.*}.class -sub=${1##*.} -depName=${1%.*}.dep - -sourceDir=${1%/*} - -if [ "$sourceDir" = "$sourceName" ] -then - sourceDir=. -fi - -if [ "$WM_PROJECT_DIR" ] -then - sed -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% > $depName -else - cat > $depName -fi - -sed -e s%".*.o.*:"%'$(OBJECTS_DIR)/'"$objectName\:"% \ - -e s%$WM_PROJECT_DIR%'$(WM_PROJECT_DIR)'% \ - >> $depName - -echo '$(OBJECTS_DIR)/'$objectName': $(EXE_DEP)' >> $depName -echo '$(OBJECTS_DIR)/'$objectName':' >> $depName -echo ' @SOURCE_DIR='$sourceDir >> $depName -echo ' SOURCE='$1' ; $('$sub'too)' >> $depName - -#------------------------------------------------------------------------------ diff --git a/wmake/scripts/makeDerivedFiles b/wmake/scripts/makeDerivedFiles deleted file mode 100755 index 28eaf89fee..0000000000 --- a/wmake/scripts/makeDerivedFiles +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | -#------------------------------------------------------------------------------- -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# Script -# makeDerivedFiles -# -# Description -# Constructs all the file list for make given the source file list, -# written by hand or using makeFilesAndOptions. -# -#------------------------------------------------------------------------------ - -[ -d "$WM_OPTIONS" ] || { - echo "The '$WM_OPTIONS' directory does not exist, exiting" 1>&2 - exit 1 -} - -# change to the $WM_OPTIONS directory -cd "$WM_OPTIONS" 2>/dev/null || { - echo "Could not change to directory '$WM_OPTIONS'" 1>&2 - exit 1 -} - -# Find and keep macro definitions in files list -grep "=" files > filesMacros - -# Remove all macro definitions from the files list -grep -v "=" files > filesPlusBlank - -# Add a newline to files to ensure the last line is followed by a newline -echo "" >> filesPlusBlank - - -# Remove commented lines, blank lines, and trailing blanks from files -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sed -e '/^#/ d' \ - -e '/^[ \t]*$/ d' \ - -e 's/[ \t]*$//' \ - filesPlusBlank > files.$$ - -rm filesPlusBlank - - -# make sourceFiles -# ~~~~~~~~~~~~~~~~ -echo "SOURCE = " > tmpSourceFile -cat files.$$ >> tmpSourceFile - -sed -e 's/$/\\/' \ - -e '$s/\\//' \ - tmpSourceFile > sourceFiles - -rm tmpSourceFile - - -# make objectFiles -# ~~~~~~~~~~~~~~~~ -sed -e 's%.*/%%' \ - -e 's%^%$(OBJECTS_DIR)/%' \ - -e 's%\.[a-zA-Z]*$%\.o%' \ - files.$$ > tmpObjectFiles - -echo "OBJECTS = " > tmpObjectFiles2 -cat tmpObjectFiles >> tmpObjectFiles2 - -sed -e 's/$/\\/' \ - -e '$s/\\//' \ - tmpObjectFiles2 > objectFiles - -rm tmpObjectFiles tmpObjectFiles2 - - -# make localObjectFiles -# ~~~~~~~~~~~~~~~~~~~~~ -sed -e 's%.*/%%' \ - -e 's%\.[a-zA-Z]*$%\.o%' \ - files.$$ > tmpLocalObjectFiles - -echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2 -cat tmpLocalObjectFiles >> tmpLocalObjectFiles2 - -sed -e 's/$/\\/' \ - -e '$s/\\//' \ - tmpLocalObjectFiles2 > localObjectFiles - -rm tmpLocalObjectFiles tmpLocalObjectFiles2 - - -# make dependencyFiles -# ~~~~~~~~~~~~~~~~~~~~ -sed 's/\.[a-zA-Z]*$/\.dep/' \ - files.$$ > tmpDependencyFiles - -echo "DEPENDENCIES = " > tmpDependencyFiles2 -cat tmpDependencyFiles >> tmpDependencyFiles2 - -sed -e 's/$/\\/' \ - -e '$s/\\//' \ - tmpDependencyFiles2 > dependencyFiles - -rm tmpDependencyFiles tmpDependencyFiles2 - - -# make includeDeps -# ~~~~~~~~~~~~~~~~ -sed -e 's/\.[a-zA-Z]*$/.dep/' \ - -e 's/^/include /' \ - files.$$ > includeDeps - -rm files.$$ - -#------------------------------------------------------------------------------ diff --git a/wmake/scripts/makeDir b/wmake/scripts/makeDir deleted file mode 100755 index 19ab86b7de..0000000000 --- a/wmake/scripts/makeDir +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | -#------------------------------------------------------------------------------- -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# Script -# makeDir -# -# Description -# Script to make directories that do not already exist -# Usage : makeDir [.. ] -# -#------------------------------------------------------------------------------ - -for dir -do - [ -d "$dir" ] || mkdir -p "$dir" -done - - -#------------------------------------------------------------------------------ diff --git a/wmake/src/Makefile b/wmake/src/Makefile index 328f3e53a0..07b2d43562 100644 --- a/wmake/src/Makefile +++ b/wmake/src/Makefile @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -36,11 +36,10 @@ SHELL = /bin/sh #------------------------------------------------------------------------------ -# Initialise suffices list +# Unset suffices list (suffix rules are not used) #------------------------------------------------------------------------------ .SUFFIXES: -.SUFFIXES: .o #------------------------------------------------------------------------------ diff --git a/wmake/src/makeParserCode b/wmake/src/makeParserCode index 161d5af41b..1ddf1576a4 100755 --- a/wmake/src/makeParserCode +++ b/wmake/src/makeParserCode @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -29,24 +29,25 @@ # Use coco-cpp to create parser code # #------------------------------------------------------------------------------ -cd ${0%/*} || exit 1 # run from this directory +cd ${0%/*} || exit 1 # Run from this directory +Script=${0##*/} -bindir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/coco-cpp/bin -frames=$bindir/../share/coco-cpp +binDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/coco-cpp/bin +frames=$binDir/../share/coco-cpp -[ -d "$bindir" -a -x "$bindir/coco-cpp" ] || { - echo "no coco-cpp binary found" +[ -d "$binDir" -a -x "$binDir/coco-cpp" ] || { + echo "$Script error: no coco-cpp binary found" exit 1 } [ -d "$frames" -a -f "$frames/Parser.frame" -a -f "$frames/Scanner.frame" ] || { - echo "no coco-cpp frames found" + echo "$Script error: no coco-cpp frames found" exit 1 } -# run coco-cpp: -$bindir/coco-cpp wmkdependParser.atg +# Run coco-cpp: +$binDir/coco-cpp wmkdependParser.atg echo echo Done diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l index 3b6973209b..c9e1d8e67d 100644 --- a/wmake/src/wmkdep.l +++ b/wmake/src/wmkdep.l @@ -3,7 +3,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------ License @@ -68,16 +68,6 @@ void importDir(const char* dirName); ^[ \t]*#[ \t]*include[ \t]+\" BEGIN(CFNAME); /* c-file name */ [^"\n ]* { BEGIN(INITIAL); nextFile(yytext); } /*"*/ -^[ \t]*import[ \t]+ BEGIN(JFNAME); /* java-file name */ -java.*; BEGIN(INITIAL); -org.*; BEGIN(INITIAL); -com.*; BEGIN(INITIAL); -sunw.*; BEGIN(INITIAL); -sun.*; BEGIN(INITIAL); -launcher.*; BEGIN(INITIAL); -[^"\n*]*; { BEGIN(INITIAL); importFile(yytext); } /*"*/ -[^"\n]*\*; { BEGIN(INITIAL); importDir(yytext); } /*"*/ - " "include[ \t]+\' BEGIN(FFNAME); /* FORTRAN-file name */ [^']* { BEGIN(INITIAL); nextFile(yytext); } /*'*/ @@ -134,7 +124,6 @@ int lookUp(struct HashEntry** hashTable, const char* p) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - int nDirectories = 0; char** directories; char* sourceFile = NULL; @@ -143,10 +132,6 @@ char* depFile = NULL; /* Set of files already visited */ struct HashEntry* visitedFiles[HASH_TABLE_SIZE]; -/* Set of (java) directories already visited */ -struct HashEntry* visitedDirs[HASH_TABLE_SIZE]; - - int main(int argc, char* argv[]) { char *basePos, *dotPos; @@ -226,31 +211,23 @@ int main(int argc, char* argv[]) * because there is a bug in the SGI strncat that if 0 preceeds the '.' * it inserts a space */ - depFile = (char*)malloc(strlen(sourceFile) + 3); + depFile = (char*)malloc(strlen(sourceFile) + 20); depFile[0] = 0; - strncat(depFile, sourceFile, (dotPos - sourceFile)/sizeof(char)); + strcat(depFile, "$(OBJECTS_DIR)/"); + strcat(depFile, sourceFile); strcat(depFile, ".dep"); - if (strcmp(dotPos, ".java") == 0) - { - char *classFile = strdup(sourceFile); - classFile[(dotPos - sourceFile)/sizeof(char)] = 0; + char *objectFile = strdup(basePos); + objectFile[(dotPos - basePos)/sizeof(char)] = 0; - printf("$(CLASSES_DIR)/%s.class: %s\n", classFile, depFile); - free(classFile); - } - else - { - char *objectFile = strdup(basePos); - objectFile[(dotPos - basePos)/sizeof(char)] = 0; - - printf("$(OBJECTS_DIR)/%s.o: %s\n", objectFile, depFile); - free(objectFile); - } + /* printf("$(OBJECTS_DIR)/%s.o: %s\n", objectFile, depFile); */ + printf("%s: \\\n", depFile); + free(objectFile); nextFile(sourceFile); yylex(); + puts("\n"); for (i = 0; i < nDirectories; i++) { @@ -322,7 +299,7 @@ void nextFile(const char* fileName) if ((newyyin = fopen(pathName, "r"))) { - printf("%s: %s\n", depFile, pathName); + printf("%s \\\n", pathName); buffers[currentBuffer++] = YY_CURRENT_BUFFER; yy_switch_to_buffer(yy_create_buffer(newyyin, YY_BUF_SIZE)); @@ -361,7 +338,7 @@ void nextFile(const char* fileName) } else { - printf("%s: %s\n", depFile, fileName); + printf("%s \\\n", fileName); fflush(stdout); buffers[currentBuffer++] = YY_CURRENT_BUFFER; @@ -385,77 +362,6 @@ void dotToSlash(char* fileName) } -/* - * Import (java) file - */ -void importFile(const char* fileName) -{ - char* javaFileName; - int fileNameLen; - - fileNameLen = strlen(fileName); - javaFileName = (char*)malloc(fileNameLen + 6); - javaFileName[0] = 0; - strncat(javaFileName, fileName, fileNameLen - 1); - dotToSlash(javaFileName); - strcat(javaFileName, ".java"); - - nextFile(javaFileName); - - free(javaFileName); -} - - -/* - * Import (java) directories - */ -void importDir(const char* dirName) -{ - char *uDirName; - DIR *source; - - if (lookUp(visitedDirs, dirName)) - { - return; /* already existed (did not insert) */ - } - - uDirName = strdup(dirName); - dotToSlash(uDirName); - - uDirName[strlen(dirName)-2] = 0; - - if ((source = opendir(uDirName)) == NULL) - { - fprintf - ( - stderr, - "could not open directory %s\n", - uDirName - ); - } - else - { - /* Read and parse all the entries in the directory */ - struct dirent *list; - - while ((list = readdir(source)) != NULL) - { - char* dotPos = strrchr(list->d_name, '.'); - - if (dotPos != NULL && strcmp(dotPos, ".java") == 0) - { - char* pathName = addDirectoryName(uDirName, list->d_name); - nextFile(pathName); - free(pathName); - } - } - - closedir(source); - } - free(uDirName); -} - - /* * The lexer calls yywrap to handle EOF conditions */ diff --git a/wmake/wclean b/wmake/wclean index 2427511f2f..28e2621bcc 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -57,7 +57,10 @@ USAGE } -# parse options +#------------------------------------------------------------------------------ +# Parse arguments and options +#------------------------------------------------------------------------------ + while [ "$#" -gt 0 ] do case "$1" in @@ -81,7 +84,7 @@ done # check arguments and change to the directory in which to run wclean #------------------------------------------------------------------------------ -unset dir makeType +unset dir targetType MakeDir=Make if [ $# -ge 1 ] @@ -91,7 +94,7 @@ then then dir=$1 else - makeType=$1 + targetType=$1 fi # specified directory name: @@ -112,11 +115,12 @@ then echo "$Script ${dir:-./}" fi + #------------------------------------------------------------------------------ # Recurse the directories tree #------------------------------------------------------------------------------ -if [ "$makeType" = all ] +if [ "$targetType" = all ] then if [ -e Allwclean ] # consistent with Allwmake then @@ -126,40 +130,51 @@ then then ./Allclean exit $? - elif [ ! -d $MakeDir ] - then + else + # For all the sub-directories containing a 'Make' directory for dir in `find . \( -type d -a -name Make \)` do + echo $dir $0 ${dir%/Make} # parent directory - trim /Make from the end done - exit 0 fi fi -# makeType is not needed beyond this point -unset makeType +# targetType is not needed beyond this point +unset targetType #------------------------------------------------------------------------------ -# Require the existence of the 'Make' directory +# Clean the 'Make' directory if present #------------------------------------------------------------------------------ -[ -d $MakeDir ] || { - echo "$Script error: '$MakeDir' directory does not exist" 1>&2 - exit 1 -} +if [ -d $MakeDir ] +then + objectsDir=$MakeDir/$WM_OPTIONS + if echo $PWD | grep "$WM_PROJECT_DIR" + then + platformPath=$WM_PROJECT_DIR/platforms/${WM_OPTIONS} + objectsDir=$platformPath$(echo $PWD | sed s%$WM_PROJECT_DIR%% ) + fi + rm -rf $objectsDir 2>/dev/null +fi + + +#------------------------------------------------------------------------------ +# Remove the lnInclude directory if present +#------------------------------------------------------------------------------ + +if [ -d lnInclude ] +then + rm -rf lnInclude 2>/dev/null +fi + + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage -# ----------------------------------------------------------------------------- - -rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes 2>/dev/null - -find . -name "*.dep" -exec rm {} \; - -# always safe to remove lnInclude -rm -rf lnInclude 2>/dev/null - -rm -rf ii_files Templates.DB 2>/dev/null -rm -f so_locations 2>/dev/null - #------------------------------------------------------------------------------ diff --git a/wmake/wcleanAll b/wmake/wcleanAll index 499b95eb32..a136f7704d 100755 --- a/wmake/wcleanAll +++ b/wmake/wcleanAll @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -30,19 +30,25 @@ # directories of all machines and delete them. # #------------------------------------------------------------------------------ +Script=${0##*/} + usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 + echo "no directory: $dir" 1>&2 fi done + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script + + #------------------------------------------------------------------------------ diff --git a/wmake/wcleanMachine b/wmake/wcleanMachine index 7981a55cbd..1079b734a3 100755 --- a/wmake/wcleanMachine +++ b/wmake/wcleanMachine @@ -34,11 +34,13 @@ # wcleanMachine [ .. ] # #------------------------------------------------------------------------------ +Script=${0##*/} + usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<. +# +# Script +# wdep +# cat `wdep ` +# +# Description +# Find the dep-file corresponding to and print the path. +# +# Note: wdep MUST be run from the directory containing . +# If it proves useful an option could be added to search the local +# source-tree for if it is not in the current directory. +# +#------------------------------------------------------------------------------ +Script=${0##*/} + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat< + +Find the dep-file corresponding to in the current directory +and print the path. + +USAGE + exit 1 +} + + +#------------------------------------------------------------------------------ +# Parse arguments and options +#------------------------------------------------------------------------------ + +while [ "$#" -gt 0 ] +do + case "$1" in + -h | -help) + usage + ;; + -*) + usage "unknown option: '$*'" + ;; + *) + break + ;; + esac +done + + +#------------------------------------------------------------------------------ +# Check is is the current directory +#------------------------------------------------------------------------------ + +if [ ! -e $1 ] +then + echo "$Script error: source file $1 is not in the current directory" 1>&2 + exit 1 +fi + + +#------------------------------------------------------------------------------ +# Check environment variables +#------------------------------------------------------------------------------ + +for envar in WM_OPTIONS WM_DIR WM_PROJECT_DIR +do + eval test "\$$envar" || { + echo "$Script error: environment variable \$$envar not set" 1>&2 + exit 1 + } +done + + +#------------------------------------------------------------------------------ +# Search up directories tree for the Make sub-directory +#------------------------------------------------------------------------------ + +expandPath() +{ + dir=$(dirname $1) + cwd=$PWD + cd $dir + exPath=$PWD + cd $cwd +} + +findTarget() +{ + expandPath $1 + + if [ "$exPath" = "$WM_PROJECT_DIR" \ + -o "$exPath" = "$HOME" \ + -o "$exPath" = "/" \ + ] + then + echo "$Script error: could not find Make directory" 1>&2 + exit 1 + elif [ -d "$1/Make" ]; then + dir=$1 + else + findTarget "$1/.." + fi +} + +fileName=${1##*/} + +expandPath $1 + +if echo $exPath | grep "$WM_PROJECT_DIR" > /dev/null +then + platformPath=$WM_PROJECT_DIR/platforms/${WM_OPTIONS} + objectsDir=$platformPath$(echo $exPath | sed s%$WM_PROJECT_DIR%% ) +else + path=$exPath + dir=. + if [ ! -d Make ] + then + findTarget . + fi + appDir=$dir + expandPath $appDir/. + objectsDir=$appDir/Make/${WM_OPTIONS}$(echo $path | sed s%$exPath%% ) +fi + +echo $objectsDir/$fileName.dep + + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage expandPath findTarget + + +#------------------------------------------------------------------------------ diff --git a/wmake/wmake b/wmake/wmake index 0f8e2cc41f..5f5ce2ebef 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -26,7 +26,27 @@ # wmake # # Description -# General, easy to use make system for multi-platform development. +# General, easy to use make system for multi-platform development +# with support for local and network parallel compilation. +# +# This updated wmake supports out-of-tree object and dependency files to +# avoid the clutter which accumulates in the source-tree with the original +# wmake system. Now when building the OpenFOAM package both the object and +# dependency files are now located in a tree with the same structure as the +# source tree but in the platforms/$WM_OPTIONS sub-directory of +# $WM_PROJECT_DIR. +# +# When building user libraries and applications which are not located in the +# OpenFOAM source-tree the object and dependency files are located in a tree +# with the same structure as the source tree but in the Make/$WM_OPTIONS +# sub-directory. +# +# The disadvantage of the out-of-tree compilation is that the dependency +# files are harder to find but are sometimes useful to study which header +# files are included. For those who need access to the dependency files the +# new wdep script is provided to locate them. +# See the wdep script header or run: +# wdep -h # #------------------------------------------------------------------------------ Script=${0##*/} @@ -40,32 +60,41 @@ Usage: $Script [OPTION] [dir] $Script [OPTION] target [dir [MakeDir]] options: - -s | -silent invoke make in 'silent' mode (do not echo commands) - -help print the usage + -s | -silent Run make in 'silent' mode (do not echo commands) + -a | -all Run wmake in all subdirectories + -h | -help Print the usage A general, easy-to-use make system for multi-platform development +with support for local and network parallel compilation. The 'target' is a Makefile target: - e.g., Make/linux64GccDPOpt/fvMesh.o + e.g., platforms/linux64GccDPOpt/.../fvMesh.o or a special target: - 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 - dep build lnInclude and dependencies only + all wmake all subdirectories, running Allwmake files if present + exe Compile statically linked executable + lib Compile statically linked archive lib (.a) + libo Compile statically linked lib (.o) + libso Compile dynamically linked lib (.so) + dep Compile lnInclude and dependencies only USAGE exit 1 } -# normally use "make" + +# Default make is the "make" in the path make="make" -# parse options + +#------------------------------------------------------------------------------ +# Parse arguments and options +#------------------------------------------------------------------------------ + +# Default to compiling the local target only +all= + while [ "$#" -gt 0 ] do case "$1" in @@ -76,6 +105,10 @@ do make="$make -s" shift ;; + -a | -all | all) + all="all" + shift + ;; -*) usage "unknown option: '$*'" ;; @@ -90,30 +123,31 @@ done # Check environment variables #------------------------------------------------------------------------------ -for check in WM_OPTIONS WM_LINK_LANGUAGE WM_DIR +for envar in WM_OPTIONS WM_LINK_LANGUAGE WM_DIR do - eval test "\$$check" || { - echo "$Script error: environment variable \$$check not set" 1>&2 + eval test "\$$envar" || { + echo "$Script error: environment variable \$$envar not set" 1>&2 exit 1 } done -# when compiling anything but a standalone exe: -# WM_PROJECT and WM_PROJECT_DIR must be set +# When compiling anything but a standalone exe WM_PROJECT and WM_PROJECT_DIR +# must be set [ "$1" = exe -o \( "$WM_PROJECT" -a "$WM_PROJECT_DIR" \) ] || { echo "$Script error:" 1>&2 - echo " environment variable \$WM_PROJECT or \$WM_PROJECT_DIR not set" 1>&2 + echo " environment variable \$WM_PROJECT or " \ + "\$WM_PROJECT_DIR not set" 1>&2 echo " while building project library" 1>&2 exit 1 } #------------------------------------------------------------------------------ -# Select the version of make use +# Setup parallel compilation #------------------------------------------------------------------------------ -# set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set +# Set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ] then WM_NCOMPPROCS=$(wmakeScheduler -count) @@ -142,7 +176,7 @@ fi # Check arguments and change to the directory in which to run wmake #------------------------------------------------------------------------------ -unset dir makeType +unset dir targetType MakeDir=Make if [ $# -ge 1 ] @@ -151,13 +185,13 @@ then then dir=$1 else - makeType=$1 + targetType=$1 fi - # specified directory name: + # Specified directory name: [ $# -ge 2 ] && dir=$2 - # specified alternative name for the Make sub-directory: + # Specified alternative name for the Make sub-directory: [ $# -ge 3 ] && MakeDir=$3 if [ "$dir" ] @@ -171,55 +205,71 @@ fi #------------------------------------------------------------------------------ -# Recurse the application directories tree +# Recurse the source tree to compile "all" targets #------------------------------------------------------------------------------ -if [ "$makeType" = all ] +if [ "$all" = "all" ] then if [ -e Allwmake ] then ./Allwmake exit $? - elif [ ! -d $MakeDir ] - then - # FOAM_APPS=$(find . -maxdepth 1 \( -type d -a ! -name "." -a ! -name Optional -a ! -name Make \) -printf "%f ") - # avoid 'find' with '-printf' ... not entirely portable - FOAM_APPS=$(for d in *; do [ -d "$d" -a "$d" != Optional -a "$d" != Make ] && echo "$d"; done | xargs) - $make -k -f $WM_DIR/MakefileApps FOAM_APPS="$FOAM_APPS" - exit $? + else + # Find all the sub-directories containing a 'Make' directory + FOAM_APPS=$(\ + for d in *; \ + do [ -d "$d" -a "$d" != Optional -a "$d" != Make ] \ + && echo "$d"; \ + done | xargs \ + ) + if [ ! "$FOAM_APPS" = "" ] + then + # Compile all applications in sub-directories + $make ${WM_CONTINUE_ON_ERROR:+-k} \ + -f $WM_DIR/MakefileApps \ + TARGET="$targetType" FOAM_APPS="$FOAM_APPS" + fi + # If the current directory contains a 'Make' directory continue + # otherwise exit + if [ ! -d $MakeDir ] + then + exit $? + fi fi fi #------------------------------------------------------------------------------ -# Search up directories tree for the Make sub-directory and build there -# Also check the existance of the 'files' file +# Search up the directory tree for the Make sub-directory, +# check the existance of the 'files' file and build there if present #------------------------------------------------------------------------------ unset dir -MakeDir=Make -expandpath() +expandPath() { - dir=`dirname $1` + dir=$(dirname $1) cwd=$PWD cd $dir exPath=$PWD cd $cwd } -find_target() +findTarget() { - expandpath $1 + expandPath $1 - if [ "$exPath" = "$WM_PROJECT_DIR" -o "$exPath" = "$HOME" -o "$exPath" = "/" ] + if [ "$exPath" = "$WM_PROJECT_DIR" \ + -o "$exPath" = "$HOME" \ + -o "$exPath" = "/" \ + ] then - echo "$Script error: could not find Make directory" + echo "$Script error: could not find Make directory" 1>&2 elif [ -d "$1/Make" ]; then echo " Found target directory " $1 dir=$1 else - find_target "$1/.." + findTarget "$1/.." fi } @@ -228,8 +278,8 @@ then echo "$Script: '$MakeDir' directory does not exist in $PWD" 1>&2 echo " Searching up directories tree for Make directory" - find_target . - makeType= + findTarget . + targetType= if [ "$dir" ] then @@ -251,14 +301,14 @@ fi # Transform options #------------------------------------------------------------------------------ -# transform "all" or no option to "libso" if that looks appropriate or remove it +# Transform no option to "libso" if that looks appropriate or remove it # so that the call to make builds the application -if [ "$makeType" = all -o "$makeType" = "" ] +if [ "$targetType" = "" ] then - unset makeType + unset targetType if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1 then - makeType=libso + targetType=libso fi fi @@ -268,23 +318,33 @@ fi # files and options being built in parallel #------------------------------------------------------------------------------ +objectsDir=$MakeDir/$WM_OPTIONS +if echo $PWD | grep "$WM_PROJECT_DIR" +then + platformPath=$WM_PROJECT_DIR/platforms/${WM_OPTIONS} + objectsDir=$platformPath$(echo $PWD | sed s%$WM_PROJECT_DIR%% ) +fi + ( - cd $MakeDir unset MAKEFLAGS - make -s -f $WM_DIR/MakefileOptions - make -s -f $WM_DIR/MakefileFiles allFiles + mkdir -p $objectsDir + + # Pre-build the $WM_OPTIONS/options file + # which is included when building the $WM_OPTIONS/files file + $make -s -f $WM_DIR/MakefileFiles MAKE_DIR=$MakeDir OBJECTS_DIR=$objectsDir\ + $objectsDir/options + + $make -s -f $WM_DIR/MakefileFiles MAKE_DIR=$MakeDir OBJECTS_DIR=$objectsDir ) #------------------------------------------------------------------------------ -# Check the $OBJECTS_DIR = $MakeDir/$WM_OPTIONS/objectFiles file -# was created successfully +# Check the $objectsDir/sourceFiles file was created successfully #------------------------------------------------------------------------------ -OBJECTS_DIR=$MakeDir/$WM_OPTIONS - -[ -r $OBJECTS_DIR/objectFiles ] || { - echo "$Script error: file '$OBJECTS_DIR/objectFiles' could not be created in $PWD" 1>&2 +[ -r $objectsDir/sourceFiles ] || { + echo "$Script error: file '$objectsDir/sourceFiles'" \ + "could not be created in $PWD" 1>&2 exit 1 } @@ -293,29 +353,32 @@ OBJECTS_DIR=$MakeDir/$WM_OPTIONS # Make the dependency files #------------------------------------------------------------------------------ -touch $OBJECTS_DIR/dontIncludeDeps - -case "$makeType" in -lib | libo | libso | dep ) - $make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/dontIncludeDeps lnInclude/uptodate - ;; +# For libraries create lnInclude ... +case "$targetType" in + lib | libo | libso | dep ) + # ... but only if 'LIB' is declared in 'Make/files' + if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1 + then + $make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir \ + OBJECTS_DIR=$objectsDir lnInclude + fi + ;; esac -$make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/dontIncludeDeps $OBJECTS_DIR/dependencies -rc=$? -[ $rc -eq 0 ] || exit $rc +#------------------------------------------------------------------------------ +# Make the dependency files or object files and link +#------------------------------------------------------------------------------ + +exec $make -f $WM_DIR/Makefile MAKE_DIR=$MakeDir OBJECTS_DIR=$objectsDir \ + $targetType #------------------------------------------------------------------------------ -# Make the object files and link +# Cleanup local variables and functions #------------------------------------------------------------------------------ -if [ "$makeType" != dep ] -then - cmd="$make -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/includeDeps $makeType" - # echo "cmd=$cmd" - exec $cmd -fi +unset Script usage expandPath findTarget + #------------------------------------------------------------------------------ diff --git a/wmake/wmakeCheckPwd b/wmake/wmakeCheckPwd index 8de18be3a9..75aedba30d 100755 --- a/wmake/wmakeCheckPwd +++ b/wmake/wmakeCheckPwd @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -23,13 +23,14 @@ # along with OpenFOAM. If not, see . # # Script -# wmakeCheckPwd +# wmakeCheckPwd # # Description -# Check that the current working directory is equal to a particular -# target directory, resolving the absolute path as required +# Check that the current working directory is the directory # #------------------------------------------------------------------------------- +Script=${0##*/} + unset quietOpt usage() { @@ -38,13 +39,12 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< Exit status 0 when the directories are identical Exit status 1 on error @@ -54,7 +54,10 @@ USAGE } -# parse options +#------------------------------------------------------------------------------ +# Parse arguments and options +#------------------------------------------------------------------------------ + while [ "$#" -gt 0 ] do case "$1" in @@ -76,27 +79,40 @@ done [ "$#" -eq 1 ] || usage + +# Set dirName to dirName="$1" - -# trivial checks first +# Simple check against $PWD [ "$PWD" = "$dirName" ] && exit 0 +# Check existance of [ -d "$dirName" ] || { - [ "$quietOpt" = true ] || echo "Error: Directory does not exist $dirName" + [ "$quietOpt" = true ] || { + echo "$Script error: Directory does not exist $dirName" + } exit 1 } - -# use /bin/pwd to get the absolute path (could be linked) +# Use /bin/pwd to get the absolute path (could be linked) thisDir=$(/bin/pwd) target=$(cd $dirName 2>/dev/null && /bin/pwd) -# okay +# Return 0 if this directory is [ "$thisDir" = "$target" ] && exit 0 -# some other error -[ "$quietOpt" = true ] || echo "Error: Current directory is not $dirName" +# This directory is not +[ "$quietOpt" = true ] || { + echo "$Script error: Current directory is not $dirName" +} exit 1 + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage + + #------------------------------------------------------------------------------ diff --git a/wmake/wmakeFilesAndOptions b/wmake/wmakeFilesAndOptions index d43d8bf5a2..022d3ed245 100755 --- a/wmake/wmakeFilesAndOptions +++ b/wmake/wmakeFilesAndOptions @@ -38,7 +38,7 @@ usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<. -# -# Script -# wmakeFindEmptyMake -# -# Description -# Find 'Make/' directories without 'files' or 'options'. -# These typically correspond to (partially) removed applications. -# -#------------------------------------------------------------------------------ -usage() { - while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat<&2 - echo "---------" 1>&2 - else - echo "skipping non-dir: $checkDir" 1>&2 - echo "----------------" 1>&2 - continue - fi - - find $checkDir -depth -type d -name Make -print | while read MakeDir - do - [ -f "$MakeDir/files" -o -f "$MakeDir/options" ] || echo $MakeDir - done -done - -#------------------------------------------------------------------------------ diff --git a/wmake/wmakeLnInclude b/wmake/wmakeLnInclude index fa8dc97fe0..b68c31a6e0 100755 --- a/wmake/wmakeLnInclude +++ b/wmake/wmakeLnInclude @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -36,6 +36,7 @@ # Avoid # *.c (C source) # .#* (cvs recovered files) +# #------------------------------------------------------------------------------ Script=${0##*/} @@ -61,17 +62,19 @@ USAGE exit 1 } + +#------------------------------------------------------------------------------ +# Parse arguments and options #------------------------------------------------------------------------------ -# default 'find' option +# Default 'find' option unset findOpt -# default 'ln' option +# Default 'ln' option lnOpt="-s" unset forceUpdate silentOpt -# simple parse options while [ "$#" -gt 0 ] do case "$1" in @@ -100,11 +103,11 @@ if [ $# -eq 1 ] then baseDir=$1 else - usage "ERROR: incorrect number of arguments" + 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 ] do baseDir="${baseDir%/*}" @@ -138,25 +141,39 @@ fi cd $incDir || exit 1 -#------------------------------------------------------------------------------ - if [ "$silentOpt" != true ] then echo "$Script: linking include files to $incDir" 1>&2 fi -# -# remove any broken links first (this helps when file locations have moved) -# -find -L . -type l -exec rm {} \; - -# -# create links, avoid recreating links unless necessary -# things placed in the 'noLink' directory are skipped -# -find .. $findOpt \ - \( -name lnInclude -o -name Make -o -name config -o -name noLink \) -prune \ - -o \( -name '*.[CHh]' -o -name '*.[ch]xx' -o -name '*.[ch]pp' -o -name '*.type' \) \ - -exec ln $lnOpt {} . \; + +#------------------------------------------------------------------------------ +# Remove any broken links first (this helps when file locations have moved) +#------------------------------------------------------------------------------ +find -L . -type l -exec rm {} \; + + +#------------------------------------------------------------------------------ +# Create links, avoid recreating links unless necessary +# things placed in the 'noLink' directory are skipped +#------------------------------------------------------------------------------ +find .. $findOpt \ + \( -name lnInclude -o -name Make -o -name config -o -name noLink \) \ + -prune \ + -o \( \ + -name '*.[CHh]' \ + -o -name '*.[ch]xx' \ + -o -name '*.[ch]pp' \ + -o -name '*.type' \ + \) \ + -exec ln $lnOpt {} . \; + + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script usage + #------------------------------------------------------------------------------ diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll index 1c396678b2..0ecaf9ec5d 100755 --- a/wmake/wmakeLnIncludeAll +++ b/wmake/wmakeLnIncludeAll @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -30,11 +30,13 @@ # and execute 'wmakeLnInclude -f' for each one # #------------------------------------------------------------------------------ +Script=${0##*/} + usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 -# Debug information -# version='$version' -# package='$package' -# oldVersion='$oldVersion' -# oldPackage='$oldPackage' -# DEBUG - -# check git vs. persistent build tag +#------------------------------------------------------------------------------ +# Check git vs. persistent build tag +#------------------------------------------------------------------------------ if [ -n "$checkOnly" ] then if [ $rc -eq 0 ] @@ -207,23 +209,26 @@ then fi -# -# cannot get git information or -version version -# +#------------------------------------------------------------------------------ +# Cannot get git information or -version version +#------------------------------------------------------------------------------ if [ $rc -ne 0 ] then if [ -n "$oldVersion" ] then - # use previous version info + # Use previous version info version="$oldVersion" else - # fallback to WM_PROJECT_VERSION alone + # Fallback to WM_PROJECT_VERSION alone version="${WM_PROJECT_VERSION:-unknown}" fi fi -# output the tag +#------------------------------------------------------------------------------ +# Output the tag +#------------------------------------------------------------------------------ printTag + #------------------------------------------------------------------------------ diff --git a/wmake/wmakeScheduler b/wmake/wmakeScheduler index c079883c6c..7b3d51e91b 100755 --- a/wmake/wmakeScheduler +++ b/wmake/wmakeScheduler @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -48,16 +48,17 @@ # eg, export WM_NCOMPPROCS=$(wmakeScheduler -count) # #------------------------------------------------------------------------------- +Script=${0##*/} # csh sets HOST, bash sets HOSTNAME : ${HOST:=$HOSTNAME} - lockDir=$HOME/.$WM_PROJECT/.wmake -# fallback - 1 core on current host + +# Fallback - 1 core on current host : ${WM_HOSTS:=$HOST:1} -# count the total number of slots available and exit +# Count the total number of slots available and exit if [ "$1" = "-count" ] then expr $( @@ -71,12 +72,12 @@ then exit 0 fi -# where to source WM_PROJECT settings in a remote shell +# Where to source WM_PROJECT settings in a remote shell # This code tries to figure out which cshrc or bashrc to execute. # !! Assumes remote computer running same shell and startup files # in same location -sourceFoam=false # fallback command +sourceFoam=false # Fallback command case $SHELL in */csh | */tcsh ) # [t]csh vs bash|ksh|sh shellRc=cshrc @@ -86,9 +87,9 @@ case $SHELL in ;; esac -# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/ -# check ~/.$WM_PROJECT/ -# check /etc/ +# Check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/ +# Check ~/.$WM_PROJECT/ +# Check /etc/ if [ "$WM_PROJECT" ] then for i in \ @@ -125,9 +126,9 @@ case $sourceFoam in ;; esac -# quote double-quotes for remote command line +# Quote double-quotes for remote command line rcmd=$(echo $* | sed -e s/\"/\'\"\'/g) -## the same, without forking (not ksh, maybe not /bin/sh either) +# The same, without forking (not ksh, maybe not /bin/sh either) # rcmd=$(while [ "$#" -gt 0 ]; do echo "${1//\"/'\"'}"; shift; done) @@ -146,9 +147,9 @@ done set -o pipefail -# -# colour output by argument 1 -# +#------------------------------------------------------------------------------ +# Colour output by argument 1 +#------------------------------------------------------------------------------ colourPipe() { @@ -173,7 +174,7 @@ colourIndex=0 # Check for existence of lockfile binary if ! type -p lockfile >/dev/null then - echo "Could not find executable 'lockfile'" + echo "$Script: Could not find executable 'lockfile'" exit 1 fi @@ -181,7 +182,7 @@ while : do for slotGroup in $WM_HOSTS do - # split 'host:N', but catch 'host:' and 'host' too + # Split 'host:N', but catch 'host:' and 'host' too host=${slotGroup%%:*} n=${slotGroup##*:} [ "$n" = "$host" ] && n=1 # missing ':' @@ -201,14 +202,16 @@ do if [ "$host" = "$HOST" ]; then eval $* 2>&1 | colourPipe "$colour" else - ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour" + ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" \ + 2>&1 | colourPipe "$colour" fi retval=$? else if [ "$host" = "$HOST" ]; then eval $* 2>&1 else - ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 + ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" \ + 2>&1 fi retval=$? fi @@ -234,4 +237,12 @@ then setterm -foreground default fi + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script + + #------------------------------------------------------------------------------ diff --git a/wmake/wmakeSchedulerUptime b/wmake/wmakeSchedulerUptime index 06442045bb..eb52f40615 100755 --- a/wmake/wmakeSchedulerUptime +++ b/wmake/wmakeSchedulerUptime @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -48,16 +48,16 @@ # eg, export WM_NCOMPPROCS=$(wmakeScheduler -count) # #------------------------------------------------------------------------------- +Script=${0##*/} # csh sets HOST, bash sets HOSTNAME : ${HOST:=$HOSTNAME} - lockDir=$HOME/.$WM_PROJECT/.wmake -# fallback - 1 core on current host +# Fallback - 1 core on current host : ${WM_HOSTS:=$HOST:1} -# count the total number of slots available and exit +# Count the total number of slots available and exit if [ "$1" = "-count" ] then expr $( @@ -71,7 +71,7 @@ then exit 0 fi -# where to source WM_PROJECT settings in a remote shell +# Where to source WM_PROJECT settings in a remote shell # This code tries to figure out which cshrc or bashrc to execute. # !! Assumes remote computer running same shell and startup files # in same location @@ -86,9 +86,9 @@ case $SHELL in ;; esac -# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/ -# check ~/.$WM_PROJECT/ -# check /etc/ +# Check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/ +# Check ~/.$WM_PROJECT/ +# Check /etc/ if [ "$WM_PROJECT" ] then for i in \ @@ -210,7 +210,7 @@ do load=`echo "$stat" | sed -e 's/.*average:[^0-9.]*\([0-9.]*\).*/\1/'` - #echo "Machine:$host load:$load allowed:$WM_NCOMPPROCS nprocs:$nprocs" + #echo "$Script: Machine:$host load:$load allowed:$WM_NCOMPPROCS nprocs:$nprocs" # Check if adding nprocs to load causes overload @@ -220,16 +220,17 @@ do then # Set colour colour="${colourList[$colourIndex]}" - echo "Machine:$host Starting:$*" + echo "$Script: Machine:$host Starting:$*" if [ "$host" = "$HOST" ]; then eval $* 2>&1 | colourPipe "$colour" else - ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | colourPipe "$colour" + ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 \ + | colourPipe "$colour" fi retval=$? else - echo "Machine:$host Starting:$*" + echo "$Script: Machine:$host Starting:$*" if [ "$host" = "$HOST" ]; then eval $* 2>&1 else @@ -248,8 +249,16 @@ do done # Did not find any free machines. Rest a bit. - #echo "Too much load. Waiting" + #echo "$Script: Too much load. Waiting" sleep 1 done + +#------------------------------------------------------------------------------ +# Cleanup local variables and functions +#------------------------------------------------------------------------------ + +unset Script + + #------------------------------------------------------------------------------