1LOCAL_CFLAGS :=	\
2	-pedantic	\
3	-Wcast-qual	\
4	-Wno-long-long	\
5	$(LOCAL_CFLAGS)
6
7LOCAL_CPPFLAGS := \
8	-Wno-sign-promo \
9	$(LOCAL_CPPFLAGS)
10
11ifeq ($(CLANG_ENABLE_ASSERTION),true)
12LOCAL_CFLAGS :=	\
13	$(LOCAL_CFLAGS) \
14	-D_DEBUG	\
15	-UNDEBUG
16endif
17
18# Make sure bionic is first so we can include system headers.
19LOCAL_C_INCLUDES :=	\
20	$(CLANG_ROOT_PATH)/include	\
21	$(CLANG_ROOT_PATH)/lib/CodeGen    \
22	$(LOCAL_C_INCLUDES)
23
24LLVM_ROOT_PATH := external/llvm
25include $(LLVM_ROOT_PATH)/llvm.mk
26
27ifneq ($(LLVM_DEVICE_BUILD_MK),)
28include $(LLVM_DEVICE_BUILD_MK)
29endif
30
31###########################################################
32## Commands for running tblgen to compile a td file
33###########################################################
34define transform-device-clang-td-to-out
35@mkdir -p $(dir $@)
36@echo "Device Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
37$(hide) $(CLANG_TBLGEN) \
38	-I $(dir $<)	\
39	-I $(LLVM_ROOT_PATH)/include	\
40	-I $(LLVM_ROOT_PATH)/device/include	\
41	-I $(LLVM_ROOT_PATH)/lib/Target	\
42	$(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,)	\
43	-gen-$(strip $(1))	\
44	-o $@ $<
45endef
46