From 844b28303048098f3cc3f36904eb86e8a8be53c2 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Sun, 14 Dec 2014 21:42:18 +0000
Subject: [PATCH] New version of wmake supporting out-of-tree object and
 dependency files

---
 Allwmake                                      |  34 +--
 README.org                                    |  12 +-
 applications/Allwmake                         |  15 +-
 .../solvers/combustion/reactingFoam/Allwmake  |  10 -
 .../compressible/rhoCentralFoam/Allwclean     |   2 +-
 .../compressible/rhoCentralFoam/Allwmake      |   2 +-
 .../compressible/rhoPimpleFoam/Allwmake       |  10 -
 .../compressible/rhoSimpleFoam/Allwclean      |   9 -
 .../compressible/rhoSimpleFoam/Allwmake       |   9 -
 .../solvers/compressible/sonicFoam/Allwmake   |   9 -
 .../heatTransfer/chtMultiRegionFoam/Allwclean |   8 -
 .../heatTransfer/chtMultiRegionFoam/Allwmake  |   8 -
 .../incompressible/pimpleFoam/Allwmake        |   9 -
 .../incompressible/simpleFoam/Allwmake        |  10 -
 .../solvers/lagrangian/DPMFoam/Allwclean      |   2 +-
 .../solvers/lagrangian/DPMFoam/Allwmake       |   2 +-
 .../icoUncoupledKinematicParcelFoam/Allwmake  |   8 -
 .../lagrangian/reactingParcelFoam/Allwmake    |   9 -
 .../solvers/lagrangian/sprayFoam/Allwmake     |   9 -
 .../multiphase/cavitatingFoam/Allwclean       |   8 -
 .../multiphase/cavitatingFoam/Allwmake        |   8 -
 .../compressibleInterFoam/Allwclean           |   2 +-
 .../multiphase/compressibleInterFoam/Allwmake |   2 +-
 .../compressibleMultiphaseInterFoam/Allwclean |   2 +-
 .../compressibleMultiphaseInterFoam/Allwmake  |   2 +-
 .../multiphase/driftFluxFoam/Allwclean        |   2 +-
 .../solvers/multiphase/driftFluxFoam/Allwmake |   2 +-
 .../solvers/multiphase/interFoam/Allwclean    |  11 -
 .../solvers/multiphase/interFoam/Allwmake     |  11 -
 .../multiphase/interPhaseChangeFoam/Allwclean |   2 +-
 .../multiphase/interPhaseChangeFoam/Allwmake  |   2 +-
 .../multiphase/multiphaseEulerFoam/Allwclean  |   2 +-
 .../multiphase/multiphaseEulerFoam/Allwmake   |   2 +-
 .../multiphase/multiphaseInterFoam/Allwclean  |   2 +-
 .../multiphase/multiphaseInterFoam/Allwmake   |   2 +-
 .../potentialFreeSurfaceFoam/Allwclean        |   8 -
 .../potentialFreeSurfaceFoam/Allwmake         |   8 -
 .../multiphase/twoPhaseEulerFoam/Allwclean    |   2 +-
 .../multiphase/twoPhaseEulerFoam/Allwmake     |   2 +-
 applications/test/fieldMapping/pipe1D/Allrun  |   2 +-
 applications/test/hexRef8/block/Allrun        |   2 +-
 applications/test/volField/cavity/Allrun      |   2 +-
 .../mesh/conversion/Optional/Allwmake         |   2 +-
 .../utilities/mesh/generation/Allwmake        |  14 +-
 .../mesh/generation/extrude/Allwclean         |   8 -
 .../mesh/generation/extrude/Allwmake          |   9 -
 .../mesh/generation/extrude2DMesh/Allwclean   |   2 +-
 .../mesh/generation/extrude2DMesh/Allwmake    |   2 +-
 .../mesh/generation/foamyHexMesh/Allwclean    |   2 +-
 .../mesh/generation/foamyHexMesh/Allwmake     |   2 +-
 .../foamyHexMeshSurfaceSimplify/Allwmake      |   2 +-
 .../mesh/generation/foamyQuadMesh/Allwclean   |   2 +-
 .../mesh/generation/foamyQuadMesh/Allwmake    |   2 +-
 .../mesh/manipulation/renumberMesh/Allwmake   |   4 +-
 .../mesh/manipulation/setSet/Allwmake         |   8 +-
 .../miscellaneous/foamHelp/Allwclean          |   2 +-
 .../utilities/miscellaneous/foamHelp/Allwmake |   2 +-
 .../dataConversion/foamToTecplot360/Allwmake  |   2 +-
 .../graphics/PV3Readers/Allwclean             |   2 +-
 .../graphics/PV3Readers/Allwmake              |   2 +-
 .../PV3Readers/PV3FoamReader/Allwclean        |   2 +-
 .../PV3Readers/PV3FoamReader/Allwmake         |   2 +-
 .../PV3Readers/PV3blockMeshReader/Allwclean   |   2 +-
 .../PV3Readers/PV3blockMeshReader/Allwmake    |   2 +-
 .../graphics/PV4Readers/Allwclean             |   2 +-
 .../graphics/PV4Readers/Allwmake              |   2 +-
 .../PV4Readers/PV4FoamReader/Allwclean        |   2 +-
 .../PV4Readers/PV4FoamReader/Allwmake         |   2 +-
 .../PV4FoamReader/CMakeLists.txt              |   1 +
 .../PV4Readers/PV4blockMeshReader/Allwclean   |   2 +-
 .../PV4Readers/PV4blockMeshReader/Allwmake    |   2 +-
 .../PV4blockMeshReader/CMakeLists.txt         |   1 +
 .../graphics/ensightFoamReader/Allwmake       |   2 +-
 .../preProcessing/wallFunctionTable/Allwmake  |   2 +-
 doc/Allwmake                                  |   2 +-
 doc/Doxygen/Allwmake                          |   2 +-
 src/Allwmake                                  | 113 +++++----
 src/OSspecific/POSIX/Allwmake                 |  17 +-
 src/Pstream/Allwmake                          |  21 +-
 src/TurbulenceModels/Allwmake                 |  13 +-
 src/conversion/Allwmake                       |   9 +-
 src/dummyThirdParty/Allwmake                  |  15 +-
 src/fvAgglomerationMethods/Allwmake           |  39 ++--
 src/lagrangian/Allwmake                       |  27 ++-
 src/lagrangian/molecularDynamics/Allwmake     |  13 +-
 src/mesh/Allwmake                             |  13 +-
 src/parallel/Allwmake                         |  13 +-
 src/parallel/decompose/Allwmake               |  33 +--
 src/parallel/decompose/AllwmakeLnInclude      |   2 +-
 src/parallel/decompose/metisDecomp/Allwmake   |   9 +-
 src/parallel/reconstruct/Allwmake             |   9 +-
 src/postProcessing/Allwmake                   |  11 +-
 src/postProcessing/functionObjects/Allwmake   |  23 +-
 src/regionModels/Allwclean                    |   2 +-
 src/regionModels/Allwmake                     |  19 +-
 src/renumber/Allwmake                         |  13 +-
 src/thermophysicalModels/Allwmake             |  33 +--
 src/thermophysicalModels/properties/Allwmake  |  15 +-
 .../reactionThermo/Make/files                 |   2 +-
 src/transportModels/Allwmake                  |  19 +-
 src/turbulenceModels/Allwmake                 |  15 +-
 src/turbulenceModels/LES/Allwmake             |  11 +-
 src/turbulenceModels/compressible/Allwmake    |  13 +-
 src/turbulenceModels/incompressible/Allwmake  |  13 +-
 wmake/Makefile                                | 127 +++++------
 wmake/MakefileApps                            |  10 +-
 wmake/MakefileFiles                           |  58 +++--
 wmake/MakefileOptions                         |  54 -----
 wmake/makeWmake                               |  16 +-
 wmake/rules/General/bison                     |  14 +-
 wmake/rules/General/btyacc                    |   8 +-
 wmake/rules/General/btyacc++                  |   8 +-
 wmake/rules/General/byacc                     |   8 +-
 wmake/rules/General/coco-cpp                  |   9 +-
 wmake/rules/General/flex                      |   7 +-
 wmake/rules/General/flex++                    |   7 +-
 wmake/rules/General/general                   |   4 +
 wmake/rules/General/moc                       |   7 +-
 wmake/rules/General/mplibGAMMA                |   3 -
 wmake/rules/General/sourceToDep               |  24 --
 wmake/rules/General/standard                  |   8 +-
 wmake/rules/General/transform                 |  15 ++
 wmake/rules/General/version                   |  15 +-
 wmake/rules/General/yacc                      |  14 +-
 wmake/rules/SunOS64Gcc/c                      |  16 --
 wmake/rules/SunOS64Gcc/c++                    |  21 --
 wmake/rules/linux64Clang/c                    |   4 +-
 wmake/rules/linux64Clang/c++                  |   7 +-
 wmake/rules/linux64Gcc++0x/c                  |  16 --
 wmake/rules/linux64Gcc++0x/c++                |  21 --
 wmake/rules/linux64Gcc++0x/c++Debug           |   2 -
 wmake/rules/linux64Gcc++0x/c++Opt             |   3 -
 wmake/rules/linux64Gcc++0x/c++Prof            |   2 -
 wmake/rules/linux64Gcc++0x/cDebug             |   2 -
 wmake/rules/linux64Gcc++0x/cOpt               |   2 -
 wmake/rules/linux64Gcc++0x/cProf              |   2 -
 wmake/rules/linux64Gcc++0x/general            |   8 -
 wmake/rules/linux64Gcc++0x/mplibHPMPI         |   3 -
 wmake/rules/linux64Gcc++0x/mplibINTELMPI      |   3 -
 wmake/rules/linux64Gcc/c                      |   4 +-
 wmake/rules/linux64Gcc/c++                    |   9 +-
 wmake/rules/linux64Gcc43/c++Debug             |   2 -
 wmake/rules/linux64Gcc43/c++Opt               |   4 -
 wmake/rules/linux64Gcc43/c++Prof              |   2 -
 wmake/rules/linux64Gcc43/cDebug               |   2 -
 wmake/rules/linux64Gcc43/cOpt                 |   2 -
 wmake/rules/linux64Gcc43/cProf                |   2 -
 wmake/rules/linux64Gcc43/general              |   8 -
 wmake/rules/linux64Gcc43/mplibHPMPI           |   3 -
 wmake/rules/linux64Gcc43/mplibINTELMPI        |   3 -
 wmake/rules/linux64Gcc44/c                    |  16 --
 wmake/rules/linux64Gcc44/c++                  |  21 --
 wmake/rules/linux64Gcc44/c++Debug             |   2 -
 wmake/rules/linux64Gcc44/c++Opt               |   4 -
 wmake/rules/linux64Gcc44/c++Prof              |   2 -
 wmake/rules/linux64Gcc44/cDebug               |   2 -
 wmake/rules/linux64Gcc44/cOpt                 |   2 -
 wmake/rules/linux64Gcc44/cProf                |   2 -
 wmake/rules/linux64Gcc44/general              |   8 -
 wmake/rules/linux64Gcc44/mplibHPMPI           |   3 -
 wmake/rules/linux64Gcc44/mplibINTELMPI        |   3 -
 wmake/rules/linux64Gcc45/c                    |   4 +-
 wmake/rules/linux64Gcc45/c++                  |   9 +-
 wmake/rules/linux64Gcc46/c                    |   4 +-
 wmake/rules/linux64Gcc46/c++                  |   9 +-
 wmake/rules/linux64Gcc47/c                    |   4 +-
 wmake/rules/linux64Gcc47/c++                  |   9 +-
 wmake/rules/linux64Gcc48/c                    |   4 +-
 wmake/rules/linux64Gcc48/c++                  |   9 +-
 wmake/rules/linux64Gcc49/c                    |   4 +-
 wmake/rules/linux64Gcc49/c++                  |   9 +-
 wmake/rules/linux64Icc/c                      |   4 +-
 wmake/rules/linux64Icc/c++                    |   4 +-
 wmake/rules/linuxARM7Gcc/c                    |   4 +-
 wmake/rules/linuxARM7Gcc/c++                  |   6 +-
 wmake/rules/linuxClang/c                      |   4 +-
 wmake/rules/linuxClang/c++                    |   7 +-
 wmake/rules/linuxGcc/c                        |   4 +-
 wmake/rules/linuxGcc/c++                      |   9 +-
 wmake/rules/linuxGcc43/c                      |  16 --
 wmake/rules/linuxGcc43/c++                    |  21 --
 wmake/rules/linuxGcc43/c++Debug               |   2 -
 wmake/rules/linuxGcc43/c++Opt                 |   2 -
 wmake/rules/linuxGcc43/c++Prof                |   2 -
 wmake/rules/linuxGcc43/cDebug                 |   2 -
 wmake/rules/linuxGcc43/cOpt                   |   2 -
 wmake/rules/linuxGcc43/cProf                  |   2 -
 wmake/rules/linuxGcc43/general                |   9 -
 wmake/rules/linuxGcc43/mplibHPMPI             |   3 -
 wmake/rules/linuxGcc44/c                      |  16 --
 wmake/rules/linuxGcc44/c++                    |  21 --
 wmake/rules/linuxGcc44/c++Debug               |   2 -
 wmake/rules/linuxGcc44/c++Opt                 |   2 -
 wmake/rules/linuxGcc44/c++Prof                |   2 -
 wmake/rules/linuxGcc44/cDebug                 |   2 -
 wmake/rules/linuxGcc44/cOpt                   |   2 -
 wmake/rules/linuxGcc44/cProf                  |   2 -
 wmake/rules/linuxGcc44/general                |   9 -
 wmake/rules/linuxGcc44/mplibHPMPI             |   3 -
 wmake/rules/linuxGcc45/c                      |   4 +-
 wmake/rules/linuxGcc45/c++                    |   9 +-
 wmake/rules/linuxGcc46/c                      |   4 +-
 wmake/rules/linuxGcc46/c++                    |   9 +-
 wmake/rules/linuxGcc47/c                      |   4 +-
 wmake/rules/linuxGcc47/c++                    |   9 +-
 wmake/rules/linuxGcc48/c                      |   4 +-
 wmake/rules/linuxGcc48/c++                    |   9 +-
 wmake/rules/linuxGcc49/c                      |   4 +-
 wmake/rules/linuxGcc49/c++                    |   9 +-
 wmake/rules/linuxIA64Gcc/c                    |   4 +-
 wmake/rules/linuxIA64Gcc/c++                  |   6 +-
 wmake/rules/linuxIA64Icc/c                    |   4 +-
 wmake/rules/linuxIA64Icc/c++                  |   4 +-
 wmake/rules/linuxIcc/c                        |   4 +-
 wmake/rules/linuxIcc/c++                      |   4 +-
 wmake/rules/linuxPPC64Gcc/c                   |   4 +-
 wmake/rules/linuxPPC64Gcc/c++                 |   6 +-
 wmake/rules/{SunOS64Gcc => solaris64Gcc}/X    |   0
 wmake/rules/{linux64Gcc43 => solaris64Gcc}/c  |   4 +-
 .../rules/{linux64Gcc43 => solaris64Gcc}/c++  |   6 +-
 .../{SunOS64Gcc => solaris64Gcc}/c++Debug     |   0
 .../rules/{SunOS64Gcc => solaris64Gcc}/c++Opt |   0
 .../{SunOS64Gcc => solaris64Gcc}/c++Prof      |   0
 .../rules/{SunOS64Gcc => solaris64Gcc}/cDebug |   0
 wmake/rules/{SunOS64Gcc => solaris64Gcc}/cOpt |   0
 .../rules/{SunOS64Gcc => solaris64Gcc}/cProf  |   0
 .../{SunOS64Gcc => solaris64Gcc}/general      |   0
 .../{SunOS64Gcc => solaris64Gcc}/mplibFJMPI   |   0
 wmake/rules/solarisGcc/c                      |   4 +-
 wmake/rules/solarisGcc/c++                    |   6 +-
 wmake/scripts/AllwmakeParseArguments          | 154 +++++++++++++
 wmake/scripts/addCompile                      |  64 ------
 wmake/scripts/makeDerivedFiles                | 133 -----------
 wmake/scripts/makeDir                         |  40 ----
 wmake/src/Makefile                            |   5 +-
 wmake/src/makeParserCode                      |  19 +-
 wmake/src/wmkdep.l                            | 118 +---------
 wmake/wclean                                  |  59 +++--
 wmake/wcleanAll                               |  31 ++-
 wmake/wcleanLnIncludeAll                      |  25 +-
 wmake/wcleanMachine                           |  12 +-
 wmake/wdep                                    | 159 +++++++++++++
 wmake/wmake                                   | 215 +++++++++++-------
 wmake/wmakeCheckPwd                           |  48 ++--
 wmake/wmakeFilesAndOptions                    |  24 +-
 wmake/wmakeFindEmptyMake                      |  87 -------
 wmake/wmakeLnInclude                          |  51 +++--
 wmake/wmakeLnIncludeAll                       |  21 +-
 wmake/wmakePrintBuild                         |  79 ++++---
 wmake/wmakeScheduler                          |  47 ++--
 wmake/wmakeSchedulerUptime                    |  35 +--
 251 files changed, 1464 insertions(+), 1845 deletions(-)
 delete mode 100755 applications/solvers/combustion/reactingFoam/Allwmake
 delete mode 100755 applications/solvers/compressible/rhoPimpleFoam/Allwmake
 delete mode 100755 applications/solvers/compressible/rhoSimpleFoam/Allwclean
 delete mode 100755 applications/solvers/compressible/rhoSimpleFoam/Allwmake
 delete mode 100755 applications/solvers/compressible/sonicFoam/Allwmake
 delete mode 100755 applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean
 delete mode 100755 applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake
 delete mode 100755 applications/solvers/incompressible/pimpleFoam/Allwmake
 delete mode 100755 applications/solvers/incompressible/simpleFoam/Allwmake
 delete mode 100755 applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Allwmake
 delete mode 100755 applications/solvers/lagrangian/reactingParcelFoam/Allwmake
 delete mode 100755 applications/solvers/lagrangian/sprayFoam/Allwmake
 delete mode 100755 applications/solvers/multiphase/cavitatingFoam/Allwclean
 delete mode 100755 applications/solvers/multiphase/cavitatingFoam/Allwmake
 delete mode 100755 applications/solvers/multiphase/interFoam/Allwclean
 delete mode 100755 applications/solvers/multiphase/interFoam/Allwmake
 delete mode 100755 applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwclean
 delete mode 100755 applications/solvers/multiphase/potentialFreeSurfaceFoam/Allwmake
 delete mode 100755 applications/utilities/mesh/generation/extrude/Allwclean
 delete mode 100755 applications/utilities/mesh/generation/extrude/Allwmake
 delete mode 100644 wmake/MakefileOptions
 delete mode 100644 wmake/rules/General/mplibGAMMA
 delete mode 100644 wmake/rules/General/sourceToDep
 create mode 100644 wmake/rules/General/transform
 delete mode 100644 wmake/rules/SunOS64Gcc/c
 delete mode 100644 wmake/rules/SunOS64Gcc/c++
 delete mode 100644 wmake/rules/linux64Gcc++0x/c
 delete mode 100644 wmake/rules/linux64Gcc++0x/c++
 delete mode 100644 wmake/rules/linux64Gcc++0x/c++Debug
 delete mode 100644 wmake/rules/linux64Gcc++0x/c++Opt
 delete mode 100644 wmake/rules/linux64Gcc++0x/c++Prof
 delete mode 100644 wmake/rules/linux64Gcc++0x/cDebug
 delete mode 100644 wmake/rules/linux64Gcc++0x/cOpt
 delete mode 100644 wmake/rules/linux64Gcc++0x/cProf
 delete mode 100644 wmake/rules/linux64Gcc++0x/general
 delete mode 100644 wmake/rules/linux64Gcc++0x/mplibHPMPI
 delete mode 100644 wmake/rules/linux64Gcc++0x/mplibINTELMPI
 delete mode 100644 wmake/rules/linux64Gcc43/c++Debug
 delete mode 100644 wmake/rules/linux64Gcc43/c++Opt
 delete mode 100644 wmake/rules/linux64Gcc43/c++Prof
 delete mode 100644 wmake/rules/linux64Gcc43/cDebug
 delete mode 100644 wmake/rules/linux64Gcc43/cOpt
 delete mode 100644 wmake/rules/linux64Gcc43/cProf
 delete mode 100644 wmake/rules/linux64Gcc43/general
 delete mode 100644 wmake/rules/linux64Gcc43/mplibHPMPI
 delete mode 100644 wmake/rules/linux64Gcc43/mplibINTELMPI
 delete mode 100644 wmake/rules/linux64Gcc44/c
 delete mode 100644 wmake/rules/linux64Gcc44/c++
 delete mode 100644 wmake/rules/linux64Gcc44/c++Debug
 delete mode 100644 wmake/rules/linux64Gcc44/c++Opt
 delete mode 100644 wmake/rules/linux64Gcc44/c++Prof
 delete mode 100644 wmake/rules/linux64Gcc44/cDebug
 delete mode 100644 wmake/rules/linux64Gcc44/cOpt
 delete mode 100644 wmake/rules/linux64Gcc44/cProf
 delete mode 100644 wmake/rules/linux64Gcc44/general
 delete mode 100644 wmake/rules/linux64Gcc44/mplibHPMPI
 delete mode 100644 wmake/rules/linux64Gcc44/mplibINTELMPI
 delete mode 100644 wmake/rules/linuxGcc43/c
 delete mode 100644 wmake/rules/linuxGcc43/c++
 delete mode 100644 wmake/rules/linuxGcc43/c++Debug
 delete mode 100644 wmake/rules/linuxGcc43/c++Opt
 delete mode 100644 wmake/rules/linuxGcc43/c++Prof
 delete mode 100644 wmake/rules/linuxGcc43/cDebug
 delete mode 100644 wmake/rules/linuxGcc43/cOpt
 delete mode 100644 wmake/rules/linuxGcc43/cProf
 delete mode 100644 wmake/rules/linuxGcc43/general
 delete mode 100644 wmake/rules/linuxGcc43/mplibHPMPI
 delete mode 100644 wmake/rules/linuxGcc44/c
 delete mode 100644 wmake/rules/linuxGcc44/c++
 delete mode 100644 wmake/rules/linuxGcc44/c++Debug
 delete mode 100644 wmake/rules/linuxGcc44/c++Opt
 delete mode 100644 wmake/rules/linuxGcc44/c++Prof
 delete mode 100644 wmake/rules/linuxGcc44/cDebug
 delete mode 100644 wmake/rules/linuxGcc44/cOpt
 delete mode 100644 wmake/rules/linuxGcc44/cProf
 delete mode 100644 wmake/rules/linuxGcc44/general
 delete mode 100644 wmake/rules/linuxGcc44/mplibHPMPI
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/X (100%)
 rename wmake/rules/{linux64Gcc43 => solaris64Gcc}/c (77%)
 rename wmake/rules/{linux64Gcc43 => solaris64Gcc}/c++ (82%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/c++Debug (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/c++Opt (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/c++Prof (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/cDebug (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/cOpt (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/cProf (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/general (100%)
 rename wmake/rules/{SunOS64Gcc => solaris64Gcc}/mplibFJMPI (100%)
 create mode 100644 wmake/scripts/AllwmakeParseArguments
 delete mode 100755 wmake/scripts/addCompile
 delete mode 100755 wmake/scripts/makeDerivedFiles
 delete mode 100755 wmake/scripts/makeDir
 create mode 100755 wmake/wdep
 delete mode 100755 wmake/wmakeFindEmptyMake

diff --git a/Allwmake b/Allwmake
index 91875325538..e9e7995414a 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 fe0240d36d4..b6b3bfb9d09 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 7f7ac6718da..f23a233b64e 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 b60b5b62503..00000000000
--- 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 cc5398c04ed..1a0374d96d6 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 33e08e10761..5c4ed20c248 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 1b272c17f07..00000000000
--- 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 a1fd479e127..00000000000
--- 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 dc0fd648f5e..00000000000
--- 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 27c1194eaf6..00000000000
--- 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 c583a8de0a5..00000000000
--- 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 f65ba1181b2..00000000000
--- 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 8727bdb2def..00000000000
--- 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 801fd3b767b..00000000000
--- 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 25d0b2955f1..6d736b2373f 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 6308a7052b2..8a47fb1b346 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 845cebd7776..00000000000
--- 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 f615df216c2..00000000000
--- 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 542509db743..00000000000
--- 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 62548246e9a..00000000000
--- 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 211c1978b2a..00000000000
--- 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 aa0f3c01c6b..9339e372a37 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 a93da26cddb..835bf8346bb 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 8098c051604..7ccfc0d68fd 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 dd002ee0698..04e1ddbb1ff 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 2af62458974..4bb3b9406d2 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 764aef62dbc..ac51afd1d11 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 d91472696f7..00000000000
--- 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 035b0079344..00000000000
--- 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 99c52e59f92..0e33252d5ce 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 414ed904a0f..9a2a5c2bab8 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 f9d9eaad2b4..a75382c13cb 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 bc9227ddcb5..84a99b72001 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 7edca3f5d1c..02819df96f2 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 2a03ac9b6cb..745347676b8 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 f4a6354926a..00000000000
--- 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 38f7587aefa..00000000000
--- 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 86633f63054..8103dc7201b 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 b01ec94acd8..a4a7a60bd4b 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 575c24f73d6..eb6e441abb1 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 2fd3e2c4a76..541ce85b6d4 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 68be2970948..602fbc4f19a 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 25800377a1c..bd253bbe9a1 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 f9861db464d..ca171cb1cf4 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 253b4b4d6d6..00000000000
--- 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 3fd3d2314a9..00000000000
--- 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 44537ed68ba..1f7114a1114 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 6f54612ffe7..a56b144e293 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 696f6c0b650..0fc43eacc3d 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 67770e51c5a..419947964ab 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 98dec66c76b..8d3e3840ef9 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 d0ae53e4150..b147a002b55 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 242939465f4..da5007ab8fa 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 250914574fa..64641c22fd2 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 0d586b6f941..c651ba841fb 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 <readline/readline.h>  --  enabling readline support."
     export COMP_FLAGS="-DHAS_READLINE"
diff --git a/applications/utilities/miscellaneous/foamHelp/Allwclean b/applications/utilities/miscellaneous/foamHelp/Allwclean
index 9dca480e2ec..01d5bfd9f35 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 4724935b92a..2c999bf34b4 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 99e4ccb477a..8ef9158c5de 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 b867e563ff4..ca689294d15 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 3bddd64d800..ae0915f2680 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 c5f41ab9da1..6d052fb73d6 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 c99e05fd6be..93ce993d655 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 d2c85df0011..4ce9a2a07ff 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 4f055b3c0fb..09e76eac497 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 f1171eb61e6..524a715f448 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 aa102b5e6a9..6f6e56b9d8d 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 39520be1ab6..b6ef33f8637 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 dd88afc0298..0728cf9f6ac 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 92494c4f6b9..4c2d5158b78 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 9e3e5a3afae..f735dbbe529 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 645a9177246..a13503094ce 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 9ed8871208d..72003c88154 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 f29cdda2083..e033316861c 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 55a6cbd37fa..c527fdf38fc 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 5d8ed9c5a04..76b8eee2ce6 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 fbc20d93fd0..a349ee4fc17 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 fa091ed845c..925b3f211ec 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 $*
-
-wmake $makeType finiteVolume
-wmake $makeType lagrangian/basic
-wmake $makeType lagrangian/distributionModels
-wmake $makeType genericPatchFields
-
-# Build the proper scotchDecomp, metisDecomp etc.
-parallel/Allwmake $*
-
-renumber/Allwmake $*
-
-wmake $makeType conversion
-
-wmake $makeType sampling
-
-wmake $makeType mesh/extrudeModel
-
-wmake $makeType dynamicMesh
-wmake $makeType dynamicFvMesh
-wmake $makeType topoChangerFvMesh
-
-wmake $makeType ODE
-wmake $makeType randomProcesses
-
-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 $*
+dummyThirdParty/Allwmake $targetType $*
+
+wmake $targetType finiteVolume
+wmake $targetType lagrangian/basic
+wmake $targetType lagrangian/distributionModels
+wmake $targetType genericPatchFields
+
+wmake $targetType conversion
+wmake $targetType sampling
+wmake $targetType mesh/extrudeModel
+wmake $targetType dynamicMesh
+wmake $targetType dynamicFvMesh
+wmake $targetType topoChangerFvMesh
+
+# Compile scotchDecomp, metisDecomp etc.
+parallel/Allwmake $targetType $*
+
+wmake $targetType ODE
+wmake $targetType randomProcesses
+
+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 $targetType fvMotionSolver
+wmake $targetType engine
+wmake $targetType fvOptions
+wmake $targetType regionCoupled
+
+postProcessing/Allwmake $targetType $*
+
+wmake $targetType sixDoFRigidBodyMotion
 
-wmake $makeType sixDoFRigidBodyMotion
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/src/OSspecific/POSIX/Allwmake b/src/OSspecific/POSIX/Allwmake
index 52a54646f06..6cb776136ef 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 <sys/inotify.h> 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 <sys/inotify.h>  --  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 50ccb5fe1d1..0c490c57502 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 84deb51c932..fb0c219f581 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 014885de479..125d78c5e47 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 d747a472dbb..a819e774940 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 4fc3ed60295..f03db10d3f9 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 104d37234d9..1f00dde890b 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 7c17819ad52..2020afcadc4 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 4653b1d3c4d..fef9e5c2bc6 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 ab84e5b749c..97d62f0612e 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 e6d0a1dee57..3aceabafd8d 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 c6a537aa42e..b2ee544686d 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 a97d63a93ba..549e4229b8a 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 85e8e9723a6..4774eed0528 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 3522721c4d3..92daaa49f39 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 178a1a3cfea..535b8281c48 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 f95d816a531..8297b201c05 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 669b701e81d..877c4b00c57 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 d7f72d93beb..ec1acb8320d 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 dbd8310a3bc..2234d5c9aa9 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 f088d140d5f..6ee093bc11a 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 e4e8c49e2b6..879c82bad67 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 07272706a69..1d9598d4365 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 3cba27ed1c3..3a95797baf9 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 6ee54e6c27f..a209819d169 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 6e230c01ff9..ec2033465e9 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 6e230c01ff9..ec2033465e9 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 96e188530f6..38f3f1a7145 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)
-
-jar:     $(LIB).jar
-	     @echo \'$(LIB).jar\' is up to date.
+	@$(WM_SCRIPTS)/makeTargetDir $(LIB)
+	@rm -f $(LIB).o
+	$(LD) -r -o $(LIB).o $(OBJECTS)
 
-$(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 848fbe204fd..20955e788ea 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 472a72e4a06..9f0ed1cf9d2 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 eee4fec8dcf..00000000000
--- 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 <http://www.gnu.org/licenses/>.
-#
-# 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 6c162acc9cc..98b5b55e14d 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<<USAGE
-usage: ${0##*/}
+Usage: $Script
 
   Build platform-specific parts of wmake
 
@@ -53,8 +55,7 @@ echo Build platform-specific parts of wmake
 echo
 (
     set -x
-    cd ${0%/*}/src && make $@
-    # or simply:  make -C ${0%/*}/src $@
+    make -C ${0%/*}/src $@
 )
 echo
 echo ========================================
@@ -62,4 +63,11 @@ echo Done building wmake
 echo ========================================
 echo
 
+
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
+
+unset Script usage
+
 #------------------------------------------------------------------------------
diff --git a/wmake/rules/General/bison b/wmake/rules/General/bison
index dd02dbd7aa3..b741436ad71 100644
--- a/wmake/rules/General/bison
+++ b/wmake/rules/General/bison
@@ -1,11 +1,7 @@
-.SUFFIXES: .y .Y
+SUFFIXES += .y .Y
 
-ytoo = bison -v -d -y $$SOURCE ; mv y.tab.c $*.c ; mv y.tab.h $*.h ; $(cc) $(cFLAGS) -c $*.c -o $@
+ytoo = bison -v -d -y $< ; mv y.tab.c $(@D)/$(<F).c ; mv y.tab.h $(@D)/$(<F).h ; \
+     $(cc) $(cFLAGS) -c  $(@D)/$(<F).c -o $@
 
-Ytoo = bison -v -d -y $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.y.dep:
-	$(MAKE_DEP)
-
-.Y.dep:
-	$(MAKE_DEP)
+Ytoo = bison -v -d -y $< ; mv y.tab.c $(@D)/$(<F).C ; mv y.tab.h $(@D)/$(<F).H ; \
+     $(CC) $(c++FLAGS) -c  $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/btyacc b/wmake/rules/General/btyacc
index aaec4406fd0..44a58c3968c 100644
--- a/wmake/rules/General/btyacc
+++ b/wmake/rules/General/btyacc
@@ -1,6 +1,4 @@
-.SUFFIXES: .y
+SUFFIXES += .y
 
-ytoo = btyacc -v -d $(SKELETON) $$SOURCE ; mv y_tab.c $*.C ; mv y_tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.y.dep:
-	$(MAKE_DEP)
+ytoo = btyacc -v -d $(SKELETON) $< ; mv y_tab.c $(@D)/$(<F).C ; mv y_tab.h $(@D)/$(<F).H ; \
+     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/btyacc++ b/wmake/rules/General/btyacc++
index 0d2bd33ea78..78445585410 100644
--- a/wmake/rules/General/btyacc++
+++ b/wmake/rules/General/btyacc++
@@ -1,6 +1,4 @@
-.SUFFIXES: .Y
+SUFFIXES += .Y
 
-Ytoo = btyacc++ -v -d $(SKELETON) $$SOURCE ; mv y_tab.c $*.C ; mv y_tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.Y.dep:
-	$(MAKE_DEP)
+Ytoo = btyacc++ -v -d $(SKELETON) $< ; mv y_tab.c $(@D)/$(<F).C ; mv y_tab.h $(@D)/$(<F).H ; \
+     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/byacc b/wmake/rules/General/byacc
index e3393ee7ff1..60a9e18f593 100644
--- a/wmake/rules/General/byacc
+++ b/wmake/rules/General/byacc
@@ -1,6 +1,4 @@
-.SUFFIXES: .y
+SUFFIXES += .y
 
-ytoo = byacc -v $(YYPREFIX) -d $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.y.dep:
-	$(MAKE_DEP)
+ytoo = byacc -v $(YYPREFIX) -d $< ; mv y.tab.c $(@D)/$(<F).C ; mv y.tab.h $(@D)/$(<F).H ; \
+     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/coco-cpp b/wmake/rules/General/coco-cpp
index 94264971dcd..009c49e71e5 100644
--- a/wmake/rules/General/coco-cpp
+++ b/wmake/rules/General/coco-cpp
@@ -3,13 +3,10 @@
 #     http://github.com/olesenm/coco-cpp/
 #
 
-.SUFFIXES: .atg
+SUFFIXES += .atg
 
 atgtoo =  \
     $(WM_THIRD_PARTY_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)/coco-cpp/bin/coco-cpp \
     -single \
-    $$SOURCE -o $(OBJECTS_DIR) && \
-    $(CC) $(c++FLAGS) -c $*.cpp -o $@
-
-.atg.dep:
-	$(MAKE_DEP)
+    $< -o $(OBJECTS_DIR) && \
+    $(CC) $(c++FLAGS) -c $(@D)/$(<F).cpp -o $@
diff --git a/wmake/rules/General/flex b/wmake/rules/General/flex
index 853780e1bdf..2b65bb24622 100644
--- a/wmake/rules/General/flex
+++ b/wmake/rules/General/flex
@@ -1,6 +1,3 @@
-.SUFFIXES: .l
+SUFFIXES += .l
 
-ltoo = flex -o$*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@
-
-.l.dep:
-	$(MAKE_DEP)
+ltoo = flex -o $(@D)/$(<F).c $< ; $(cc) $(cFLAGS) -c  $(@D)/$(<F).c -o $@
diff --git a/wmake/rules/General/flex++ b/wmake/rules/General/flex++
index cf829e09bcf..9f06801520d 100644
--- a/wmake/rules/General/flex++
+++ b/wmake/rules/General/flex++
@@ -1,6 +1,3 @@
-.SUFFIXES: .L
+SUFFIXES += .L
 
-Ltoo = flex -+ -o$*.C -f $$SOURCE ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.L.dep:
-	$(MAKE_DEP)
+Ltoo = flex -+ -o$(@D)/$(<F).C -f $< ; $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/general b/wmake/rules/General/general
index d0253e80b31..f9f83f061b5 100644
--- a/wmake/rules/General/general
+++ b/wmake/rules/General/general
@@ -1,3 +1,5 @@
+#-------------------------------*- makefile -*---------------------------------
+
 AR         = ar
 ARFLAGS    = cr
 RANLIB     = ranlib
@@ -8,3 +10,5 @@ GFLAGS     = -D$(WM_ARCH) -DWM_$(WM_PRECISION_OPTION)
 GINC       =
 GLIBS      = -lm
 GLIB_LIBS  =
+
+#------------------------------------------------------------------------------
diff --git a/wmake/rules/General/moc b/wmake/rules/General/moc
index f47f586a3a3..93749733e7f 100644
--- a/wmake/rules/General/moc
+++ b/wmake/rules/General/moc
@@ -1,6 +1,3 @@
-.SUFFIXES: .qt
+SUFFIXES += .qt
 
-qttoo = $(QTDIR)/bin/moc -f $$SOURCE -o $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.qt.dep:
-	$(MAKE_DEP)
+qttoo = $(QTDIR)/bin/moc -f $< -o $(@D)/$(<F).C ; $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/General/mplibGAMMA b/wmake/rules/General/mplibGAMMA
deleted file mode 100644
index 11606f29849..00000000000
--- a/wmake/rules/General/mplibGAMMA
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     =
-PINC       = -I$(MPI_ARCH_PATH)/include
-PLIBS      = -L$(MPI_ARCH_PATH)/lib -lgamma
diff --git a/wmake/rules/General/sourceToDep b/wmake/rules/General/sourceToDep
deleted file mode 100644
index 329e7f409dc..00000000000
--- a/wmake/rules/General/sourceToDep
+++ /dev/null
@@ -1,24 +0,0 @@
-.SUFFIXES: .c .cc .cxx .cpp .C .F .f .dep
-
-MKDEP       = $(WMAKE_BIN)/wmkdep -I$(*D) $(LIB_HEADER_DIRS)
-
-.c.dep:
-	$(MAKE_DEP)
-
-.cc.dep:
-	$(MAKE_DEP)
-
-.cxx.dep:
-	$(MAKE_DEP)
-
-.cpp.dep:
-	$(MAKE_DEP)
-
-.C.dep:
-	$(MAKE_DEP)
-
-.F.dep:
-	$(MAKE_DEP)
-
-.f.dep:
-	$(MAKE_DEP)
diff --git a/wmake/rules/General/standard b/wmake/rules/General/standard
index d3e977df09f..3a51d72260a 100644
--- a/wmake/rules/General/standard
+++ b/wmake/rules/General/standard
@@ -1,7 +1,8 @@
-include $(GENERAL_RULES)/version
+#-------------------------------*- makefile -*---------------------------------
 
-include $(GENERAL_RULES)/sourceToDep
+SUFFIXES=
 
+include $(GENERAL_RULES)/version
 include $(GENERAL_RULES)/flex
 include $(GENERAL_RULES)/flex++
 ## include $(GENERAL_RULES)/coco-cpp
@@ -9,5 +10,6 @@ include $(GENERAL_RULES)/flex++
 ## include $(GENERAL_RULES)/btyacc++
 include $(GENERAL_RULES)/bison
 include $(GENERAL_RULES)/moc
-
 include $(GENERAL_RULES)/X
+
+#------------------------------------------------------------------------------
diff --git a/wmake/rules/General/transform b/wmake/rules/General/transform
new file mode 100644
index 00000000000..bffe6055c0c
--- /dev/null
+++ b/wmake/rules/General/transform
@@ -0,0 +1,15 @@
+#-------------------------------*- makefile -*---------------------------------
+
+define DEFINE_TRANSFORM
+$(OBJECTS_DIR)/%.o : %$1
+	$$($(subst .,,$(1))too)
+endef
+
+$(foreach s,$(SUFFIXES),$(eval $(call DEFINE_TRANSFORM,$(s))))
+
+$(OBJECTS_DIR)/%.dep : %
+	@$(WM_SCRIPTS)/makeTargetDir $@
+	@$(WMAKE_BIN)/wmkdep -I$(*D) $(LIB_HEADER_DIRS) $< | \
+	    sed 's,$(WM_PROJECT_DIR),$$(WM_PROJECT_DIR),' > $@
+
+#------------------------------------------------------------------------------
diff --git a/wmake/rules/General/version b/wmake/rules/General/version
index 19633ffc9dc..ffd070d0be8 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)/$(<F).C; \
+    $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
 
-.Cver.dep:
-	$(MAKE_DEP)
+#------------------------------------------------------------------------------
diff --git a/wmake/rules/General/yacc b/wmake/rules/General/yacc
index 959d4297374..d583a63f06d 100644
--- a/wmake/rules/General/yacc
+++ b/wmake/rules/General/yacc
@@ -1,11 +1,7 @@
-.SUFFIXES: .y .Y
+SUFFIXES += .y .Y
 
-ytoo = yacc -v -d $$SOURCE ; mv y.tab.c $*.c ; mv y.tab.h $(@D)/parser.h ; $(CC) $(c++FLAGS) -c $*.c -o $@
+ytoo = yacc -v -d $< ; mv y.tab.c $(@D)/$(<F).c ; mv y.tab.h $(@D)/parser.h ; \
+     $(CC) $(c++FLAGS) -c $(@D)/$(<F).c -o $@
 
-Ytoo = yacc -v -d $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $(@D)/parser.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.y.dep:
-	$(MAKE_DEP)
-
-.Y.dep:
-	$(MAKE_DEP)
+Ytoo = yacc -v -d $< ; mv y.tab.c $(@D)/$(<F).C ; mv y.tab.h $(@D)/parser.H ; \
+     $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@
diff --git a/wmake/rules/SunOS64Gcc/c b/wmake/rules/SunOS64Gcc/c
deleted file mode 100644
index f4114be3143..00000000000
--- a/wmake/rules/SunOS64Gcc/c
+++ /dev/null
@@ -1,16 +0,0 @@
-.SUFFIXES: .c .h
-
-cWARN        = -Wall
-
-cc          = gcc -m64
-
-include $(RULES)/c$(WM_COMPILE_OPTION)
-
-cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
-
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
-
-LINK_LIBS   = $(cDBUG)
-
-LINKLIBSO   = $(cc) -shared
-LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/SunOS64Gcc/c++ b/wmake/rules/SunOS64Gcc/c++
deleted file mode 100644
index 3ca193e296d..00000000000
--- a/wmake/rules/SunOS64Gcc/c++
+++ /dev/null
@@ -1,21 +0,0 @@
-.SUFFIXES: .C .cxx .cc .cpp
-
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
-
-CC          = g++ -m64
-
-include $(RULES)/c++$(WM_COMPILE_OPTION)
-
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
-c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
-
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
-cxxtoo      = $(Ctoo)
-cctoo       = $(Ctoo)
-cpptoo      = $(Ctoo)
-
-LINK_LIBS   = $(c++DBUG)
-
-LINKLIBSO   = $(CC) $(c++FLAGS) -shared
-LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed
diff --git a/wmake/rules/linux64Clang/c b/wmake/rules/linux64Clang/c
index 7d7d4f61a1b..e882186177c 100644
--- a/wmake/rules/linux64Clang/c
+++ b/wmake/rules/linux64Clang/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Clang/c++ b/wmake/rules/linux64Clang/c++
index 1a0343b5cfc..1d6d2b041c5 100644
--- a/wmake/rules/linux64Clang/c++
+++ b/wmake/rules/linux64Clang/c++
@@ -1,8 +1,7 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
 # -Woverloaded-virtual may produce spurious warnings, disable for now
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-unused-comparison
-
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-unused-comparison -Wno-invalid-offsetof
 
 # Suppress CGAL warnings
 c++CGALWARN = -Wno-c++11-extensions -Wno-sometimes-uninitialized -Wno-mismatched-tags
@@ -15,7 +14,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Gcc++0x/c b/wmake/rules/linux64Gcc++0x/c
deleted file mode 100644
index f4114be3143..00000000000
--- a/wmake/rules/linux64Gcc++0x/c
+++ /dev/null
@@ -1,16 +0,0 @@
-.SUFFIXES: .c .h
-
-cWARN        = -Wall
-
-cc          = gcc -m64
-
-include $(RULES)/c$(WM_COMPILE_OPTION)
-
-cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
-
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
-
-LINK_LIBS   = $(cDBUG)
-
-LINKLIBSO   = $(cc) -shared
-LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/linux64Gcc++0x/c++ b/wmake/rules/linux64Gcc++0x/c++
deleted file mode 100644
index ff7cf481fdc..00000000000
--- a/wmake/rules/linux64Gcc++0x/c++
+++ /dev/null
@@ -1,21 +0,0 @@
-.SUFFIXES: .C .cxx .cc .cpp
-
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor
-
-CC          = g++ -m64 -std=c++0x
-
-include $(RULES)/c++$(WM_COMPILE_OPTION)
-
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
-c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
-
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
-cxxtoo      = $(Ctoo)
-cctoo       = $(Ctoo)
-cpptoo      = $(Ctoo)
-
-LINK_LIBS   = $(c++DBUG)
-
-LINKLIBSO   = $(CC) $(c++FLAGS) -shared
-LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed
diff --git a/wmake/rules/linux64Gcc++0x/c++Debug b/wmake/rules/linux64Gcc++0x/c++Debug
deleted file mode 100644
index 19bdb9c3346..00000000000
--- a/wmake/rules/linux64Gcc++0x/c++Debug
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -ggdb3 -DFULLDEBUG
-c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linux64Gcc++0x/c++Opt b/wmake/rules/linux64Gcc++0x/c++Opt
deleted file mode 100644
index 3363be80905..00000000000
--- a/wmake/rules/linux64Gcc++0x/c++Opt
+++ /dev/null
@@ -1,3 +0,0 @@
-#c++DBUG     = -O0 -DFULLDEBUG -g
-c++DBUG     =
-c++OPT      = -O3
diff --git a/wmake/rules/linux64Gcc++0x/c++Prof b/wmake/rules/linux64Gcc++0x/c++Prof
deleted file mode 100644
index 3bda4dad55e..00000000000
--- a/wmake/rules/linux64Gcc++0x/c++Prof
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -pg
-c++OPT     = -O2
diff --git a/wmake/rules/linux64Gcc++0x/cDebug b/wmake/rules/linux64Gcc++0x/cDebug
deleted file mode 100644
index 72b638f4582..00000000000
--- a/wmake/rules/linux64Gcc++0x/cDebug
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -ggdb -DFULLDEBUG
-cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linux64Gcc++0x/cOpt b/wmake/rules/linux64Gcc++0x/cOpt
deleted file mode 100644
index 17318709f1f..00000000000
--- a/wmake/rules/linux64Gcc++0x/cOpt
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       =
-cOPT        = -O3
diff --git a/wmake/rules/linux64Gcc++0x/cProf b/wmake/rules/linux64Gcc++0x/cProf
deleted file mode 100644
index ca3ac9bf5f0..00000000000
--- a/wmake/rules/linux64Gcc++0x/cProf
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -pg
-cOPT        = -O2
diff --git a/wmake/rules/linux64Gcc++0x/general b/wmake/rules/linux64Gcc++0x/general
deleted file mode 100644
index 243cb7d8c76..00000000000
--- a/wmake/rules/linux64Gcc++0x/general
+++ /dev/null
@@ -1,8 +0,0 @@
-CPP        = cpp -traditional-cpp $(GFLAGS)
-
-PROJECT_LIBS = -l$(WM_PROJECT) -ldl
-
-include $(GENERAL_RULES)/standard
-
-include $(RULES)/c
-include $(RULES)/c++
diff --git a/wmake/rules/linux64Gcc++0x/mplibHPMPI b/wmake/rules/linux64Gcc++0x/mplibHPMPI
deleted file mode 100644
index 574492a236a..00000000000
--- a/wmake/rules/linux64Gcc++0x/mplibHPMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     =
-PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
-PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi
diff --git a/wmake/rules/linux64Gcc++0x/mplibINTELMPI b/wmake/rules/linux64Gcc++0x/mplibINTELMPI
deleted file mode 100644
index cf80ec2eaf6..00000000000
--- a/wmake/rules/linux64Gcc++0x/mplibINTELMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     = -DMPICH_SKIP_MPICXX
-PINC       = -I$(MPI_ARCH_PATH)/include64
-PLIBS      = -L$(MPI_ARCH_PATH)/lib64 -lmpi
diff --git a/wmake/rules/linux64Gcc/c b/wmake/rules/linux64Gcc/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc/c
+++ b/wmake/rules/linux64Gcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++
index 3dfb0333603..a23dd820efe 100644
--- a/wmake/rules/linux64Gcc/c++
+++ b/wmake/rules/linux64Gcc/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m64
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Gcc43/c++Debug b/wmake/rules/linux64Gcc43/c++Debug
deleted file mode 100644
index 19bdb9c3346..00000000000
--- a/wmake/rules/linux64Gcc43/c++Debug
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -ggdb3 -DFULLDEBUG
-c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linux64Gcc43/c++Opt b/wmake/rules/linux64Gcc43/c++Opt
deleted file mode 100644
index 3446f7f58cb..00000000000
--- a/wmake/rules/linux64Gcc43/c++Opt
+++ /dev/null
@@ -1,4 +0,0 @@
-c++DBUG     =
-c++OPT      = -O3
-#c++OPT      = -march=nocona -O3
-# -ftree-vectorize -ftree-vectorizer-verbose=3
diff --git a/wmake/rules/linux64Gcc43/c++Prof b/wmake/rules/linux64Gcc43/c++Prof
deleted file mode 100644
index 3bda4dad55e..00000000000
--- a/wmake/rules/linux64Gcc43/c++Prof
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -pg
-c++OPT     = -O2
diff --git a/wmake/rules/linux64Gcc43/cDebug b/wmake/rules/linux64Gcc43/cDebug
deleted file mode 100644
index 72b638f4582..00000000000
--- a/wmake/rules/linux64Gcc43/cDebug
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -ggdb -DFULLDEBUG
-cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linux64Gcc43/cOpt b/wmake/rules/linux64Gcc43/cOpt
deleted file mode 100644
index 17318709f1f..00000000000
--- a/wmake/rules/linux64Gcc43/cOpt
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       =
-cOPT        = -O3
diff --git a/wmake/rules/linux64Gcc43/cProf b/wmake/rules/linux64Gcc43/cProf
deleted file mode 100644
index ca3ac9bf5f0..00000000000
--- a/wmake/rules/linux64Gcc43/cProf
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -pg
-cOPT        = -O2
diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general
deleted file mode 100644
index 243cb7d8c76..00000000000
--- a/wmake/rules/linux64Gcc43/general
+++ /dev/null
@@ -1,8 +0,0 @@
-CPP        = cpp -traditional-cpp $(GFLAGS)
-
-PROJECT_LIBS = -l$(WM_PROJECT) -ldl
-
-include $(GENERAL_RULES)/standard
-
-include $(RULES)/c
-include $(RULES)/c++
diff --git a/wmake/rules/linux64Gcc43/mplibHPMPI b/wmake/rules/linux64Gcc43/mplibHPMPI
deleted file mode 100644
index 574492a236a..00000000000
--- a/wmake/rules/linux64Gcc43/mplibHPMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     =
-PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
-PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi
diff --git a/wmake/rules/linux64Gcc43/mplibINTELMPI b/wmake/rules/linux64Gcc43/mplibINTELMPI
deleted file mode 100644
index cf80ec2eaf6..00000000000
--- a/wmake/rules/linux64Gcc43/mplibINTELMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     = -DMPICH_SKIP_MPICXX
-PINC       = -I$(MPI_ARCH_PATH)/include64
-PLIBS      = -L$(MPI_ARCH_PATH)/lib64 -lmpi
diff --git a/wmake/rules/linux64Gcc44/c b/wmake/rules/linux64Gcc44/c
deleted file mode 100644
index f4114be3143..00000000000
--- a/wmake/rules/linux64Gcc44/c
+++ /dev/null
@@ -1,16 +0,0 @@
-.SUFFIXES: .c .h
-
-cWARN        = -Wall
-
-cc          = gcc -m64
-
-include $(RULES)/c$(WM_COMPILE_OPTION)
-
-cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
-
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
-
-LINK_LIBS   = $(cDBUG)
-
-LINKLIBSO   = $(cc) -shared
-LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/linux64Gcc44/c++ b/wmake/rules/linux64Gcc44/c++
deleted file mode 100644
index 3ca193e296d..00000000000
--- a/wmake/rules/linux64Gcc44/c++
+++ /dev/null
@@ -1,21 +0,0 @@
-.SUFFIXES: .C .cxx .cc .cpp
-
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
-
-CC          = g++ -m64
-
-include $(RULES)/c++$(WM_COMPILE_OPTION)
-
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
-c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
-
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
-cxxtoo      = $(Ctoo)
-cctoo       = $(Ctoo)
-cpptoo      = $(Ctoo)
-
-LINK_LIBS   = $(c++DBUG)
-
-LINKLIBSO   = $(CC) $(c++FLAGS) -shared
-LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed
diff --git a/wmake/rules/linux64Gcc44/c++Debug b/wmake/rules/linux64Gcc44/c++Debug
deleted file mode 100644
index 19bdb9c3346..00000000000
--- a/wmake/rules/linux64Gcc44/c++Debug
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -ggdb3 -DFULLDEBUG
-c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linux64Gcc44/c++Opt b/wmake/rules/linux64Gcc44/c++Opt
deleted file mode 100644
index 3446f7f58cb..00000000000
--- a/wmake/rules/linux64Gcc44/c++Opt
+++ /dev/null
@@ -1,4 +0,0 @@
-c++DBUG     =
-c++OPT      = -O3
-#c++OPT      = -march=nocona -O3
-# -ftree-vectorize -ftree-vectorizer-verbose=3
diff --git a/wmake/rules/linux64Gcc44/c++Prof b/wmake/rules/linux64Gcc44/c++Prof
deleted file mode 100644
index 3bda4dad55e..00000000000
--- a/wmake/rules/linux64Gcc44/c++Prof
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -pg
-c++OPT     = -O2
diff --git a/wmake/rules/linux64Gcc44/cDebug b/wmake/rules/linux64Gcc44/cDebug
deleted file mode 100644
index 72b638f4582..00000000000
--- a/wmake/rules/linux64Gcc44/cDebug
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -ggdb -DFULLDEBUG
-cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linux64Gcc44/cOpt b/wmake/rules/linux64Gcc44/cOpt
deleted file mode 100644
index 17318709f1f..00000000000
--- a/wmake/rules/linux64Gcc44/cOpt
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       =
-cOPT        = -O3
diff --git a/wmake/rules/linux64Gcc44/cProf b/wmake/rules/linux64Gcc44/cProf
deleted file mode 100644
index ca3ac9bf5f0..00000000000
--- a/wmake/rules/linux64Gcc44/cProf
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -pg
-cOPT        = -O2
diff --git a/wmake/rules/linux64Gcc44/general b/wmake/rules/linux64Gcc44/general
deleted file mode 100644
index 243cb7d8c76..00000000000
--- a/wmake/rules/linux64Gcc44/general
+++ /dev/null
@@ -1,8 +0,0 @@
-CPP        = cpp -traditional-cpp $(GFLAGS)
-
-PROJECT_LIBS = -l$(WM_PROJECT) -ldl
-
-include $(GENERAL_RULES)/standard
-
-include $(RULES)/c
-include $(RULES)/c++
diff --git a/wmake/rules/linux64Gcc44/mplibHPMPI b/wmake/rules/linux64Gcc44/mplibHPMPI
deleted file mode 100644
index 574492a236a..00000000000
--- a/wmake/rules/linux64Gcc44/mplibHPMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     =
-PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
-PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi
diff --git a/wmake/rules/linux64Gcc44/mplibINTELMPI b/wmake/rules/linux64Gcc44/mplibINTELMPI
deleted file mode 100644
index cf80ec2eaf6..00000000000
--- a/wmake/rules/linux64Gcc44/mplibINTELMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     = -DMPICH_SKIP_MPICXX
-PINC       = -I$(MPI_ARCH_PATH)/include64
-PLIBS      = -L$(MPI_ARCH_PATH)/lib64 -lmpi
diff --git a/wmake/rules/linux64Gcc45/c b/wmake/rules/linux64Gcc45/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc45/c
+++ b/wmake/rules/linux64Gcc45/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc45/c++ b/wmake/rules/linux64Gcc45/c++
index 98b25ed1fea..a23dd820efe 100644
--- a/wmake/rules/linux64Gcc45/c++
+++ b/wmake/rules/linux64Gcc45/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m64
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Gcc46/c b/wmake/rules/linux64Gcc46/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc46/c
+++ b/wmake/rules/linux64Gcc46/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc46/c++ b/wmake/rules/linux64Gcc46/c++
index 98b25ed1fea..a23dd820efe 100644
--- a/wmake/rules/linux64Gcc46/c++
+++ b/wmake/rules/linux64Gcc46/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m64
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Gcc47/c b/wmake/rules/linux64Gcc47/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc47/c
+++ b/wmake/rules/linux64Gcc47/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc47/c++ b/wmake/rules/linux64Gcc47/c++
index 98b25ed1fea..a23dd820efe 100644
--- a/wmake/rules/linux64Gcc47/c++
+++ b/wmake/rules/linux64Gcc47/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m64
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Gcc48/c b/wmake/rules/linux64Gcc48/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc48/c
+++ b/wmake/rules/linux64Gcc48/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc48/c++ b/wmake/rules/linux64Gcc48/c++
index 98b25ed1fea..a23dd820efe 100644
--- a/wmake/rules/linux64Gcc48/c++
+++ b/wmake/rules/linux64Gcc48/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m64
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Gcc49/c b/wmake/rules/linux64Gcc49/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc49/c
+++ b/wmake/rules/linux64Gcc49/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc49/c++ b/wmake/rules/linux64Gcc49/c++
index 98b25ed1fea..a23dd820efe 100644
--- a/wmake/rules/linux64Gcc49/c++
+++ b/wmake/rules/linux64Gcc49/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m64
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linux64Icc/c b/wmake/rules/linux64Icc/c
index 1085d50498d..97da5c28f0a 100644
--- a/wmake/rules/linux64Icc/c
+++ b/wmake/rules/linux64Icc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        =
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG) -L$(IA32ROOT)/lib
 
diff --git a/wmake/rules/linux64Icc/c++ b/wmake/rules/linux64Icc/c++
index 51cb6a389ce..eb8edb90b68 100644
--- a/wmake/rules/linux64Icc/c++
+++ b/wmake/rules/linux64Icc/c++
@@ -1,4 +1,4 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
 c++WARN     = -wd327,525,654,819,1125,1476,1505,1572
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxARM7Gcc/c b/wmake/rules/linuxARM7Gcc/c
index 5be3206f843..d7bda5d1df8 100644
--- a/wmake/rules/linuxARM7Gcc/c
+++ b/wmake/rules/linuxARM7Gcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxARM7Gcc/c++ b/wmake/rules/linuxARM7Gcc/c++
index 10d6b9cb330..408abf76656 100644
--- a/wmake/rules/linuxARM7Gcc/c++
+++ b/wmake/rules/linuxARM7Gcc/c++
@@ -1,6 +1,6 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-invalid-offsetof
 
 CC          = g++
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxClang/c b/wmake/rules/linuxClang/c
index 99b3238306b..7d67b4c0223 100644
--- a/wmake/rules/linuxClang/c
+++ b/wmake/rules/linuxClang/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxClang/c++ b/wmake/rules/linuxClang/c++
index 49849377a62..cf374579081 100644
--- a/wmake/rules/linuxClang/c++
+++ b/wmake/rules/linuxClang/c++
@@ -1,8 +1,7 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
 # -Woverloaded-virtual may produce spurious warnings, disable for now
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-unused-comparison
-
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-unused-comparison -Wno-invalid-offsetof
 
 # Suppress CGAL warnings
 c++CGALWARN = -Wno-c++11-extensions -Wno-sometimes-uninitialized -Wno-mismatched-tags
@@ -15,7 +14,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxGcc/c b/wmake/rules/linuxGcc/c
index d914fcd37d0..81c64cf710b 100644
--- a/wmake/rules/linuxGcc/c
+++ b/wmake/rules/linuxGcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxGcc/c++ b/wmake/rules/linuxGcc/c++
index 357f4106e10..b00d78f9848 100644
--- a/wmake/rules/linuxGcc/c++
+++ b/wmake/rules/linuxGcc/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m32
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxGcc43/c b/wmake/rules/linuxGcc43/c
deleted file mode 100644
index d914fcd37d0..00000000000
--- a/wmake/rules/linuxGcc43/c
+++ /dev/null
@@ -1,16 +0,0 @@
-.SUFFIXES: .c .h
-
-cWARN        = -Wall
-
-cc          = gcc -m32
-
-include $(RULES)/c$(WM_COMPILE_OPTION)
-
-cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
-
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
-
-LINK_LIBS   = $(cDBUG)
-
-LINKLIBSO   = $(cc) -shared
-LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/linuxGcc43/c++ b/wmake/rules/linuxGcc43/c++
deleted file mode 100644
index e862181fc5c..00000000000
--- a/wmake/rules/linuxGcc43/c++
+++ /dev/null
@@ -1,21 +0,0 @@
-.SUFFIXES: .C .cxx .cc .cpp
-
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
-
-CC          = g++ -m32
-
-include $(RULES)/c++$(WM_COMPILE_OPTION)
-
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
-c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
-
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
-cxxtoo      = $(Ctoo)
-cctoo       = $(Ctoo)
-cpptoo      = $(Ctoo)
-
-LINK_LIBS   = $(c++DBUG)
-
-LINKLIBSO   = $(CC) $(c++FLAGS) -shared
-LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed
diff --git a/wmake/rules/linuxGcc43/c++Debug b/wmake/rules/linuxGcc43/c++Debug
deleted file mode 100644
index 19bdb9c3346..00000000000
--- a/wmake/rules/linuxGcc43/c++Debug
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -ggdb3 -DFULLDEBUG
-c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linuxGcc43/c++Opt b/wmake/rules/linuxGcc43/c++Opt
deleted file mode 100644
index 2aedabd6280..00000000000
--- a/wmake/rules/linuxGcc43/c++Opt
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG     =
-c++OPT      = -O3
diff --git a/wmake/rules/linuxGcc43/c++Prof b/wmake/rules/linuxGcc43/c++Prof
deleted file mode 100644
index 3bda4dad55e..00000000000
--- a/wmake/rules/linuxGcc43/c++Prof
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -pg
-c++OPT     = -O2
diff --git a/wmake/rules/linuxGcc43/cDebug b/wmake/rules/linuxGcc43/cDebug
deleted file mode 100644
index 72b638f4582..00000000000
--- a/wmake/rules/linuxGcc43/cDebug
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -ggdb -DFULLDEBUG
-cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linuxGcc43/cOpt b/wmake/rules/linuxGcc43/cOpt
deleted file mode 100644
index 17318709f1f..00000000000
--- a/wmake/rules/linuxGcc43/cOpt
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       =
-cOPT        = -O3
diff --git a/wmake/rules/linuxGcc43/cProf b/wmake/rules/linuxGcc43/cProf
deleted file mode 100644
index ca3ac9bf5f0..00000000000
--- a/wmake/rules/linuxGcc43/cProf
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -pg
-cOPT        = -O2
diff --git a/wmake/rules/linuxGcc43/general b/wmake/rules/linuxGcc43/general
deleted file mode 100644
index fa1eb5b925f..00000000000
--- a/wmake/rules/linuxGcc43/general
+++ /dev/null
@@ -1,9 +0,0 @@
-CPP        = cpp -traditional-cpp $(GFLAGS)
-LD         = ld -melf_i386
-
-PROJECT_LIBS = -l$(WM_PROJECT) -ldl
-
-include $(GENERAL_RULES)/standard
-
-include $(RULES)/c
-include $(RULES)/c++
diff --git a/wmake/rules/linuxGcc43/mplibHPMPI b/wmake/rules/linuxGcc43/mplibHPMPI
deleted file mode 100644
index 8aff40632bd..00000000000
--- a/wmake/rules/linuxGcc43/mplibHPMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     =
-PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
-PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_ia32 -lmpi
diff --git a/wmake/rules/linuxGcc44/c b/wmake/rules/linuxGcc44/c
deleted file mode 100644
index d914fcd37d0..00000000000
--- a/wmake/rules/linuxGcc44/c
+++ /dev/null
@@ -1,16 +0,0 @@
-.SUFFIXES: .c .h
-
-cWARN        = -Wall
-
-cc          = gcc -m32
-
-include $(RULES)/c$(WM_COMPILE_OPTION)
-
-cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
-
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
-
-LINK_LIBS   = $(cDBUG)
-
-LINKLIBSO   = $(cc) -shared
-LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/linuxGcc44/c++ b/wmake/rules/linuxGcc44/c++
deleted file mode 100644
index e862181fc5c..00000000000
--- a/wmake/rules/linuxGcc44/c++
+++ /dev/null
@@ -1,21 +0,0 @@
-.SUFFIXES: .C .cxx .cc .cpp
-
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
-
-CC          = g++ -m32
-
-include $(RULES)/c++$(WM_COMPILE_OPTION)
-
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
-c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
-
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
-cxxtoo      = $(Ctoo)
-cctoo       = $(Ctoo)
-cpptoo      = $(Ctoo)
-
-LINK_LIBS   = $(c++DBUG)
-
-LINKLIBSO   = $(CC) $(c++FLAGS) -shared
-LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed
diff --git a/wmake/rules/linuxGcc44/c++Debug b/wmake/rules/linuxGcc44/c++Debug
deleted file mode 100644
index 19bdb9c3346..00000000000
--- a/wmake/rules/linuxGcc44/c++Debug
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -ggdb3 -DFULLDEBUG
-c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linuxGcc44/c++Opt b/wmake/rules/linuxGcc44/c++Opt
deleted file mode 100644
index 2aedabd6280..00000000000
--- a/wmake/rules/linuxGcc44/c++Opt
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG     =
-c++OPT      = -O3
diff --git a/wmake/rules/linuxGcc44/c++Prof b/wmake/rules/linuxGcc44/c++Prof
deleted file mode 100644
index 3bda4dad55e..00000000000
--- a/wmake/rules/linuxGcc44/c++Prof
+++ /dev/null
@@ -1,2 +0,0 @@
-c++DBUG    = -pg
-c++OPT     = -O2
diff --git a/wmake/rules/linuxGcc44/cDebug b/wmake/rules/linuxGcc44/cDebug
deleted file mode 100644
index 72b638f4582..00000000000
--- a/wmake/rules/linuxGcc44/cDebug
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -ggdb -DFULLDEBUG
-cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linuxGcc44/cOpt b/wmake/rules/linuxGcc44/cOpt
deleted file mode 100644
index 17318709f1f..00000000000
--- a/wmake/rules/linuxGcc44/cOpt
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       =
-cOPT        = -O3
diff --git a/wmake/rules/linuxGcc44/cProf b/wmake/rules/linuxGcc44/cProf
deleted file mode 100644
index ca3ac9bf5f0..00000000000
--- a/wmake/rules/linuxGcc44/cProf
+++ /dev/null
@@ -1,2 +0,0 @@
-cDBUG       = -pg
-cOPT        = -O2
diff --git a/wmake/rules/linuxGcc44/general b/wmake/rules/linuxGcc44/general
deleted file mode 100644
index fa1eb5b925f..00000000000
--- a/wmake/rules/linuxGcc44/general
+++ /dev/null
@@ -1,9 +0,0 @@
-CPP        = cpp -traditional-cpp $(GFLAGS)
-LD         = ld -melf_i386
-
-PROJECT_LIBS = -l$(WM_PROJECT) -ldl
-
-include $(GENERAL_RULES)/standard
-
-include $(RULES)/c
-include $(RULES)/c++
diff --git a/wmake/rules/linuxGcc44/mplibHPMPI b/wmake/rules/linuxGcc44/mplibHPMPI
deleted file mode 100644
index 8aff40632bd..00000000000
--- a/wmake/rules/linuxGcc44/mplibHPMPI
+++ /dev/null
@@ -1,3 +0,0 @@
-PFLAGS     =
-PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
-PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_ia32 -lmpi
diff --git a/wmake/rules/linuxGcc45/c b/wmake/rules/linuxGcc45/c
index d914fcd37d0..81c64cf710b 100644
--- a/wmake/rules/linuxGcc45/c
+++ b/wmake/rules/linuxGcc45/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxGcc45/c++ b/wmake/rules/linuxGcc45/c++
index 357f4106e10..b00d78f9848 100644
--- a/wmake/rules/linuxGcc45/c++
+++ b/wmake/rules/linuxGcc45/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m32
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxGcc46/c b/wmake/rules/linuxGcc46/c
index d914fcd37d0..81c64cf710b 100644
--- a/wmake/rules/linuxGcc46/c
+++ b/wmake/rules/linuxGcc46/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxGcc46/c++ b/wmake/rules/linuxGcc46/c++
index 357f4106e10..b00d78f9848 100644
--- a/wmake/rules/linuxGcc46/c++
+++ b/wmake/rules/linuxGcc46/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m32
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxGcc47/c b/wmake/rules/linuxGcc47/c
index d914fcd37d0..81c64cf710b 100644
--- a/wmake/rules/linuxGcc47/c
+++ b/wmake/rules/linuxGcc47/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxGcc47/c++ b/wmake/rules/linuxGcc47/c++
index 357f4106e10..b00d78f9848 100644
--- a/wmake/rules/linuxGcc47/c++
+++ b/wmake/rules/linuxGcc47/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m32
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxGcc48/c b/wmake/rules/linuxGcc48/c
index d914fcd37d0..81c64cf710b 100644
--- a/wmake/rules/linuxGcc48/c
+++ b/wmake/rules/linuxGcc48/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxGcc48/c++ b/wmake/rules/linuxGcc48/c++
index 357f4106e10..b00d78f9848 100644
--- a/wmake/rules/linuxGcc48/c++
+++ b/wmake/rules/linuxGcc48/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m32
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxGcc49/c b/wmake/rules/linuxGcc49/c
index d914fcd37d0..81c64cf710b 100644
--- a/wmake/rules/linuxGcc49/c
+++ b/wmake/rules/linuxGcc49/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxGcc49/c++ b/wmake/rules/linuxGcc49/c++
index 357f4106e10..b00d78f9848 100644
--- a/wmake/rules/linuxGcc49/c++
+++ b/wmake/rules/linuxGcc49/c++
@@ -1,6 +1,9 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -Wno-invalid-offsetof
+
+# Suppress CGAL warnings
+c++CGALWARN = -Wall -Wextra -Wno-unused-parameter -Wno-old-style-cast -Wnon-virtual-dtor
 
 CC          = g++ -m32
 
@@ -10,7 +13,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxIA64Gcc/c b/wmake/rules/linuxIA64Gcc/c
index 5be3206f843..d7bda5d1df8 100644
--- a/wmake/rules/linuxIA64Gcc/c
+++ b/wmake/rules/linuxIA64Gcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxIA64Gcc/c++ b/wmake/rules/linuxIA64Gcc/c++
index b258455b2c8..1d60843b704 100644
--- a/wmake/rules/linuxIA64Gcc/c++
+++ b/wmake/rules/linuxIA64Gcc/c++
@@ -1,6 +1,6 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-invalid-offsetof
 
 CC          = g++
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxIA64Icc/c b/wmake/rules/linuxIA64Icc/c
index d05b14867e4..3952de58fbd 100644
--- a/wmake/rules/linuxIA64Icc/c
+++ b/wmake/rules/linuxIA64Icc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        =
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG) -L$(IA32ROOT)/lib
 
diff --git a/wmake/rules/linuxIA64Icc/c++ b/wmake/rules/linuxIA64Icc/c++
index 600e980b8b7..646e6c0dca8 100644
--- a/wmake/rules/linuxIA64Icc/c++
+++ b/wmake/rules/linuxIA64Icc/c++
@@ -1,4 +1,4 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
 c++WARN     = -wd327,525,654,819,1125,1476,1505,1572
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxIcc/c b/wmake/rules/linuxIcc/c
index e8059d9dbb7..a6441bcbd06 100644
--- a/wmake/rules/linuxIcc/c
+++ b/wmake/rules/linuxIcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        =
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -KPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG) -L$(IA32ROOT)/lib
 
diff --git a/wmake/rules/linuxIcc/c++ b/wmake/rules/linuxIcc/c++
index 314cd3cd12d..419d41682ba 100644
--- a/wmake/rules/linuxIcc/c++
+++ b/wmake/rules/linuxIcc/c++
@@ -1,4 +1,4 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
 c++WARN     = -wd327,525,654,819,1125,1476,1505,1572
 
@@ -11,7 +11,7 @@ ptFLAGS     = -DNoRepository
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -KPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/linuxPPC64Gcc/c b/wmake/rules/linuxPPC64Gcc/c
index 1269da8e333..1fa057876c1 100644
--- a/wmake/rules/linuxPPC64Gcc/c
+++ b/wmake/rules/linuxPPC64Gcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linuxPPC64Gcc/c++ b/wmake/rules/linuxPPC64Gcc/c++
index b8e735a5bcd..809364deb78 100644
--- a/wmake/rules/linuxPPC64Gcc/c++
+++ b/wmake/rules/linuxPPC64Gcc/c++
@@ -1,6 +1,6 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-invalid-offsetof
 
 CC          = g++ -m64 -mcpu=power5+
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/SunOS64Gcc/X b/wmake/rules/solaris64Gcc/X
similarity index 100%
rename from wmake/rules/SunOS64Gcc/X
rename to wmake/rules/solaris64Gcc/X
diff --git a/wmake/rules/linux64Gcc43/c b/wmake/rules/solaris64Gcc/c
similarity index 77%
rename from wmake/rules/linux64Gcc43/c
rename to wmake/rules/solaris64Gcc/c
index f4114be3143..66435ccf057 100644
--- a/wmake/rules/linux64Gcc43/c
+++ b/wmake/rules/solaris64Gcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/linux64Gcc43/c++ b/wmake/rules/solaris64Gcc/c++
similarity index 82%
rename from wmake/rules/linux64Gcc43/c++
rename to wmake/rules/solaris64Gcc/c++
index 3ca193e296d..33cdad290de 100644
--- a/wmake/rules/linux64Gcc43/c++
+++ b/wmake/rules/solaris64Gcc/c++
@@ -1,6 +1,6 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wno-invalid-offsetof
 
 CC          = g++ -m64
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/rules/SunOS64Gcc/c++Debug b/wmake/rules/solaris64Gcc/c++Debug
similarity index 100%
rename from wmake/rules/SunOS64Gcc/c++Debug
rename to wmake/rules/solaris64Gcc/c++Debug
diff --git a/wmake/rules/SunOS64Gcc/c++Opt b/wmake/rules/solaris64Gcc/c++Opt
similarity index 100%
rename from wmake/rules/SunOS64Gcc/c++Opt
rename to wmake/rules/solaris64Gcc/c++Opt
diff --git a/wmake/rules/SunOS64Gcc/c++Prof b/wmake/rules/solaris64Gcc/c++Prof
similarity index 100%
rename from wmake/rules/SunOS64Gcc/c++Prof
rename to wmake/rules/solaris64Gcc/c++Prof
diff --git a/wmake/rules/SunOS64Gcc/cDebug b/wmake/rules/solaris64Gcc/cDebug
similarity index 100%
rename from wmake/rules/SunOS64Gcc/cDebug
rename to wmake/rules/solaris64Gcc/cDebug
diff --git a/wmake/rules/SunOS64Gcc/cOpt b/wmake/rules/solaris64Gcc/cOpt
similarity index 100%
rename from wmake/rules/SunOS64Gcc/cOpt
rename to wmake/rules/solaris64Gcc/cOpt
diff --git a/wmake/rules/SunOS64Gcc/cProf b/wmake/rules/solaris64Gcc/cProf
similarity index 100%
rename from wmake/rules/SunOS64Gcc/cProf
rename to wmake/rules/solaris64Gcc/cProf
diff --git a/wmake/rules/SunOS64Gcc/general b/wmake/rules/solaris64Gcc/general
similarity index 100%
rename from wmake/rules/SunOS64Gcc/general
rename to wmake/rules/solaris64Gcc/general
diff --git a/wmake/rules/SunOS64Gcc/mplibFJMPI b/wmake/rules/solaris64Gcc/mplibFJMPI
similarity index 100%
rename from wmake/rules/SunOS64Gcc/mplibFJMPI
rename to wmake/rules/solaris64Gcc/mplibFJMPI
diff --git a/wmake/rules/solarisGcc/c b/wmake/rules/solarisGcc/c
index 5be3206f843..d7bda5d1df8 100644
--- a/wmake/rules/solarisGcc/c
+++ b/wmake/rules/solarisGcc/c
@@ -1,4 +1,4 @@
-.SUFFIXES: .c .h
+SUFFIXES += .c
 
 cWARN        = -Wall
 
@@ -8,7 +8,7 @@ include $(RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
 
-ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
 
 LINK_LIBS   = $(cDBUG)
 
diff --git a/wmake/rules/solarisGcc/c++ b/wmake/rules/solarisGcc/c++
index 667b00c8945..4cb29df20f2 100644
--- a/wmake/rules/solarisGcc/c++
+++ b/wmake/rules/solarisGcc/c++
@@ -1,6 +1,6 @@
-.SUFFIXES: .C .cxx .cc .cpp
+SUFFIXES += .C
 
-c++WARN     = -Wall -Wextra -Wno-unused-parameter
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wno-invalid-offsetof
 
 CC          = g++
 
@@ -10,7 +10,7 @@ ptFLAGS     = -DNoRepository -ftemplate-depth-100
 
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
-Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
 cxxtoo      = $(Ctoo)
 cctoo       = $(Ctoo)
 cpptoo      = $(Ctoo)
diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments
new file mode 100644
index 00000000000..dd788dd77fd
--- /dev/null
+++ b/wmake/scripts/AllwmakeParseArguments
@@ -0,0 +1,154 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
+#
+# 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<<USAGE
+
+Usage: $Script [OPTIONS]
+
+options:
+  -h or -help       Print list of Allwmake options
+  -k or -non-stop   Compile without stopping when errors occur
+  -j                Compile using all local cores/hyperthreads
+  -jN or -j N       Compile using N cores/hyperthreads
+  -no-scheduler     Compile without wmakeScheduler
+USAGE
+
+    # Print options for building code documentation
+    test -n "$genDoc" && cat<<USAGE_DOC
+  doc               Compile code documentation (requires Doxygen)
+USAGE_DOC
+
+    # Print options for building libraries
+    test -n "$targetType" && cat<<USAGE_LIB
+  lib               Compile statically linked archive lib (.a)
+  libo              Compile statically linked lib (.o)
+  libso             Compile dynamically linked lib (.so)
+  dep               Compile dependency files
+USAGE_LIB
+
+    exit 1
+}
+
+
+#------------------------------------------------------------------------------
+# Set WM_NCOMPPROCS to number of cores on local machine
+#------------------------------------------------------------------------------
+
+setWM_NCOMPPROCS()
+{
+    if [ -r /proc/cpuinfo ]
+    then
+        WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
+    else
+        WM_NCOMPPROCS=1
+    fi
+
+    export WM_NCOMPPROCS
+}
+
+
+#------------------------------------------------------------------------------
+# Parse the arguments and options
+#------------------------------------------------------------------------------
+
+while [ "$#" -gt 0 ]
+do
+    case "$1" in
+        # Print help
+        -h | -help)
+            usage
+            ;;
+        # Parallel compilation on all cores of local machine
+        -j)
+            setWM_NCOMPPROCS
+            test $# -ge 2 && expr $2 + 1 > /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 63a5b2622d6..00000000000
--- 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 <http://www.gnu.org/licenses/>.
-#
-# Script
-#     addCompile
-#
-# Description
-#     Cleans up the dependency list and add the compilation statement.
-#
-#     Usage: wmkdep <fileName> | addCompile <fileName>
-#
-#------------------------------------------------------------------------------
-
-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 28eaf89fee9..00000000000
--- 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 <http://www.gnu.org/licenses/>.
-#
-# 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 19ab86b7ded..00000000000
--- 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 <http://www.gnu.org/licenses/>.
-#
-# Script
-#     makeDir
-#
-# Description
-#     Script to make directories that do not already exist
-#     Usage : makeDir <dir> [.. <dirN>]
-#
-#------------------------------------------------------------------------------
-
-for dir
-do
-    [ -d "$dir" ] || mkdir -p "$dir"
-done
-
-
-#------------------------------------------------------------------------------
diff --git a/wmake/src/Makefile b/wmake/src/Makefile
index 328f3e53a0d..07b2d435624 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 161d5af41bc..1ddf1576a40 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 3b6973209b5..c9e1d8e67d6 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 */
 <CFNAME>[^"\n ]*        { BEGIN(INITIAL); nextFile(yytext); } /*"*/
 
-^[ \t]*import[ \t]+       BEGIN(JFNAME);  /* java-file name */
-<JFNAME>java.*;           BEGIN(INITIAL);
-<JFNAME>org.*;            BEGIN(INITIAL);
-<JFNAME>com.*;            BEGIN(INITIAL);
-<JFNAME>sunw.*;           BEGIN(INITIAL);
-<JFNAME>sun.*;            BEGIN(INITIAL);
-<JFNAME>launcher.*;       BEGIN(INITIAL);
-<JFNAME>[^"\n*]*;       { BEGIN(INITIAL); importFile(yytext); } /*"*/
-<JFNAME>[^"\n]*\*;      { BEGIN(INITIAL); importDir(yytext); } /*"*/
-
 "      "include[ \t]+\'   BEGIN(FFNAME);  /* FORTRAN-file name */
 <FFNAME>[^']*           { 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 2427511f2f8..28e2621bccb 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
 
-rm -rf $MakeDir/$WM_OPTIONS $MakeDir/classes 2>/dev/null
 
-find . -name "*.dep" -exec rm {} \;
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
 
-# always safe to remove lnInclude
-rm -rf lnInclude 2>/dev/null
+unset Script usage
 
-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 499b95eb32b..a136f7704d4 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<<USAGE
-usage: ${0##*/}
+Usage: $Script
 
-    Remove all object files and *.dep files
+    Remove all object and related files
 
 USAGE
     exit 1
 }
 
-# parse options
+
+#------------------------------------------------------------------------------
+# Parse arguments and options
+#------------------------------------------------------------------------------
+
 while [ "$#" -gt 0 ]
 do
     case "$1" in
@@ -61,20 +67,25 @@ done
 echo "Removing platforms/ subdirectores"
 rm -rf platforms/*
 
-echo "Removing *.dep files"
-find . -name '*.dep' -exec rm {} \;
-
 echo "Cleaning Make subdirectories"
 find . -depth \( -name Make -o -name "Make.[A-Za-z]*" \) -type d -print | \
     xargs -i find '{}' -mindepth 1 -maxdepth 1 -type d -print | \
     xargs rm -rf
 
-echo "Removing lnInclude and intermediate directories"
-find . -depth -type d \( -name lnInclude -o -name ii_files -o -name Templates.DB \) -exec rm -rf {} \;
+echo "Removing lnInclude directories"
+find . -depth -type d \( -name lnInclude \) -exec rm -rf {} \;
 
 echo "Removing misc files"
-find . \( -name exe -o -name log -o -name so_locations \) -exec rm {} \;
+find . \( -name exe -o -name log \) -exec rm {} \;
 
 tutorials/Allclean
 
+
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
+
+unset Script usage
+
+
 #------------------------------------------------------------------------------
diff --git a/wmake/wcleanLnIncludeAll b/wmake/wcleanLnIncludeAll
index 06707e8bf6d..09eb1f6861e 100755
--- a/wmake/wcleanLnIncludeAll
+++ b/wmake/wcleanLnIncludeAll
@@ -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,14 +29,15 @@
 #     Delete all the lnInclude directories in the tree.
 #
 #------------------------------------------------------------------------------
+Script=${0##*/}
 
-# default is pwd
+# Default to the CWD
 if [ "$#" -eq 0 ]
 then
     set -- .
 elif [ "$1" = "-h" -o "$1" = "-help" ]
 then
-    echo "Usage: ${0##*/} [dir1] .. [dirN]"
+    echo "Usage: $Script [dir1] .. [dirN]"
     echo
     echo "    Delete all the lnInclude directories in the tree"
     echo
@@ -44,15 +45,23 @@ then
 fi
 
 
-for i
+for dir
 do
-    if [ -d "$i" ]
+    if [ -d "$dir" ]
     then
-        echo "removing lnInclude directories: $i"
-        find $i -depth -type d -name lnInclude -exec rm -rf {} \;
+        echo "removing lnInclude directories: $dir"
+        find $dir -depth -type d -name lnInclude -exec rm -rf {} \;
     else
-        echo "no directory: $i" 1>&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 7981a55cbd5..1079b734a3f 100755
--- a/wmake/wcleanMachine
+++ b/wmake/wcleanMachine
@@ -34,11 +34,13 @@
 #            wcleanMachine <machineType> [ .. <machineTypeN> ]
 #
 #------------------------------------------------------------------------------
+Script=${0##*/}
+
 usage() {
     exec 1>&2
     while [ "$#" -ge 1 ]; do echo "$1"; shift; done
     cat<<USAGE
-Usage: ${0##*/} machineType [... machineTypeN] [ -current ]
+Usage: $Script machineType [... machineTypeN] [ -current ]
 
   Searches the directory tree starting at the current directory for the
   object file directories of the specified machine type(s) and deletes them.
@@ -85,4 +87,12 @@ do
 
 done
 
+
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
+
+unset Script machines
+
+
 #------------------------------------------------------------------------------
diff --git a/wmake/wdep b/wmake/wdep
new file mode 100755
index 00000000000..676783da5f2
--- /dev/null
+++ b/wmake/wdep
@@ -0,0 +1,159 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
+#
+# Script
+#     wdep <file>
+#     cat `wdep <file>`
+#
+# Description
+#     Find the dep-file corresponding to <file> and print the path.
+#
+#     Note: wdep MUST be run from the directory containing <file>.
+#     If it proves useful an option could be added to search the local
+#     source-tree for <file> if it is not in the current directory.
+#
+#------------------------------------------------------------------------------
+Script=${0##*/}
+
+usage() {
+    exec 1>&2
+    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
+    cat<<USAGE
+
+Usage: $Script <file>
+
+Find the dep-file corresponding to <file> 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 <file> 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 0f8e2cc41f0..5f5ce2ebef3 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 8de18be3a9e..75aedba30d6 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 <http://www.gnu.org/licenses/>.
 #
 # Script
-#     wmakeCheckPwd
+#     wmakeCheckPwd <dir>
 #
 # 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 <dir>
 #
 #-------------------------------------------------------------------------------
+Script=${0##*/}
+
 unset quietOpt
 
 usage() {
@@ -38,13 +39,12 @@ usage() {
     while [ "$#" -ge 1 ]; do echo "$1"; shift; done
     cat<<USAGE
 
-usage: ${0##*/} [OPTION] dirName
+Usage: $Script [OPTION] dirName
 
 options:
   -q | -quiet   suppress all normal output
 
-  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 <dir>
 
   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
-dirName="$1"
 
+# Set dirName to <dir>
+dirName="$1"
 
-# trivial checks first
+# Simple check against $PWD
 [ "$PWD" = "$dirName" ] && exit 0
 
+# Check existance of <dir>
 [ -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 <dir>
 [ "$thisDir" = "$target" ] && exit 0
 
-# some other error
-[ "$quietOpt" = true ] || echo "Error: Current directory is not $dirName"
+# This directory is not <dir>
+[ "$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 d43d8bf5a23..022d3ed2456 100755
--- a/wmake/wmakeFilesAndOptions
+++ b/wmake/wmakeFilesAndOptions
@@ -38,7 +38,7 @@ usage() {
     while [ "$#" -ge 1 ]; do echo "$1"; shift; done
     cat<<USAGE
 
-usage: ${0##*/}
+Usage: $Script
 
     Scan current directory for directories and source files
     and construct 'Make/files' and 'Make/options'
@@ -48,7 +48,10 @@ USAGE
 }
 
 
-# simple parse options
+#------------------------------------------------------------------------------
+# Parse arguments and options
+#------------------------------------------------------------------------------
+
 while [ "$#" -gt 0 ]
 do
     case "$1" in
@@ -64,12 +67,13 @@ do
     esac
 done
 
-# no arguments
+# No arguments
 [ "$#" -eq 0 ] || usage "unexpected arguments: '$*'"
 
-#
-# check environment variables
-#
+
+#------------------------------------------------------------------------------
+# Check environment variables
+#------------------------------------------------------------------------------
 for check in WM_OPTIONS WM_LINK_LANGUAGE WM_DIR
 do
     eval test "\$$check" || {
@@ -96,4 +100,12 @@ fi
     $WM_DIR/scripts/makeOptions
 }
 
+
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
+
+unset Script usage
+
+
 #------------------------------------------------------------------------------
diff --git a/wmake/wmakeFindEmptyMake b/wmake/wmakeFindEmptyMake
deleted file mode 100755
index d41b52671db..00000000000
--- a/wmake/wmakeFindEmptyMake
+++ /dev/null
@@ -1,87 +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 <http://www.gnu.org/licenses/>.
-#
-# 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<<USAGE
-
-usage: ${0##*/} [dir1 .. dirN]
-
-    Find 'Make/' directories without 'files' or 'options'.
-    These typically correspond to (partially) removed applications.
-
-USAGE
-    exit 1
-}
-
-#------------------------------------------------------------------------------
-findName=lnInclude
-
-# simple parse options
-while [ "$#" -gt 0 ]
-do
-    case "$1" in
-    -h | -help)   # provide immediate help
-        usage
-        ;;
-    -*)
-        usage "unknown option: '$*'"
-        ;;
-    *)
-        break
-        ;;
-    esac
-done
-
-
-# default to searching from pwd
-[ "$#" -gt 0 ] || set -- .
-
-for checkDir
-do
-    if [ -d $checkDir ]
-    then
-        echo "searching: $checkDir for 'Make' directories without 'files' or 'options'" 1>&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 fa8dc97fe06..b68c31a6e07 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)
-#
+
+#------------------------------------------------------------------------------
+# 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
+
+#------------------------------------------------------------------------------
+# 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 {} . \;
+     \( -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 1c396678b2b..0ecaf9ec5d9 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<<USAGE
 
-usage: ${0##*/} [dir1 .. dirN]
+Usage: $Script [dir1 .. dirN]
 
     Find directories with a 'Make/files' that contains a 'LIB =' directive
     and execute 'wmakeLnInclude -f' for each one
@@ -43,10 +45,13 @@ USAGE
     exit 1
 }
 
+
+#------------------------------------------------------------------------------
+# Parse arguments and options
 #------------------------------------------------------------------------------
+
 findName=lnInclude
 
-# simple parse options
 while [ "$#" -gt 0 ]
 do
     case "$1" in
@@ -63,7 +68,7 @@ do
 done
 
 
-# default to searching from pwd
+# Default to searching from CWD
 [ "$#" -gt 0 ] || set -- .
 
 for checkDir
@@ -95,4 +100,12 @@ do
     done
 done
 
+
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
+
+unset Script usage
+
+
 #------------------------------------------------------------------------------
diff --git a/wmake/wmakePrintBuild b/wmake/wmakePrintBuild
index 26cd5ef6ce6..cc554513dcc 100755
--- a/wmake/wmakePrintBuild
+++ b/wmake/wmakePrintBuild
@@ -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,15 +29,14 @@
 #     Print the version used when building the project
 #
 #------------------------------------------------------------------------------
-# persistent build tag
-build="$WM_PROJECT_DIR/.build"
+Script=${0##*/}
 
 usage() {
     exec 1>&2
 
     while [ "$#" -ge 1 ]; do echo "$1"; shift; done
     cat<<USAGE
-usage: ${0##*/} [OPTION]
+Usage: $Script [OPTION]
 options:
   -check          check the git head commit vs. \$WM_PROJECT_DIR/.build
                   (exit code 0 for no changes)
@@ -55,11 +54,13 @@ Print the version used when building the project, in this order of precedence:
 USAGE
     exit 1
 }
-#------------------------------------------------------------------------------
 
+
+#------------------------------------------------------------------------------
+# Parse arguments and options
+#------------------------------------------------------------------------------
 unset checkOnly update package version shortOpt
 
-# parse options
 while [ "$#" -gt 0 ]
 do
     case "$1" in
@@ -80,7 +81,7 @@ do
         ;;
     -pkg | -package)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
-        # mark empty as 'none', disallow '!' in string
+        # Mark empty as 'none', disallow '!' in string
         package=$(echo "${2:-none}" | sed -e 's/!//g')
         shift 2
         ;;
@@ -101,10 +102,14 @@ done
 
 #------------------------------------------------------------------------------
 
-#
-# retrieve old values from the $WM_PROJECT_DIR/.build cache, stored as
+# Persistent build tag
+build="$WM_PROJECT_DIR/.build"
+
+
+#------------------------------------------------------------------------------
+# Retrieve old values from the $WM_PROJECT_DIR/.build cache, stored as
 #     version [packager]
-#
+#------------------------------------------------------------------------------
 unset oldPackage oldVersion
 getOldValues()
 {
@@ -115,10 +120,9 @@ getOldValues()
     [ "${oldPackage:-none}" = none ] && unset oldPackage
 }
 
-#
-# printTag - output the build tag
-# reuses the old -package tag if needed
-#
+#------------------------------------------------------------------------------
+# printTag - output the build tag, reuses the old -package tag if needed
+#------------------------------------------------------------------------------
 printTag()
 {
     if [ "${package:-${oldPackage:-none}}" = none ]
@@ -130,13 +134,16 @@ printTag()
 }
 
 
+#------------------------------------------------------------------------------
+# Get the version
+#------------------------------------------------------------------------------
 
 if [ -n "$version" ]
 then
-    # specified a version - no error possible
+    # Specified a version - no error possible
     rc=0
 else
-    # get the head SHA1 when building under git
+    # Get the head SHA1 when building under git
     # if there are multiple values (eg, HEAD, origin/HEAD, ...)
     # only take the first one, which is 'HEAD'
     version=$(
@@ -146,17 +153,17 @@ else
 
     if [ -n "$version" ]
     then
-        # mark as success and prefix with WM_PROJECT_VERSION
+        # Mark as success and prefix with WM_PROJECT_VERSION
         rc=0
         version="${WM_PROJECT_VERSION}-$version"
     else
-        # mark as failure
+        # Mark as failure
         rc=1
     fi
 fi
 
 
-# retrieve old values
+# Retrieve old values
 getOldValues
 
 if [ "$shortOpt" = true ]
@@ -164,9 +171,10 @@ then
     unset package oldPackage
 fi
 
-#
-# update persistent build tag if possible
-#
+
+#------------------------------------------------------------------------------
+# Update persistent build tag if possible
+#------------------------------------------------------------------------------
 if [ $rc -eq 0 -a -n "$update" ]
 then
     if [ "$version:$package" != "$oldVersion:$oldPackage" ]
@@ -178,16 +186,10 @@ then
     fi
 fi
 
-# cat<< DEBUG 1>&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 c079883c6c7..7b3d51e91ba 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 <installedProject>/etc/
+# Check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
+# Check ~/.$WM_PROJECT/
+# Check <installedProject>/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 06442045bbc..eb52f406150 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 <installedProject>/etc/
+# Check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
+# Check ~/.$WM_PROJECT/
+# Check <installedProject>/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
+
+
 #------------------------------------------------------------------------------
-- 
GitLab