OSDN Git Service

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