Commit c3a03105 authored by Henry Weller's avatar Henry Weller
Browse files

wmake: Add support for compiler type default rules

which may be optionally overridden by version-specific rules.

For example the default rules for gcc on GNU/Linux x86_64 are in the
wmake/rules/linux64Gcc directory.  If there is a need to change any of
the rules for a specific version of gcc, e.g. gcc-4.8.4 the directory
wmake/rules/linux64Gcc48 may be created into which any of the language
files may be provided containing the rules to override the defaults.
parent 55f8712e
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -29,24 +29,23 @@
#
#------------------------------------------------------------------------------
GENERAL_RULES = $(WM_DIR)/rules/General
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
GENERAL_RULES = $(WM_DIR)/rules/General
include $(GENERAL_RULES)/general
include $(RULES)/general
#------------------------------------------------------------------------------
# declare names of make system control files derived from file 'files'
#------------------------------------------------------------------------------
OPTIONS = $(OBJECTS_DIR)/options
FILES = $(OBJECTS_DIR)/files
VARS = $(OBJECTS_DIR)/variables
SFILES = $(OBJECTS_DIR)/sourceFiles
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
OPTIONS = $(OBJECTS_DIR)/options
FILES = $(OBJECTS_DIR)/files
VARS = $(OBJECTS_DIR)/variables
SFILES = $(OBJECTS_DIR)/sourceFiles
-include $(OPTIONS)
#------------------------------------------------------------------------------
# Declare dependecy of all make system files on FILES
# Causes all derived files to be remade if any are changed or missing
......@@ -74,4 +73,5 @@ $(SFILES): $(MAKE_DIR)/files
$(VARS): $(SFILES)
#------------------------------------------------------------------------------
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -33,7 +33,7 @@
# The Makefile uses a POSIX shell
#------------------------------------------------------------------------------
SHELL = /bin/sh
SHELL = /bin/sh
#------------------------------------------------------------------------------
......@@ -47,29 +47,29 @@ SHELL = /bin/sh
# Set the directory containing the wmake scripts
#------------------------------------------------------------------------------
WM_SCRIPTS = $(WM_DIR)/scripts
WM_SCRIPTS = $(WM_DIR)/scripts
#------------------------------------------------------------------------------
# Declare default paths
#------------------------------------------------------------------------------
LIB_SRC = $(WM_PROJECT_DIR)/src
LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
LIB_SRC = $(WM_PROJECT_DIR)/src
LIB_PLATFORMS = $(WM_PROJECT_DIR)/platforms/$(WM_OPTIONS)/lib
OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
SYS_INC =
SYS_LIBS =
SYS_INC =
SYS_LIBS =
PROJECT_INC = -I$(LIB_SRC)/$(WM_PROJECT)/lnInclude \
PROJECT_INC = -I$(LIB_SRC)/$(WM_PROJECT)/lnInclude \
-I$(LIB_SRC)/OSspecific/$(WM_OSTYPE)/lnInclude
PROJECT_LIBS = -l$(WM_PROJECT)
PROJECT_LIBS = -l$(WM_PROJECT)
EXE_INC =
EXE_LIBS =
EXE_INC =
EXE_LIBS =
LIB_LIBS =
LIB_LIBS =
#------------------------------------------------------------------------------
......@@ -94,13 +94,7 @@ SEXE = a.out
#------------------------------------------------------------------------------
GENERAL_RULES = $(WM_DIR)/rules/General
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)
include $(GENERAL_RULES)/general
include $(RULES)/general
include $(RULES)/$(WM_LINK_LANGUAGE)
include $(GENERAL_RULES)/transform
#------------------------------------------------------------------------------
......
......@@ -12,4 +12,17 @@ GINC =
GLIBS = -lm
GLIB_LIBS =
COMPILER_TYPE = $(shell echo $(WM_COMPILER) | tr -d [:digit:])
DEFAULT_RULES = $(WM_DIR)/rules/$(WM_ARCH)$(COMPILER_TYPE)
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)
include $(DEFAULT_RULES)/general
include $(DEFAULT_RULES)/$(WM_LINK_LANGUAGE)
-include $(RULES)/general
-include $(RULES)/$(WM_LINK_LANGUAGE)
include $(GENERAL_RULES)/transform
#------------------------------------------------------------------------------
......@@ -4,7 +4,7 @@ cWARN = -Wall
cc = clang -m64
include $(RULES)/c$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
......
......@@ -7,7 +7,7 @@ c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-tautological-u
CC = clang++ -std=c++0x -m64
include $(RULES)/c++$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository -ftemplate-depth-100
......
......@@ -4,5 +4,5 @@ PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard
include $(RULES)/c
include $(RULES)/c++
include $(DEFAULT_RULES)/c
include $(DEFAULT_RULES)/c++
......@@ -4,7 +4,7 @@ cWARN = -Wall
cc = gcc -m64
include $(RULES)/c$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
......
......@@ -7,7 +7,7 @@ c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
CC = g++ -std=c++0x -m64
include $(RULES)/c++$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository -ftemplate-depth-100
......
......@@ -4,5 +4,5 @@ PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard
include $(RULES)/c
include $(RULES)/c++
include $(DEFAULT_RULES)/c
include $(DEFAULT_RULES)/c++
linux64Gcc
\ No newline at end of file
linux64Gcc
\ No newline at end of file
linux64Gcc
\ No newline at end of file
linux64Gcc
\ No newline at end of file
linux64Gcc
\ No newline at end of file
linux64Gcc
\ No newline at end of file
......@@ -4,7 +4,7 @@ cWARN =
cc = icc
include $(RULES)/c$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
......
......@@ -8,7 +8,7 @@ c++LESSWARN = -diag-disable 1224,2026,2305
CC = icpc -std=c++0x -fp-trap=common -fp-model precise
include $(RULES)/c++$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository
......
......@@ -4,5 +4,5 @@ PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard
include $(RULES)/c
include $(RULES)/c++
include $(DEFAULT_RULES)/c
include $(DEFAULT_RULES)/c++
......@@ -4,7 +4,7 @@ cWARN = -Wall
cc = gcc
include $(RULES)/c$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
......
......@@ -7,7 +7,7 @@ c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
CC = g++ -std=c++0x
include $(RULES)/c++$(WM_COMPILE_OPTION)
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository -ftemplate-depth-100
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment