OSDN Git Service

Fix darwin build due to deprecated sbrk declaration.
[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 LOCAL_CFLAGS_linux += -Werror
20 LOCAL_CFLAGS_darwin += -Werror
21
22 # The three inline options together reduce libbcc.so almost 1MB.
23 # We move them from global build/core/combo/TARGET_linux-arm.mk
24 # to here.
25 LOCAL_CFLAGS := -DANDROID_TARGET_BUILD \
26                 -finline-functions \
27                 $(LOCAL_CFLAGS)
28
29 ifeq ($(TARGET_BUILD_VARIANT),eng)
30 LOCAL_CFLAGS := -DANDROID_ENGINEERING_BUILD \
31                 $(LOCAL_CFLAGS)
32 endif
33
34 ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
35 LOCAL_CFLAGS := \
36         $(LOCAL_CFLAGS) \
37         -D_DEBUG        \
38         -UNDEBUG
39 endif
40
41 ifneq ($(REQUIRES_EH),1)
42 LOCAL_CFLAGS += -fno-exceptions
43 else
44 # No action. The device target should not have exception enabled since bionic
45 # doesn't support it
46 REQUIRES_EH := 0
47 endif
48
49 ifneq ($(REQUIRES_RTTI),1)
50 LOCAL_CPPFLAGS +=       -fno-rtti
51 else
52 REQUIRES_RTTI := 0
53 endif
54
55 LOCAL_CPPFLAGS :=       \
56         $(LOCAL_CPPFLAGS)       \
57         -Woverloaded-virtual    \
58         -Wno-sign-promo         \
59         -std=c++11
60
61 # Make sure bionic is first so we can include system headers.
62 LOCAL_C_INCLUDES :=     \
63         bionic \
64         $(LLVM_ROOT_PATH)       \
65         $(LLVM_ROOT_PATH)/include       \
66         $(LLVM_ROOT_PATH)/device/include        \
67         $(LOCAL_C_INCLUDES)
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