Commit 61945488 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: split off modules/list-modules script

STYLE: string quoting when echoing paths in wmake have_* scripts

STYLE: more consistency in foamRunTutorials, foamCleanTutorials options
parent a4864eb1
......@@ -20,7 +20,7 @@
# and all its subdirectories.
#
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
thisScript="$0"
if [ "/${thisScript#/}" != "$thisScript" ]
......@@ -41,6 +41,7 @@ options:
Recursively clean an OpenFOAM case directory.
By default uses Allclean, Allwclean when present.
The -skipFirst option is the same as -self.
USAGE
exit 0 # clean exit
......@@ -80,7 +81,7 @@ then
exit 2
}
;;
-self*)
-self* | -skipFirst)
skipSelf=true
;;
--)
......@@ -133,7 +134,7 @@ else
# Recurse into subdirectories
for caseName in *
do
( cd $caseName 2>/dev/null && "$thisScript" )
( cd "$caseName" 2>/dev/null && "$thisScript" )
done
fi
......
......@@ -41,12 +41,13 @@ printHelp() {
Usage: ${0##*/} [OPTION]
options:
-case <dir> specify starting directory, default is cwd
-self | -skipFirst avoid Allrun, Alltest script (prevent infinite recursion)
-self avoid Allrun, Alltest script (prevent infinite recursion)
-test prefer Alltest script, pass -test argument to scripts
-help print the usage
Recursively run Allrun/Alltest or blockMesh+application,
starting with the current directory or the specified -case directory.
The -skipFirst option is the same as -self.
USAGE
exit 0 # clean exit
......
......@@ -10,29 +10,8 @@ targetType=libso
: "${FOAM_MODULE_PREFIX:=${FOAM_LIBBIN%/*}}"
export FOAM_MODULE_PREFIX
#------------------------------------------------------------------------------
# Skip some directory names
filterDir() {
case "$1" in
(build | platforms | doc)
echo ""
;;
(*)
echo "$1"
;;
esac
}
# Build each first-level directory with an Allwmake* file
for moduleName in \
$(find . -mindepth 2 -maxdepth 2 -name 'Allwmake*' -print | \
sed -e 's@^\./@@; s@/.*$@@;' | sort | uniq)
for moduleName in $(./list-modules)
do
moduleName="$(filterDir "$moduleName")"
if [ -d "$moduleName" ]
then
( cd "$moduleName" && wmake -all $targetType )
......
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# SPDX-License-Identifier: (GPL-3.0+)
# Copyright (C) 2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# Script
# list-modules
#
# Description
# List module directories
# - each first-level directory with an Allwmake file
#
#------------------------------------------------------------------------------
cd "${0%/*}" || exit # Run from this directory
printHelp() {
cat<< HELP 1>&2
Usage: ${0##*/} [OPTION]
options:
-help Display help and exit
List module directories - each first-level directory with an Allwmake file
HELP
exit 0 # A clean exit
}
# Report error and exit
die()
{
exec 1>&2
echo
echo "Error encountered:"
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
echo
echo "See '${0##*/} -help' for usage"
echo
exit 1
}
#------------------------------------------------------------------------------
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help*) # Short help
printHelp
;;
*)
die "Unknown option/argument: '$1'"
;;
esac
shift
done
# Each first-level directory with an Allwmake file
for moduleName in *
do
if [ -f "$moduleName/Allwmake" ]
then
case "$moduleName" in
# Skip some directory names
(build | doc | platform*)
;;
(*)
echo "$moduleName"
;;
esac
fi
done
#------------------------------------------------------------------------------
......@@ -45,9 +45,9 @@ no_adios2()
echo_adios2()
{
echo "adios2=${HAVE_ADIOS2:-false}"
echo "root=$ADIOS2_ARCH_PATH"
echo "include=$ADIOS2_INC_DIR"
echo "library=$ADIOS2_LIB_DIR"
echo "root=\"$ADIOS2_ARCH_PATH\""
echo "include=\"$ADIOS2_INC_DIR\""
echo "library=\"$ADIOS2_LIB_DIR\""
}
......
......@@ -45,9 +45,9 @@ no_boost()
echo_boost()
{
echo "boost=${HAVE_BOOST:-false}"
echo "root=$BOOST_ARCH_PATH"
echo "include=$BOOST_INC_DIR"
echo "library=$BOOST_LIB_DIR"
echo "root=\"$BOOST_ARCH_PATH\""
echo "include=\"$BOOST_INC_DIR\""
echo "library=\"$BOOST_LIB_DIR\""
}
......
......@@ -44,9 +44,9 @@ no_ccmio()
echo_ccmio()
{
echo "ccmio=${HAVE_CCMIO:-false}"
echo "root=$CCMIO_ARCH_PATH"
echo "include=$CCMIO_INC_DIR"
echo "library=$CCMIO_LIB_DIR"
echo "root=\"$CCMIO_ARCH_PATH\""
echo "include=\"$CCMIO_INC_DIR\""
echo "library=\"$CCMIO_LIB_DIR\""
}
......
......@@ -50,9 +50,9 @@ echo_cgal()
{
echo "cgal=${HAVE_CGAL:-false}"
echo "flavour=$CGAL_FLAVOUR"
echo "root=$CGAL_ARCH_PATH"
echo "include=$CGAL_INC_DIR"
echo "library=$CGAL_LIB_DIR"
echo "root=\"$CGAL_ARCH_PATH\""
echo "include=\"$CGAL_INC_DIR\""
echo "library=\"$CGAL_LIB_DIR\""
}
......
......@@ -45,9 +45,9 @@ no_fftw()
echo_fftw()
{
echo "fftw=${HAVE_FFTW:-false}"
echo "root=$FFTW_ARCH_PATH"
echo "include=$FFTW_INC_DIR"
echo "library=$FFTW_LIB_DIR"
echo "root=\"$FFTW_ARCH_PATH\""
echo "include=\"$FFTW_INC_DIR\""
echo "library=\"$FFTW_LIB_DIR\""
}
......
......@@ -45,9 +45,9 @@ no_hypre()
echo_hypre()
{
echo "hypre=${HAVE_HYPRE:-false}"
echo "root=$HYPRE_ARCH_PATH"
echo "include=$HYPRE_INC_DIR"
echo "library=$HYPRE_LIB_DIR"
echo "root=\"$HYPRE_ARCH_PATH\""
echo "include=\"$HYPRE_INC_DIR\""
echo "library=\"$HYPRE_LIB_DIR\""
}
......
......@@ -45,9 +45,9 @@ no_kahip()
echo_kahip()
{
echo "kahip=${HAVE_KAHIP:-false}"
echo "root=$KAHIP_ARCH_PATH"
echo "include=$KAHIP_INC_DIR"
echo "library=$KAHIP_LIB_DIR"
echo "root=\"$KAHIP_ARCH_PATH\""
echo "include=\"$KAHIP_INC_DIR\""
echo "library=\"$KAHIP_LIB_DIR\""
}
......
......@@ -45,9 +45,9 @@ no_metis()
echo_metis()
{
echo "metis=${HAVE_METIS:-false}"
echo "root=$METIS_ARCH_PATH"
echo "include=$METIS_INC_DIR"
echo "library=$METIS_LIB_DIR"
echo "root=\"$METIS_ARCH_PATH\""
echo "include=\"$METIS_INC_DIR\""
echo "library=\"$METIS_LIB_DIR\""
}
......
......@@ -45,9 +45,9 @@ no_mgridgen()
echo_mgridgen()
{
echo "mgridgen=${HAVE_MGRIDGEN:-false}"
echo "root=$MGRIDGEN_ARCH_PATH"
echo "include=$MGRIDGEN_INC_DIR"
echo "library=$MGRIDGEN_LIB_DIR"
echo "root=\"$MGRIDGEN_ARCH_PATH\""
echo "include=\"$MGRIDGEN_INC_DIR\""
echo "library=\"$MGRIDGEN_LIB_DIR\""
}
......
......@@ -46,9 +46,9 @@ no_petsc()
echo_petsc()
{
echo "petsc=${HAVE_PETSC:-false}"
echo "root=$PETSC_ARCH_PATH"
echo "include=$PETSC_INC_DIR"
echo "library=$PETSC_LIB_DIR"
echo "root=\"$PETSC_ARCH_PATH\""
echo "include=\"$PETSC_INC_DIR\""
echo "library=\"$PETSC_LIB_DIR\""
}
......
......@@ -43,8 +43,8 @@ no_readline()
echo_readline()
{
echo "readline=${HAVE_LIBREADLINE:-false}"
echo "include=$READLINE_INC_DIR"
echo "library=$READLINE_LIB_DIR"
echo "include=\"$READLINE_INC_DIR\""
echo "library=\"$READLINE_LIB_DIR\""
}
......
......@@ -55,14 +55,14 @@ no_scotch()
echo_scotch()
{
echo "scotch=${HAVE_SCOTCH:-false}"
echo "root=$SCOTCH_ARCH_PATH"
echo "include=$SCOTCH_INC_DIR"
echo "library=$SCOTCH_LIB_DIR"
echo "root=\"$SCOTCH_ARCH_PATH\""
echo "include=\"$SCOTCH_INC_DIR\""
echo "library=\"$SCOTCH_LIB_DIR\""
echo
echo "ptscotch=${HAVE_PTSCOTCH:-false}"
echo "root=$PTSCOTCH_ARCH_PATH"
echo "include=$PTSCOTCH_INC_DIR"
echo "library=$PTSCOTCH_LIB_DIR"
echo "root=\"$PTSCOTCH_ARCH_PATH\""
echo "include=\"$PTSCOTCH_INC_DIR\""
echo "library=\"$PTSCOTCH_LIB_DIR\""
}
......
......@@ -44,9 +44,9 @@ no_zoltan()
echo_zoltan()
{
echo "zoltan=${HAVE_ZOLTAN:-false}"
echo "root=$ZOLTAN_ARCH_PATH"
echo "include=$ZOLTAN_INC_DIR"
echo "library=$ZOLTAN_LIB_DIR"
echo "root=\"$ZOLTAN_ARCH_PATH\""
echo "include=\"$ZOLTAN_INC_DIR\""
echo "library=\"$ZOLTAN_LIB_DIR\""
}
......
......@@ -53,9 +53,9 @@ no_paraview()
echo_paraview()
{
echo "paraview=${HAVE_PVPLUGIN_SUPPORT:-false}"
echo "root=$ParaView_DIR"
echo "include=$PARAVIEW_INC_DIR"
echo "plugin=$FOAM_PV_PLUGIN_LIBBIN"
echo "root=\"$ParaView_DIR\""
echo "include=\"$PARAVIEW_INC_DIR\""
echo "plugin=\"$FOAM_PV_PLUGIN_LIBBIN\""
echo "api=$PARAVIEW_API"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment