openfoam/wmake/rules/General/transform
Mark Olesen 9423d2bd83 CONFIG: improve support for compiler/link options (#1830)
- introduce WM_COMPILE_CONTROL variable to convey control information
  into the build rules.

  The convention (as per spack):
      - '+' to select a feature
      - '~' to deselect a feature

  Eg, to select the gold linker, and disable openmp
  (spaces are not required):

      WM_COMPILE_CONTROL="+gold ~openmp"

CONFIG: accept FOAM_EXTRA_LDFLAGS for AMD, gold, Mingw linkers

CONFIG: generalize PROJECT_LIBS (-ldl used almost universally)
2020-09-07 09:45:51 +02:00

43 lines
1.1 KiB
Plaintext

#----------------------------*- makefile-gmake -*------------------------------
# The dependency generation program
WMKDEP := $(WMAKE_BIN)/wmkdepend # 1. Ragel-based
# WMKDEP := $(WMAKE_BIN)/wmkdep # 2. Flex-based (slower, ulimit problem)
# WMKDEP := $(WM_SCRIPTS)/makeDepend # 3. cpp -M (for testing only)
WMKDEP_FLAGS := -eWM_PROJECT_DIR -eWM_THIRD_PARTY_DIR
ifneq ("","$(WM_QUIET)")
E=@
define QUIET_MESSAGE
@echo " $1: $2";
endef
define VERBOSE_MESSAGE
endef
WMKDEP_FLAGS += -q
else
E=
define QUIET_MESSAGE
endef
define VERBOSE_MESSAGE
@echo "$1 $2";
endef
endif
define DEFINE_TRANSFORM
$(OBJECTS_DIR)/%.o : %$1
$(call QUIET_MESSAGE,$(subst .,,$(1))too,$(value <F))
$E $$($(subst .,,$(1))too)
endef
$(foreach s,$(SUFFIXES),$(eval $(call DEFINE_TRANSFORM,$(s))))
$(OBJECTS_DIR)/%.dep : %
$(call QUIET_MESSAGE,dep,$(<F))
$(call VERBOSE_MESSAGE,Making dependency list for source file,$(<F))
@$(WM_SCRIPTS)/makeTargetDir $@
@$(WMKDEP) $(WMKDEP_FLAGS) -o$@ -I$(*D) $(LIB_HEADER_DIRS) $<
#------------------------------------------------------------------------------