From 81dd264963e7bcc4c9db433e949983ed5788be0a Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 21 May 2024 21:08:21 +0100 Subject: [PATCH] wmake: Fix removal of lnInclude during build of mpi-dependent libraries --- wmake/scripts/AllwmakeMpiLib | 2 +- wmake/wclean | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/wmake/scripts/AllwmakeMpiLib b/wmake/scripts/AllwmakeMpiLib index 1352dcf7ba..73b1404c7e 100644 --- a/wmake/scripts/AllwmakeMpiLib +++ b/wmake/scripts/AllwmakeMpiLib @@ -44,7 +44,7 @@ wmakeMpiLib() WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" whichmpi="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$FOAM_MPI" whichtarget="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$version" - [ -e "$whichmpi" -a -e "$whichtarget" ] || wclean $libName + [ -e "$whichmpi" -a -e "$whichtarget" ] || wclean -noLnInclude $libName echo "wmake $targetType $libName" wmake $targetType $libName touch "$whichmpi" "$whichtarget" diff --git a/wmake/wclean b/wmake/wclean index 3c3d80df8d..8a3150de7f 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | Website: https://openfoam.org -# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -54,7 +54,8 @@ Usage: $Script [OPTION] [dir] options: -silent | -s Ignored - for compatibility with wmake - -help Print the usage + -noLnInclude Don't remove lnInclude directories + -help | -h Print the usage Clean up the wmake control directory Make/\$WM_OPTIONS and remove the lnInclude directories generated for libraries. @@ -77,15 +78,20 @@ USAGE # Parse arguments and options #------------------------------------------------------------------------------ +noLnInclude= while [ "$#" -gt 0 ] do case "$1" in - -h | -help) - usage && exit 0 - ;; -s | -silent) # Ignored - for compatibility with wmake shift ;; + -noLnInclude) + noLnInclude=true + shift + ;; + -h | -help) + usage && exit 0 + ;; -*) error "unknown option: '$*'" ;; @@ -274,7 +280,7 @@ fi # Remove the lnInclude directory if present #------------------------------------------------------------------------------ -if [ -d lnInclude ] +if [ "$noLnInclude" != true ] && [ -d lnInclude ] then rm -rf lnInclude 2>/dev/null fi