- with the wmake rules we may have some compiler options bound to the
internal compiler variable. For example,
CC = g++ -std=c++11 -m64
c++FLAGS = ...
So shift any flags from CC to CXXFLAGS for the output of
'wmake -show-cxx', 'wmake -show-cxxflags', etc.
This makes it much easier to handle the values correctly elsewhere.
Eg,
CXX="$(wmake -show-cxx)" CXXFLAGS="$(wmake -show-cxxflags)" \
./configure
89 lines
2.4 KiB
Makefile
89 lines
2.4 KiB
Makefile
#----------------------------*- 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:
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Some default values
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Shared library extension (with '.' separator)
|
|
EXT_SO = .so
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Compilation rules
|
|
#------------------------------------------------------------------------------
|
|
|
|
GENERAL_RULES = $(WM_DIR)/rules/General
|
|
include $(GENERAL_RULES)/general
|
|
|
|
# Commands
|
|
COMPILE_C := $(strip $(cc) $(cFLAGS))
|
|
COMPILE_CXX := $(strip $(CC) $(c++FLAGS))
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Display information
|
|
#------------------------------------------------------------------------------
|
|
|
|
.PHONY: api
|
|
api:
|
|
@echo "$(lastword $(subst =, ,$(WM_VERSION)))"
|
|
|
|
.PHONY: ext-so
|
|
ext-so:
|
|
@echo "$(EXT_SO)"
|
|
|
|
.PHONY: compile-c
|
|
compile-c:
|
|
@echo "$(COMP_C)"
|
|
|
|
.PHONY: c
|
|
c:
|
|
@echo "$(firstword $(cc))"
|
|
|
|
.PHONY: cflags
|
|
cflags:
|
|
@echo "$(wordlist 2,$(words $(COMPILE_C)), $(COMPILE_C))"
|
|
|
|
.PHONY: compile-cxx
|
|
compile-cxx:
|
|
@echo "$(COMPILE_CXX)"
|
|
|
|
.PHONY: cxx
|
|
cxx:
|
|
@echo "$(firstword $(CC))"
|
|
|
|
.PHONY: cxxflags
|
|
cxxflags:
|
|
@echo "$(wordlist 2,$(words $(COMPILE_CXX)), $(COMPILE_CXX))"
|
|
|
|
#----------------------------- vim: set ft=make: ------------------------------
|