blob: 618ed4cee372c8776ee4eeb6169903af8674cfaa [file] [log] [blame]
Shih-wei Liaoea285162010-06-04 12:34:56 -07001LOCAL_CFLAGS := \
2 -pedantic \
3 -Wcast-qual \
4 -Wno-long-long \
5 $(LOCAL_CFLAGS)
6
Logan9c64df22011-02-15 06:27:21 +08007LOCAL_CPPFLAGS := \
8 -Wno-sign-promo \
9 $(LOCAL_CPPFLAGS)
10
David Gross16f34832015-06-12 14:28:01 -070011ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
Pirama Arumuga Nainar235e9902015-02-23 09:53:16 -080012LOCAL_CFLAGS := \
13 $(LOCAL_CFLAGS) \
14 -D_DEBUG \
15 -UNDEBUG
16endif
17
David Gross16f34832015-06-12 14:28:01 -070018ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
19LOCAL_CFLAGS := \
20 $(LOCAL_CFLAGS) \
21 -O0 -g
22endif
23
Shih-wei Liaoea285162010-06-04 12:34:56 -070024# Make sure bionic is first so we can include system headers.
25LOCAL_C_INCLUDES := \
26 $(CLANG_ROOT_PATH)/include \
Stephen Hines6bcf27b2014-05-29 04:14:42 -070027 $(CLANG_ROOT_PATH)/lib/CodeGen \
Shih-wei Liaoea285162010-06-04 12:34:56 -070028 $(LOCAL_C_INCLUDES)
29
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070030LOCAL_MODULE_HOST_OS := darwin linux windows
31
Pirama Arumuga Nainara4de1752016-03-03 15:49:35 -080032# This triggers an assertion on cross Windows builds.
33LOCAL_CFLAGS_windows := -Wno-error=uninitialized
34
Ying Wangc69ce362010-09-09 21:44:22 -070035LLVM_ROOT_PATH := external/llvm
36include $(LLVM_ROOT_PATH)/llvm.mk
37
Shih-wei Liaoea285162010-06-04 12:34:56 -070038ifneq ($(LLVM_HOST_BUILD_MK),)
39include $(LLVM_HOST_BUILD_MK)
40endif
Logan Chienfe6bd6d2011-10-21 15:03:07 +080041
42###########################################################
43## Commands for running tblgen to compile a td file
44###########################################################
45define transform-host-clang-td-to-out
46@mkdir -p $(dir $@)
Logan Chien93e534a2011-12-16 17:39:13 +080047@echo "Host Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080048$(hide) $(CLANG_TBLGEN) \
49 -I $(dir $<) \
50 -I $(LLVM_ROOT_PATH)/include \
51 -I $(LLVM_ROOT_PATH)/host/include \
52 -I $(LLVM_ROOT_PATH)/lib/Target \
53 $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \
54 -gen-$(strip $(1)) \
55 -o $@ $<
56endef