OSDN Git Service

Merge upstream to r134237 at Fri. 1st July 2011.
[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 # 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 endif
23
24 ifeq ($(LLVM_ENABLE_ASSERTION),true)
25 LOCAL_CFLAGS := \
26         -D_DEBUG        \
27         -UNDEBUG        \
28         $(LOCAL_CFLAGS)
29 endif
30
31 ifneq ($(REQUIRES_EH),1)
32 LOCAL_CFLAGS += -fno-exceptions
33 else
34 # No action. The device target should not have exception enabled since bionic
35 # doesn't support it
36 REQUIRES_EH := 0
37 endif
38
39 ifneq ($(REQUIRES_RTTI),1)
40 LOCAL_CPPFLAGS +=       -fno-rtti
41 else
42 REQUIRES_RTTI := 0
43 endif
44
45 LOCAL_CPPFLAGS :=       \
46         $(LOCAL_CPPFLAGS)       \
47         -Woverloaded-virtual    \
48         -Wno-sign-promo   
49
50 # Make sure bionic is first so we can include system headers.
51 LOCAL_C_INCLUDES :=     \
52         $(LLVM_ROOT_PATH)       \
53         $(LLVM_ROOT_PATH)/include       \
54         $(LLVM_ROOT_PATH)/device/include        \
55         $(LOCAL_C_INCLUDES)
56
57 ifneq ($(TARGET_SIMULATOR),true)
58 LOCAL_C_INCLUDES := \
59         bionic \
60         external/stlport/stlport \
61         $(LOCAL_C_INCLUDES)
62 endif
63
64 ###########################################################
65 ## Commands for running tblgen to compile a td file
66 ###########################################################
67 define transform-device-td-to-out
68 @mkdir -p $(dir $@)
69 @echo "Device TableGen (gen-$(1)): $(LOCAL_MODULE) <= $<"
70 $(hide) $(TBLGEN) \
71         -I $(dir $<)    \
72         -I $(LLVM_ROOT_PATH)/include    \
73         -I $(LLVM_ROOT_PATH)/device/include     \
74         -I $(LLVM_ROOT_PATH)/lib/Target \
75     -gen-$(strip $(1)) \
76     -o $@ $<
77 endef