summaryrefslogtreecommitdiff
path: root/makefiles/Makefile.clang
blob: 9f14547fcbadbaa044ba5b0f5ae53e7269987dd8 (plain)
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
# Clang-specific toolchain setup
# We assume that we're using a standard GCC/binutils environment, as well
# as clang being mostly GCC-compatible on the command line

CCDEF := -D
CCOPT := -O2
CCNOOPT := -O0
CCDBG := -g
CCINC := -I
CCLIB := -L
CCAS := -xassembler-with-cpp
CCSHR := -fPIC

CXXDEF := -D
CXXOPT := -O2
CXXNOOPT := -O0
CXXDBG := -g
CXXINC := -I
CXXLIB := -L
CXXSHR := -fPIC

LDDBG := -g
# Reevaluation is required here
LDSHR = -shared -Wl,-soname,$(SONAME)

ARFLG := cru

# Definitions of various attributes
CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"

###############################################################################
# Mac OS X Universal Binaries
###############################################################################

ifeq ($(TARGET),Darwin)
	ifneq ($(UNIVERSAL),)
		UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
		
		CFLAGS := $(CFLAGS) $(UNIVERSAL_FLAGS)
		LDFLAGS := $(LDFLAGS) $(UNIVERSAL_FLAGS)
		CXXFLAGS := $(CXXFLAGS) $(UNIVERSAL_FLAGS)
		ARFLAGS := $(ARFLAGS) -s 
	endif
endif

###############################################################################
# Other settings
###############################################################################

CC_CAN_BUILD_AND_DEP ?= yes