OSDN Git Service

Fix build for mesa 13.0+
[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         external/libcxx/include \
62         $(LLVM_ROOT_PATH)       \
63         $(LLVM_ROOT_PATH)/include       \
64         $(LLVM_ROOT_PATH)/device/include        \
65         $(LOCAL_C_INCLUDES)
66
67 include external/libcxx/libcxx.mk
68
69 ###########################################################
70 ## Commands for running tblgen to compile a td file
71 ###########################################################
72 define transform-device-td-to-out
73 @mkdir -p $(dir $@)
74 @echo "Device TableGen (gen-$(1)): $(TBLGEN_LOCAL_MODULE) <= $<"
75 $(hide) $(LLVM_TBLGEN) \
76         -I $(dir $<)    \
77         -I $(LLVM_ROOT_PATH)/include    \
78         -I $(LLVM_ROOT_PATH)/device/include     \
79         -I $(LLVM_ROOT_PATH)/lib/Target \
80     -gen-$(strip $(1)) \
81     -o $@ $<
82 endef