OSDN Git Service

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