- eg, for partially incomplete systems (without libz devel header) ENH: clearer binding of dummy Pstream in OpenFOAM/Make/options - link of dummy stub Pstream now contingent on linking libOpenFOAM as well. This makes the purpose slightly clearer ENH: cleaner option naming/handling in wmake script - allow special purpose -no-openfoam option. Eg, compiling test programs without OpenFOAM and Pstream libraries but using the rest of the wmake system. ENH: add +openmp support into WM_COMPILE_CONTROL (#2633) - this adds compile/link flags for openmp. For single-use, can also use 'wmake -openmp'. If both +openmp and ~openmp are specified in WM_COMPILE_CONTROL the ~openmp will have priority. This is actually done indirectly since ~openmp will set empty COMP_OPENMP, LINK_OPENMP internal variables, which the +openmp then adds to the c++FLAGS and linkexe targets (ie, won't actually add anything). ENH: add +ccache or ccache=... support into WM_COMPILE_CONTROL (#2633) - with the first version (+ccache), simply use ccache from the path without any extra options. - with the second version (ccache=...), can be more specific about what is called. Using "+ccache" is identical to "ccache=ccache", but the later could be used in other ways. For example, ccache=/strange/install/path/ccache ccache=</path/my-tooling --option> Have the choice of unquoted, single or double quoted or '< >' quoted STYLE: relocate FOAM_EXTRA_LDFLAGS in general makefile - removes clutter for different linkers (eg, gold, mold, ldd) making it easier to extend for other linkers. STYLE: protect makefile checks with 'strip' function
58 lines
1.6 KiB
Makefile
58 lines
1.6 KiB
Makefile
#-------------------------------*- makefile -*---------------------------------
|
|
WM_VERSION = OPENFOAM=2206
|
|
|
|
AR = ar
|
|
ARFLAGS = cr
|
|
RANLIB = ranlib
|
|
CPP = cpp
|
|
LD = ld
|
|
|
|
GFLAGS = -D$(WM_VERSION) \
|
|
-DWM_$(WM_PRECISION_OPTION) -DWM_LABEL_SIZE=$(WM_LABEL_SIZE)
|
|
GINC =
|
|
GLIBS = -lm
|
|
GLIB_LIBS =
|
|
|
|
|
|
ARCHITECTURE_RULES = $(WM_DIR)/rules/$(WM_ARCH)
|
|
COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[-+.0-9~].*//')
|
|
DEFAULT_RULES = $(ARCHITECTURE_RULES)$(COMPILER_FAMILY)
|
|
RULES = $(ARCHITECTURE_RULES)$(WM_COMPILER)
|
|
WMAKE_BIN = $(WM_PROJECT_DIR)/platforms/tools/$(WM_ARCH)$(WM_COMPILER)
|
|
|
|
# --------
|
|
# Extract compiler version suffix.
|
|
# Most (all?) compilers use the convention <compiler>-<version>
|
|
#
|
|
# Thus (for example) version=11 -> gcc-11
|
|
# --------
|
|
ifneq (,$(findstring version=,$(WM_COMPILE_CONTROL)))
|
|
COMPILER_VERSION := $(shell echo "$(WM_COMPILE_CONTROL)" | sed -ne 's/^.*version=-*\([0-9][.0-9]*\).*/-\1/p')
|
|
else
|
|
COMPILER_VERSION :=
|
|
endif
|
|
|
|
# Default compilation is 'Opt' - never permit an empty value
|
|
ifeq (,$(strip $(WM_COMPILE_OPTION)))
|
|
WM_COMPILE_OPTION := Opt
|
|
endif
|
|
|
|
# Older macro for (shell) branching
|
|
AND := &&
|
|
|
|
include $(DEFAULT_RULES)/general
|
|
sinclude $(DEFAULT_RULES)/override
|
|
ifneq ("$(COMPILER_FAMILY)","$(WM_COMPILER)")
|
|
sinclude $(RULES)/general
|
|
sinclude $(RULES)/c++
|
|
endif
|
|
|
|
# Add compile flags for openmp
|
|
ifneq (,$(findstring +openmp,$(WM_COMPILE_CONTROL)))
|
|
c++FLAGS += $(COMP_OPENMP)
|
|
endif
|
|
|
|
include $(GENERAL_RULES)/transform
|
|
|
|
#------------------------------------------------------------------------------
|