-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.common
63 lines (50 loc) · 1.69 KB
/
Makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
####################################
# Please review compilation options
####################################
# 1. Change this to your compiler (g++ 4.1 is recommended). If you're not using g++, check for equivalent options below.
CXX=g++
# 2. Set the correct type for your architecture
# 2a: One of:
#STREFLOP_SSE = 1
STREFLOP_X87 = 1
#STREFLOP_SOFT = 1
# 2b. And optionally:
#STREFLOP_NO_DENORMALS = 1
# 3. Set optimization options. You may add -march=you_cpu here for example
CXXFLAGS = -O3 -pipe -g -frename-registers
#CXXFLAGS = -O0 -pipe -g
############################################################
# Options you may review if using another compiler than g++
############################################################
# 4. Optional, removes false dependency on libm
LDFLAGS=-Wl,--as-needed
# Options for correctness of code.
# -ffloat-store is not needed since the FPU flags are set by the streflop_init functions
CXXFLAGS += -frounding-math -fsignaling-nans -fno-strict-aliasing -mieee-fp -Wall
# The next options should match/select the FPU
ifdef STREFLOP_X87
CXXFLAGS += -mfpmath=387
endif
ifdef STREFLOP_SSE
CXXFLAGS += -mfpmath=sse -msse -msse2
endif
###############################################
# You should not need to change anything below
###############################################
ifdef STREFLOP_X87
CPPFLAGS += -DSTREFLOP_X87=1
endif
ifdef STREFLOP_SSE
CPPFLAGS += -DSTREFLOP_SSE=1
endif
ifdef STREFLOP_SOFT
CPPFLAGS += -DSTREFLOP_SOFT=1
endif
ifdef STREFLOP_NO_DENORMALS
CPPFLAGS += -DSTREFLOP_NO_DENORMALS=1
endif
# Implicit rule for compiling the libm conversion to C++
%.o : %.cpp
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@
# Version for the package name
STREFLOP_VERSION = 0.3