diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake index cb085fd8c04247f648ec0a511d6356947377c81f..c24b4e652f9a1827da281f2d6ad522d44ba35611 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake @@ -1,14 +1,8 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Optional unit: continue-on-error -export WM_CONTINUE_ON_ERROR=true - -# Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - -# Source CMake functions -. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions +cd ${0%/*} || exit 1 # Run from this directory +export WM_CONTINUE_ON_ERROR=true # Optional unit +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # Parse arguments +. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions # ----------------------------------------------------------------------------- diff --git a/bin/foamTags b/bin/foamTags index ec881c5eb5c4d4b7d3f96cddf4d2326ac820a9e7..973363a6333c62fc0b45a6d6221ab5f720225947 100755 --- a/bin/foamTags +++ b/bin/foamTags @@ -46,21 +46,34 @@ then exit 1 fi -for cmd in etags ctags-exuberant +unset etags +for cmd in ctags-exuberant etags do - type $cmd >/dev/null 2>&1 || { - echo "${0##*/} cannot build tag files: '$cmd' command not found" - exit 1 - } + command -v $cmd >/dev/null 2>&1 && { etags=$cmd; break; } done +[ -n "$etags" ] || { + exec 1>&2 + echo "${0##*/} cannot build tag files: no suitable command found" + echo " No ctags-exuberant" + echo " No etags" + exit 1 +} + +case "$etags" in +ctags-exuberant) + etags="$etags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -" + ;; +etags) + etags="$etags --declarations -l c++ -o .tags/etags -" + ;; +esac + cd $WM_PROJECT_DIR || exit 1 mkdir .tags 2>/dev/null -#etagsCmd="etags --declarations -l c++ -o .tags/etags -" -etagsCmd="ctags-exuberant -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -" - -find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsCmd +echo "building tags..." 1>&2 +find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etags #gtags -i --gtagsconf bin/tools/gtagsrc .tags diff --git a/src/functionObjects/graphics/runTimePostProcessing/Allwmake b/src/functionObjects/graphics/runTimePostProcessing/Allwmake index d7d73741dc0967dfd1d7425be1b6e339f38d0bf0..5d1376aa351117e191633518b1a048acf9be0f99 100755 --- a/src/functionObjects/graphics/runTimePostProcessing/Allwmake +++ b/src/functionObjects/graphics/runTimePostProcessing/Allwmake @@ -1,8 +1,6 @@ #!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source CMake functions -. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions # ----------------------------------------------------------------------------- @@ -23,7 +21,7 @@ if [ -n "$depend" ] then if [ "$targetType" != objects ] then - if type cmake > /dev/null 2>&1 + if command -v cmake > /dev/null 2>&1 then cmakeVersioned "$depend" $PWD || { echo diff --git a/wmake/scripts/cmakeFunctions b/wmake/scripts/cmakeFunctions index f3fb0abb39672ce9775e2caf46edbe2439fd3d5a..4c77d3d944c1f87ae5115966bb7b93e260e44565 100644 --- a/wmake/scripts/cmakeFunctions +++ b/wmake/scripts/cmakeFunctions @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -100,11 +100,9 @@ cmakeVersioned() sentinel=$(sameDependency "$depend" "$sourceDir") || \ rm -rf "$objectsDir" > /dev/null 2>&1 - mkdir -p $objectsDir && \ - ( - cd $objectsDir && _cmake $sourceDir && make \ - && echo "$depend" > ${sentinel:-/dev/null} - ) + mkdir -p $objectsDir \ + && (cd $objectsDir && _cmake $sourceDir && make) \ + && echo "$depend" >| "${sentinel:-/dev/null}" }