• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_CFLAGS +=	\
2	-D_GNU_SOURCE	\
3	-D__STDC_LIMIT_MACROS	\
4	-fomit-frame-pointer	\
5	-Wall	\
6	-W	\
7	-Wno-sign-compare \
8	-Wno-unused-parameter	\
9	-Wno-maybe-uninitialized \
10	-Wno-missing-field-initializers \
11	-Wwrite-strings	\
12	-Werror \
13	-Dsprintf=sprintf \
14	$(LOCAL_CFLAGS)
15
16# Disable certain warnings for use with mingw.
17# We also must undefine WIN32_LEAN_AND_MEAN, since it is being passed globally
18# on the command line, and LLVM defines this internally itself.
19LOCAL_CFLAGS_windows += -Wno-array-bounds \
20			-Wno-comment \
21			-UWIN32_LEAN_AND_MEAN
22
23# Enable debug build only on Linux and Darwin
24ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
25LOCAL_CFLAGS_linux += -O0 -g
26LOCAL_CFLAGS_darwin += -O0 -g
27endif
28
29ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
30LOCAL_CFLAGS :=	\
31	$(LOCAL_CFLAGS) \
32	-D_DEBUG	\
33	-UNDEBUG
34endif
35
36LOCAL_CFLAGS += -fno-exceptions
37LOCAL_CPPFLAGS += -fno-rtti
38
39LOCAL_CPPFLAGS :=	\
40	$(LOCAL_CPPFLAGS)	\
41	-Wno-sign-promo         \
42	-std=c++11
43
44LOCAL_CPPFLAGS_linux := \
45	-Woverloaded-virtual
46
47LOCAL_CPPFLAGS_darwin += \
48	-Wno-deprecated-declarations \
49	-Woverloaded-virtual
50
51# Make sure bionic is first so we can include system headers.
52LOCAL_C_INCLUDES :=	\
53	$(LLVM_ROOT_PATH)	\
54	$(LLVM_ROOT_PATH)/include	\
55	$(LLVM_ROOT_PATH)/host/include	\
56	$(LOCAL_C_INCLUDES)
57
58# Add on ncurses to have support for terminfo
59LOCAL_LDLIBS_darwin += -lncurses
60LOCAL_LDLIBS_linux += -lncurses
61LOCAL_LDLIBS_linux += -lgcc_s
62LOCAL_LDLIBS_windows += -luuid
63
64LOCAL_IS_HOST_MODULE := true
65
66ifeq (libLLVM, $(filter libLLVM,$(LOCAL_SHARED_LIBRARIES)$(LOCAL_SHARED_LIBRARIES_$(HOST_OS))))
67# Skip building a 32-bit shared object if they are using libLLVM.
68LOCAL_MULTILIB := first
69endif
70
71###########################################################
72## Commands for running tblgen to compile a td file
73###########################################################
74define transform-host-td-to-out
75@mkdir -p $(dir $@)
76@echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
77$(hide) $(LLVM_TBLGEN) \
78	-I $(dir $<)	\
79	-I $(LLVM_ROOT_PATH)/include	\
80	-I $(LLVM_ROOT_PATH)/host/include	\
81	-I $(LLVM_ROOT_PATH)/lib/Target	\
82	$(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)	\
83	-gen-$(strip $(1))	\
84	-d $@.d -o $@ $<
85endef
86