diff --git a/etc/bashrc b/etc/bashrc index fcbc0e14f7..8fefa32b06 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -96,6 +96,7 @@ export WM_COMPILE_OPTION=Opt # +strict : more deprecation warnings (may generate *many* warnings) # ccache=... : ccache command (unquoted, single/double or <> quoted) # version=... : compiler suffix (eg, version=11 -> gcc-11) +# lnInclude-extra : add '-extra' option for wmakeLnInclude #export WM_COMPILE_CONTROL="+strict" # [WM_MPLIB] - MPI implementation: diff --git a/etc/cshrc b/etc/cshrc index 62afef7982..fc8520fab8 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -96,6 +96,7 @@ setenv WM_COMPILE_OPTION Opt # +strict : more deprecation warnings (may generate *many* warnings) # ccache=... : ccache command (unquoted, single/double or <> quoted) # version=... : compiler suffix (eg, version=11 -> gcc-11) +# lnInclude-extra : add '-extra' option for wmakeLnInclude #setenv WM_COMPILE_CONTROL "+strict" # [WM_MPLIB] - MPI implementation: diff --git a/wmake/wmake b/wmake/wmake index 1c6aef2477..86353e98b8 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -40,6 +40,7 @@ # FOAM_BUILDROOT # FOAM_EXTRA_CFLAGS FOAM_EXTRA_CXXFLAGS FOAM_EXTRA_LDFLAGS # FOAM_MODULE_PREFIX +# WM_COMPILE_CONTROL # # See also # wmakeLnInclude, wmakeLnIncludeAll, wmakeCollect, wdep, wrmdep, wrmo, diff --git a/wmake/wmakeLnInclude b/wmake/wmakeLnInclude index 84ef12ed2d..8f53a44c09 100755 --- a/wmake/wmakeLnInclude +++ b/wmake/wmakeLnInclude @@ -7,7 +7,7 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2011-2016 OpenFOAM Foundation -# Copyright (C) 2019-2023 OpenCFD Ltd. +# Copyright (C) 2019-2025 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -26,6 +26,10 @@ # Source files : .c .C .cc .cpp .cxx # Template files : -- .C .tcc .tpp .txx # +# Environment +# WM_COMPILE_CONTROL +# - detects lnInclude-extra and treats like the '-extra' option +# # Note # OpenFOAM has historically used the '.C' extension for both compiled # and templated C++ code (may change in the future). @@ -47,7 +51,8 @@ options: -f | -force Force remove of existing lnInclude/ before recreating -u | -update Update existing lnInclude directories -s | -silent Silent mode (do not echo command) - -extra Include additional files (eg, source files) + -extra Also include all source files in lnInclude/ + -no-extra Do not include all source files in lnInclude/ [default] -pwd Locate root directory containing Make/ directory -help Print the usage @@ -82,6 +87,9 @@ link_option="-s" unset opt_extra opt_force opt_pwd opt_update +# Handle control flags +case "$WM_COMPILE_CONTROL" in (*lnInclude-extra*) opt_extra=true ;; esac + while [ "$#" -gt 0 ] do case "$1" in @@ -94,6 +102,9 @@ do -extra) opt_extra=true # Include additional files ;; + -no-extra) + unset opt_extra + ;; -f | -force) opt_force=true link_option="-sf" diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll index e34e794471..3ebc929885 100755 --- a/wmake/wmakeLnIncludeAll +++ b/wmake/wmakeLnIncludeAll @@ -7,7 +7,7 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2011-2016 OpenFOAM Foundation -# Copyright (C) 2018-2023 OpenCFD Ltd. +# Copyright (C) 2018-2025 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -35,7 +35,8 @@ options: -u | -update Update existing lnInclude directories -j Use all local cores/hyperthreads -jN | -j N Use N cores/hyperthreads - -extra Include additional files (eg, source files) + -extra Also include all source files in lnInclude/ + -no-extra Do not include all source files in lnInclude/ [default] -help Display short help and exit Find directories with a 'Make/files' containing a 'LIB =' directive @@ -81,6 +82,9 @@ do -extra) opt_extra='-extra' ;; + -no-extra) + opt_extra='-no-extra' + ;; -f | -force) opt_force='-force' ;;