blob: afdd0230bd5263f350eba512ab619d87b84430b1 [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
Ying Wangc69ce362010-09-09 21:44:22 -070032LLVM_ROOT_PATH := external/llvm
33include $(LLVM_ROOT_PATH)/llvm.mk
34
Shih-wei Liaoea285162010-06-04 12:34:56 -070035ifneq ($(LLVM_HOST_BUILD_MK),)
36include $(LLVM_HOST_BUILD_MK)
37endif
Logan Chienfe6bd6d2011-10-21 15:03:07 +080038
39###########################################################
40## Commands for running tblgen to compile a td file
41###########################################################
42define transform-host-clang-td-to-out
43@mkdir -p $(dir $@)
Logan Chien93e534a2011-12-16 17:39:13 +080044@echo "Host Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
Logan Chienfe6bd6d2011-10-21 15:03:07 +080045$(hide) $(CLANG_TBLGEN) \
46 -I $(dir $<) \
47 -I $(LLVM_ROOT_PATH)/include \
48 -I $(LLVM_ROOT_PATH)/host/include \
49 -I $(LLVM_ROOT_PATH)/lib/Target \
50 $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \
51 -gen-$(strip $(1)) \
52 -o $@ $<
53endef