OSDN Git Service

am 3fa16bd6: Merge "Update aosp/master LLVM for rebase to r230699."
[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 ###########################################################
62 ## Commands for running tblgen to compile a td file
63 ###########################################################
64 define transform-host-td-to-out
65 @mkdir -p $(dir $@)
66 @echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
67 $(hide) $(LLVM_TBLGEN) \
68         -I $(dir $<)    \
69         -I $(LLVM_ROOT_PATH)/include    \
70         -I $(LLVM_ROOT_PATH)/host/include       \
71         -I $(LLVM_ROOT_PATH)/lib/Target \
72         $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)        \
73         -gen-$(strip $(1))      \
74         -o $@ $<
75 endef