OSDN Git Service

Fix llvm.mk and the other 49 mk files
[android-x86/external-llvm.git] / llvm-device-build.mk
1 # Only use this on the device or emulator.
2 ifneq ($(TARGET_ARCH),arm)
3
4 LOCAL_CFLAGS := \
5         -D_GNU_SOURCE   \
6         -D__STDC_LIMIT_MACROS   \
7         -D__STDC_CONSTANT_MACROS        \
8         -DANDROID_TARGET_BUILD  \
9         -O2     \
10         -fomit-frame-pointer    \
11         -Wall   \
12         -W      \
13         -Wno-unused-parameter   \
14         -Wwrite-strings \
15         $(LOCAL_CFLAGS)
16
17 ifeq ($(LLVM_ENABLE_ASSERTION),true)
18 LOCAL_CFLAGS := \
19         -D_DEBUG        \
20         -UNDEBUG        \
21         $(LOCAL_CFLAGS)
22 endif
23
24 ifneq ($(REQUIRES_EH),1)
25 LOCAL_CFLAGS += -fno-exceptions
26 else
27 # No action. The device target should not have exception enabled since bionic
28 # doesn't support it
29 REQUIRES_EH := 0
30 endif
31
32 ifneq ($(REQUIRES_RTTI),1)
33 LOCAL_CPPFLAGS +=       -fno-rtti
34 else
35 REQUIRES_RTTI := 0
36 endif
37
38 LOCAL_CPPFLAGS :=       \
39         $(LOCAL_CPPFLAGS)       \
40         -Woverloaded-virtual
41
42 # Make sure bionic is first so we can include system headers.
43 LOCAL_C_INCLUDES :=     \
44         bionic  \
45         external/stlport/stlport        \
46         $(LLVM_ROOT_PATH)       \
47         $(LLVM_ROOT_PATH)/include       \
48         $(LLVM_ROOT_PATH)/device/include        \
49         $(LOCAL_C_INCLUDES)
50
51 ###########################################################
52 ## Commands for running tblgen to compile a td file
53 ###########################################################
54 define transform-device-td-to-out
55 @mkdir -p $(dir $@)
56 @echo "Device TableGen (gen-$(1)): $(LOCAL_MODULE) <= $<"
57 $(hide) $(TBLGEN) \
58         -I $(dir $<)    \
59         -I $(LLVM_ROOT_PATH)/include    \
60         -I $(LLVM_ROOT_PATH)/device/include     \
61         -I $(LLVM_ROOT_PATH)/lib/Target \
62     -gen-$(strip $(1)) \
63     -o $@ $<
64 endef
65
66 endif