OSDN Git Service

Merge "We need to build the ARM components for AArch64 as well."
[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 include external/libcxx/libcxx.mk
7
8 LOCAL_CFLAGS += \
9         -D_GNU_SOURCE   \
10         -D__STDC_LIMIT_MACROS   \
11         -O2     \
12         -fomit-frame-pointer    \
13         -Wall   \
14         -W      \
15         -Wno-unused-parameter   \
16         -Wwrite-strings \
17         -Dsprintf=sprintf \
18         $(LOCAL_CFLAGS)
19
20 ifeq ($(LLVM_ENABLE_ASSERTION),true)
21 LOCAL_CFLAGS := \
22         $(LOCAL_CFLAGS) \
23         -D_DEBUG        \
24         -UNDEBUG
25 endif
26
27 ifneq ($(REQUIRES_EH),1)
28 LOCAL_CFLAGS += -fno-exceptions
29 else
30 REQUIRES_EH := 0
31 LOCAL_CFLAGS += -fexceptions
32 endif
33
34 ifneq ($(REQUIRES_RTTI),1)
35 LOCAL_CPPFLAGS += -fno-rtti
36 else
37 REQUIRES_RTTI := 0
38 endif
39
40 LOCAL_CPPFLAGS :=       \
41         $(LOCAL_CPPFLAGS)       \
42         -Woverloaded-virtual    \
43         -Wno-sign-promo         \
44         -std=c++11
45
46 # Make sure bionic is first so we can include system headers.
47 LOCAL_C_INCLUDES :=     \
48         $(LLVM_ROOT_PATH)       \
49         $(LLVM_ROOT_PATH)/include       \
50         $(LLVM_ROOT_PATH)/host/include  \
51         external/libcxx/include \
52         $(LOCAL_C_INCLUDES)
53
54 LOCAL_IS_HOST_MODULE := true
55
56 ###########################################################
57 ## Commands for running tblgen to compile a td file
58 ###########################################################
59 define transform-host-td-to-out
60 @mkdir -p $(dir $@)
61 @echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
62 $(hide) $(TBLGEN) \
63         -I $(dir $<)    \
64         -I $(LLVM_ROOT_PATH)/include    \
65         -I $(LLVM_ROOT_PATH)/host/include       \
66         -I $(LLVM_ROOT_PATH)/lib/Target \
67         $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)        \
68         -gen-$(strip $(1))      \
69         -o $@ $<
70 endef