openfoam/wmake/rules/General/general
Mark Olesen 793f4e3a37 CONFIG: add support for WM_COMPILE_OPTION='Dbg'
- uses '-g -DFULLDEBUG' (like Debug), but with -O3 (like Opt).

  This adds in debug symbols and FULLDEBUG code segments (good for
  code development) but retains -O3 optimizations and code paths and
  avoids the much slower -O0 associated with 'Debug'.

- add in central wmake/General/common/{c,c++}XXX tuning,
  which helps reduce the number of nearly identical files

ENH: add support for wmake -debug-Og
2022-09-09 11:55:33 +02:00

52 lines
1.4 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 (,$(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
include $(GENERAL_RULES)/transform
#------------------------------------------------------------------------------