OSDN Git Service

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