OSDN Git Service

android: R600(AMDGPU)/AsmParser: fix tblgen related building errors
[android-x86/external-llvm.git] / llvm-host-build.mk
1 # Windows can't use Clang to build yet
2 ifneq ($(HOST_OS),windows)
3 LOCAL_CLANG := true
4 endif
5
6 LOCAL_CFLAGS += \
7         -D_GNU_SOURCE   \
8         -D__STDC_LIMIT_MACROS   \
9         -O2     \
10         -fomit-frame-pointer    \
11         -Wall   \
12         -W      \
13         -Wno-unused-parameter   \
14         -Wwrite-strings \
15         -Dsprintf=sprintf \
16         $(LOCAL_CFLAGS)
17
18 ifeq ($(LLVM_ENABLE_ASSERTION),true)
19 LOCAL_CFLAGS := \
20         $(LOCAL_CFLAGS) \
21         -D_DEBUG        \
22         -UNDEBUG
23 endif
24
25 ifneq ($(REQUIRES_EH),1)
26 LOCAL_CFLAGS += -fno-exceptions
27 else
28 REQUIRES_EH := 0
29 LOCAL_CFLAGS += -fexceptions
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         -Wno-sign-promo         \
42         -std=c++11
43
44 # Make sure bionic is first so we can include system headers.
45 LOCAL_C_INCLUDES :=     \
46         $(LLVM_ROOT_PATH)       \
47         $(LLVM_ROOT_PATH)/include       \
48         $(LLVM_ROOT_PATH)/host/include  \
49         $(LOCAL_C_INCLUDES)
50
51 # Add on ncurses to have support for terminfo
52 ifneq ($(HOST_OS),windows)
53 LOCAL_LDLIBS += -lncurses
54 ifneq ($(HOST_OS),darwin)
55 LOCAL_LDLIBS += -lgcc_s
56 endif
57 endif
58
59 LOCAL_IS_HOST_MODULE := true
60
61 ifeq ($(HOST_PREFER_32_BIT),true)
62 LOCAL_MULTILIB := 32
63 else
64 LOCAL_MULTILIB := first
65 endif
66
67 ###########################################################
68 ## Commands for running tblgen to compile a td file
69 ###########################################################
70 define transform-host-td-to-out
71 @mkdir -p $(dir $@)
72 @echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
73 $(hide) $(LLVM_TBLGEN) \
74         -I $(dir $<)    \
75         -I $(LLVM_ROOT_PATH)/include    \
76         -I $(LLVM_ROOT_PATH)/host/include       \
77         -I $(LLVM_ROOT_PATH)/lib/Target \
78         $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)        \
79         -gen-$(strip $(1))      \
80         -o $@ $<
81 endef