-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclang-host-build.mk
38 lines (33 loc) · 1007 Bytes
/
clang-host-build.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
LOCAL_CFLAGS := \
-pedantic \
-Wcast-qual \
-Wno-long-long \
$(LOCAL_CFLAGS)
LOCAL_CPPFLAGS := \
-Wno-sign-promo \
$(LOCAL_CPPFLAGS)
# Make sure bionic is first so we can include system headers.
LOCAL_C_INCLUDES := \
$(CLANG_ROOT_PATH)/include \
$(CLANG_ROOT_PATH)/lib/CodeGen \
$(LOCAL_C_INCLUDES)
LLVM_ROOT_PATH := external/llvm
include $(LLVM_ROOT_PATH)/llvm.mk
ifneq ($(LLVM_HOST_BUILD_MK),)
include $(LLVM_HOST_BUILD_MK)
endif
###########################################################
## Commands for running tblgen to compile a td file
###########################################################
define transform-host-clang-td-to-out
@mkdir -p $(dir $@)
@echo "Host Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
$(hide) $(CLANG_TBLGEN) \
-I $(dir $<) \
-I $(LLVM_ROOT_PATH)/include \
-I $(LLVM_ROOT_PATH)/host/include \
-I $(LLVM_ROOT_PATH)/lib/Target \
$(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \
-gen-$(strip $(1)) \
-o $@ $<
endef