OSDN Git Service

Merge commit '69494cf8102cf872e9cb76662e9960be7c112112' into HEAD
[android-x86/external-llvm.git] / llvm-device-build.mk
1 LOCAL_CFLAGS := \
2         -D_GNU_SOURCE   \
3         -D__STDC_LIMIT_MACROS   \
4         -D__STDC_CONSTANT_MACROS        \
5         -O2     \
6         -fomit-frame-pointer    \
7         -Wall   \
8         -W      \
9         -Wno-unused-parameter   \
10         -Wwrite-strings \
11         $(LOCAL_CFLAGS)
12
13 ifneq ($(TARGET_SIMULATOR),true)
14 LOCAL_CFLAGS := -DANDROID_TARGET_BUILD $(LOCAL_CFLAGS)
15 endif
16
17 ifeq ($(LLVM_ENABLE_ASSERTION),true)
18 LOCAL_CFLAGS := \
19         -D_DEBUG        \
20         -UNDEBUG        \
21         $(LOCAL_CFLAGS)
22 endif
23
24 ifneq ($(REQUIRES_EH),1)
25 LOCAL_CFLAGS += -fno-exceptions
26 else
27 # No action. The device target should not have exception enabled since bionic
28 # doesn't support it
29 REQUIRES_EH := 0
30 endif
31
32 ifneq ($(REQUIRES_RTTI),1)
33 LOCAL_CPPFLAGS +=       -fno-rtti
34 else
35 REQUIRES_RTTI := 0
36 endif
37
38 LOCAL_CPPFLAGS :=       \
39         $(LOCAL_CPPFLAGS)       \
40         -Woverloaded-virtual
41
42 # Make sure bionic is first so we can include system headers.
43 LOCAL_C_INCLUDES :=     \
44         $(LLVM_ROOT_PATH)       \
45         $(LLVM_ROOT_PATH)/include       \
46         $(LLVM_ROOT_PATH)/device/include        \
47         $(LOCAL_C_INCLUDES)
48
49 ifneq ($(TARGET_SIMULATOR),true)
50 LOCAL_C_INCLUDES := \
51         bionic \
52         external/stlport/stlport \
53         $(LOCAL_C_INCLUDES)
54 endif
55
56 ###########################################################
57 ## Commands for running tblgen to compile a td file
58 ###########################################################
59 define transform-device-td-to-out
60 @mkdir -p $(dir $@)
61 @echo "Device TableGen (gen-$(1)): $(LOCAL_MODULE) <= $<"
62 $(hide) $(TBLGEN) \
63         -I $(dir $<)    \
64         -I $(LLVM_ROOT_PATH)/include    \
65         -I $(LLVM_ROOT_PATH)/device/include     \
66         -I $(LLVM_ROOT_PATH)/lib/Target \
67     -gen-$(strip $(1)) \
68     -o $@ $<
69 endef