OSDN Git Service

Update LLVM to svn 144354.
[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         -D__STDC_FORMAT_MACROS  \
6         -O2     \
7         -fomit-frame-pointer    \
8         -Wall   \
9         -W      \
10         -Wno-unused-parameter   \
11         -Wwrite-strings \
12         $(LOCAL_CFLAGS)
13
14 # The three inline options together reduce libbcc.so almost 1MB.
15 # We move them from global build/core/combo/TARGET_linux-arm.mk
16 # to here.
17 LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
18                 -finline-limit=64 \
19                 -finline-functions \
20                 -fno-inline-functions-called-once \
21                 $(LOCAL_CFLAGS)
22
23 ifeq ($(LLVM_ENABLE_ASSERTION),true)
24 LOCAL_CFLAGS := \
25         -D_DEBUG        \
26         -UNDEBUG        \
27         $(LOCAL_CFLAGS)
28 endif
29
30 ifneq ($(REQUIRES_EH),1)
31 LOCAL_CFLAGS += -fno-exceptions
32 else
33 # No action. The device target should not have exception enabled since bionic
34 # doesn't support it
35 REQUIRES_EH := 0
36 endif
37
38 ifneq ($(REQUIRES_RTTI),1)
39 LOCAL_CPPFLAGS +=       -fno-rtti
40 else
41 REQUIRES_RTTI := 0
42 endif
43
44 LOCAL_CPPFLAGS :=       \
45         $(LOCAL_CPPFLAGS)       \
46         -Woverloaded-virtual    \
47         -Wno-sign-promo   
48
49 # Make sure bionic is first so we can include system headers.
50 LOCAL_C_INCLUDES :=     \
51         bionic \
52         external/stlport/stlport \
53         $(LLVM_ROOT_PATH)       \
54         $(LLVM_ROOT_PATH)/include       \
55         $(LLVM_ROOT_PATH)/device/include        \
56         $(LOCAL_C_INCLUDES)
57
58 ###########################################################
59 ## Commands for running tblgen to compile a td file
60 ###########################################################
61 define transform-device-td-to-out
62 @mkdir -p $(dir $@)
63 @echo "Device TableGen (gen-$(1)): $(LOCAL_MODULE) <= $<"
64 $(hide) $(TBLGEN) \
65         -I $(dir $<)    \
66         -I $(LLVM_ROOT_PATH)/include    \
67         -I $(LLVM_ROOT_PATH)/device/include     \
68         -I $(LLVM_ROOT_PATH)/lib/Target \
69     -gen-$(strip $(1)) \
70     -o $@ $<
71 endef