OSDN Git Service

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