Commit 787325a9 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

COMP: manage cpu architecture with cARCH, c++ARCH internal make variables

- allows better separation from compiler settings

- use -fPIC instead of legacy -KPIC for intel compiler
parent 09cf9d99
......@@ -65,24 +65,32 @@ ext-so:
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: c
c:
@echo "$(firstword $(cc))"
.PHONY: cxx
cxx:
@echo "$(firstword $(CC))"
.PHONY: cflags
cflags:
@echo "$(wordlist 2,$(words $(COMPILE_C)), $(COMPILE_C))"
.PHONY: cxxflags
cxxflags:
@echo "$(wordlist 2,$(words $(COMPILE_CXX)), $(COMPILE_CXX))"
.PHONY: cflags-arch
cflags-arch:
@echo "$(strip $(cARCH))"
.PHONY: cxxflags-arch
cxxflags-arch:
@echo "$(strip $(c++ARCH))"
#----------------------------- vim: set ft=make: ------------------------------
......@@ -2,6 +2,7 @@ SUFFIXES += .c
cc = clang
cARCH =
cDBUG =
cOPT = -O2
cWARN = -Wall
......@@ -2,6 +2,7 @@ SUFFIXES += .C .cc .cpp .cxx
CC = clang++ -std=c++11
c++ARCH =
c++DBUG =
c++OPT = -O2
ptFLAGS = -DNoRepository -ftemplate-depth-100
......
......@@ -2,6 +2,7 @@ SUFFIXES += .c
cc = gcc
cARCH =
cDBUG =
cOPT = -O2
cWARN = -Wall
......@@ -2,6 +2,7 @@ SUFFIXES += .C .cc .cpp .cxx
CC = g++ -std=c++11
c++ARCH =
c++DBUG =
c++OPT = -O2
ptFLAGS = -DNoRepository -ftemplate-depth-100
......
......@@ -2,6 +2,7 @@ SUFFIXES += .c
cc = icc
cARCH =
cDBUG =
cOPT = -O2
cWARN =
......@@ -2,6 +2,7 @@ SUFFIXES += .C .cc .cpp .cxx
CC = icpc -std=c++11
c++ARCH =
c++DBUG =
c++OPT = -O2
ptFLAGS = -DNoRepository
......
......@@ -2,6 +2,7 @@ SUFFIXES += .c
cc = pgcc
cARCH =
cDBUG =
cOPT = -O2
cWARN =
......@@ -2,6 +2,7 @@ SUFFIXES += .C .cc .cpp .cxx
CC = pgc++ -std=c++11
c++ARCH =
c++DBUG =
c++OPT = -O2
ptFLAGS = -DNoRepository
......
include $(GENERAL_RULES)/Clang/c
cc = clang -m64 -Ddarwin -ftrapping-math
cARCH = -m64 -ftrapping-math
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
LINK_LIBS = $(cDBUG)
LINKLIBSO = $(cc) -Wl,-dylib,-undefined,dynamic_lookup
LINKEXE = $(cc) -Wl,-execute,-undefined,dynamic_lookup
LINKLIBSO = $(cc) $(cARCH) -Wl,-dylib,-undefined,dynamic_lookup
LINKEXE = $(cc) $(cARCH) -Wl,-execute,-undefined,dynamic_lookup
include $(GENERAL_RULES)/Clang/c++
CC = clang++ -std=c++11 -m64 -Ddarwin -ftrapping-math
c++ARCH = -m64 -ftrapping-math
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
cxxtoo = $(Ctoo)
......
......@@ -11,4 +11,7 @@ include $(DEFAULT_RULES)/c++
# Shared library extension (with '.' separator)
EXT_SO = .dylib
# Define general os-type
GFLAGS += -Ddarwin
# -----------------------------------------------------------------------------
include $(GENERAL_RULES)/Clang/c
cc = clang -m64
cARCH = -m64
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
LINK_LIBS = $(cDBUG)
LINKLIBSO = $(cc) -shared
LINKEXE = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
LINKLIBSO = $(cc) $(cARCH) -shared
LINKEXE = $(cc) $(cARCH) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
include $(GENERAL_RULES)/Clang/c++
CC = clang++ -std=c++11 -m64
c++ARCH = -m64
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
cxxtoo = $(Ctoo)
......
SUFFIXES += .c
cc = cc -m64
cc = cc
cARCH = -m64
cWARN = -Wall
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
LINK_LIBS = $(cDBUG)
LINKLIBSO = $(cc) -shared
LINKEXE = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
LINKLIBSO = $(cc) $(cARCH) -shared
LINKEXE = $(cc) $(cARCH) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
include $(GENERAL_RULES)/Gcc/c++
CC = CC -std=c++11 -m64
CC = CC -std=c++11
c++ARCH = -m64
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
cxxtoo = $(Ctoo)
......
include $(GENERAL_RULES)/Gcc/c
cc = gcc -m64
cARCH = -m64
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
LINK_LIBS = $(cDBUG)
LINKLIBSO = $(cc) -shared
LINKEXE = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
LINKLIBSO = $(cc) $(cARCH) -shared
LINKEXE = $(cc) $(cARCH) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
include $(GENERAL_RULES)/Gcc/c++
CC = g++ -std=c++11 -m64
c++ARCH = -m64
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
cxxtoo = $(Ctoo)
......
include $(GENERAL_RULES)/Icc/c
cc = icc
cARCH =
include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
cFLAGS = $(cARCH) $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $< -o $@
......
include $(GENERAL_RULES)/Icc/c++
CC = icpc -std=c++11 -fp-trap=common -fp-model precise
c++ARCH = -fp-trap=common -fp-model precise
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
cxxtoo = $(Ctoo)
......
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