diff --git a/wmake/makefiles/general b/wmake/makefiles/general index 6b7fc6e4b6ce8d7d47b8d26d71d56c341aee902f..198e5c1e59a3eb6c7b56fca8a0be5d902fbd127a 100644 --- a/wmake/makefiles/general +++ b/wmake/makefiles/general @@ -31,7 +31,7 @@ endif #------------------------------------------------------------------------------ -# Unset suffices list (suffix rules are not used) +# No default suffix rules used #------------------------------------------------------------------------------ .SUFFIXES: diff --git a/wmake/makefiles/info b/wmake/makefiles/info new file mode 100644 index 0000000000000000000000000000000000000000..90fa2b550df45c70030d48dda837ca346a36ffc4 --- /dev/null +++ b/wmake/makefiles/info @@ -0,0 +1,74 @@ +#----------------------------*- makefile-gmake -*------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM, licensed under GNU General Public License +# <http://www.gnu.org/licenses/>. +# +# File +# wmake/makefiles/info +# +# Description +# Makefile to generate information. +# Used by wmake -show-* +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# Use POSIX shell. Default to POSIX for the OS. +#------------------------------------------------------------------------------ + +SHELL = /bin/sh + +#------------------------------------------------------------------------------ +# No default suffix rules used +#------------------------------------------------------------------------------ + +.SUFFIXES: + + +#------------------------------------------------------------------------------ +# Compilation rules +#------------------------------------------------------------------------------ + +GENERAL_RULES = $(WM_DIR)/rules/General +include $(GENERAL_RULES)/general + + +#------------------------------------------------------------------------------ +# Display information +#------------------------------------------------------------------------------ + +export WM_VERSION + + +.PHONY: compile +compile: + @echo "$(strip $(CC) $(c++FLAGS))" + +.PHONY: api +api: + @echo "$${WM_VERSION#*=}" + +.PHONY: c +c: + @echo "$(strip $(cc))" + +.PHONY: cflags +cflags: + @echo "$(strip $(cFLAGS))" + +.PHONY: cxx +cxx: + @echo "$(strip $(CC))" + +.PHONY: cxxflags +cxxflags: + @echo "$(strip $(c++FLAGS))" + + +#----------------------------- vim: set ft=make: ------------------------------ diff --git a/wmake/wmake b/wmake/wmake index c05e25c3f1d73af7b718022433487d5c4ebdd562..7591fc94512939c7335ca0f287a49311cbcd3925 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -77,6 +77,11 @@ options: -pwd Print root directory containing a Make/ directory and exit -update Update lnInclude directories, dep files, remove deprecated files and directories + -show Identical to -show-compile + -show-api Print api value and exit + -show-compile Print C++ compiler value/flags and exit + -show-cxx Print C++ compiler value and exit + -show-cxxflags Print C++ compiler flags and exit -h | -help Print the usage @@ -121,7 +126,7 @@ allCores() #------------------------------------------------------------------------------ # Default to compiling the local target only -unset all update optPrintRootDir +unset all optShow update optPrintRootDir while [ "$#" -gt 0 ] do @@ -133,6 +138,14 @@ do -s | -silent) export WM_QUIET=true ;; + -show | -show-compile) + $make -f $WM_DIR/makefiles/info compile + optShow=true + ;; + -show-api | -show-cxx | -show-cxxflags | -show-c | -show-cflags) + $make -f $WM_DIR/makefiles/info "${1#-show-}" + optShow=true + ;; -a | -all | all) all=all ;; @@ -147,12 +160,12 @@ do [ "$nCores" = 0 ] && allCores export WM_NCOMPPROCS=$nCores - echo "Compiling enabled on $WM_NCOMPPROCS cores" + echo "Compiling enabled on $WM_NCOMPPROCS cores" 1>&2 ;; # Parallel compilation on specified number of cores -j[1-9]*) export WM_NCOMPPROCS=${1#-j} - echo "Compiling enabled on $WM_NCOMPPROCS cores" + echo "Compiling enabled on $WM_NCOMPPROCS cores" 1>&2 ;; # Keep going, ignoring errors -k | -keep-going | -non-stop) @@ -190,6 +203,11 @@ do shift done +if [ "$optShow" = true ] +then + exit 0 +fi + #------------------------------------------------------------------------------ # Check environment variables