forked from GLSL-Debugger/GLSL-Debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.mk
More file actions
83 lines (71 loc) · 1.61 KB
/
common.mk
File metadata and controls
83 lines (71 loc) · 1.61 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
OPTIMIZATIONS = ON
#OPTIMIZATIONS = OFF
#CROSS_BUILD = ON
# determine presence of Intel C/C++ compiler
ifeq ($(shell which icc >& /dev/null && echo exists),exists)
CC = icc
CXX = icc
else
CC = gcc
CXX = g++
endif
# build architecture
ARCH := $(shell uname -m | sed 's/i.86/i386/')
# cross build?
ifeq ($(CROSS_BUILD),ON)
ifeq ($(ARCH),x86_64)
ARCH = i386
CROSS_COMPILE_FLAG = -m32
else
ARCH = x86_64
CROSS_COMPILE_FLAG = -m64
endif
endif
ifeq ($(ARCH),x86_64)
POSTFIX = 64
ARCHLIB = lib64
else
POSTFIX = 32
ARCHLIB = lib
endif
# library tools
AR = ar
ARFLAGS = rcs
RANLIB = ranlib
# other tools
PERL = perl
RM = rm -f
MV = mv -f
# Qt tools
MOC = $(QTDIR)/bin/moc
RCC = $(QTDIR)/bin/rcc
UIC = $(QTDIR)/bin/uic
# compiler and linker flags
CFLAGS = -fPIC $(CROSS_COMPILE_FLAG)
CXXFLAGS = -std=c++0x -fPIC -DUNIX $(CROSS_COMPILE_FLAG)
LDFLAGS = -fPIC $(CROSS_COMPILE_FLAG)
ifeq ($(CC),icc)
# icc options (NOTE: requires sse2 and creates alternative codepaths for
# modern Intel processors)
LDFLAGS += -static-intel
DBGCFLAGS = -ggdb -O0
OPTCFLAGS = -O3 -xW -axPT -no-prec-div -finline-functions -unroll -parallel \
-par-runtime-control
# needed to force icc to add .note.GNU-stack ELF sections :-/
OPTCFLAGS += -use-asm
OPTLDFLAGS = $(OPTCFLAGS)
else
# gcc options
DBGCFLAGS = -DDEBUG -ggdb -O0
OPTCFLAGS = -O3 -finline-functions -funroll-loops -fprefetch-loop-arrays -ffast-math
OPTLDFLAGS =
endif
ifeq ($(OPTIMIZATIONS),ON)
CFLAGS += $(OPTCFLAGS)
CXXFLAGS += $(OPTCFLAGS)
LDFLAGS += $(OPTLDFLAGS)
else
CFLAGS += $(DBGCFLAGS)
CXXFLAGS += $(DBGCFLAGS)
endif
DEFINE = -Dlinux