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 ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true) 12LOCAL_CFLAGS := \ 13 $(LOCAL_CFLAGS) \ 14 -D_DEBUG \ 15 -UNDEBUG 16endif 17 18ifeq ($(FORCE_BUILD_LLVM_DEBUG),true) 19LOCAL_CFLAGS := \ 20 $(LOCAL_CFLAGS) \ 21 -O0 -g 22endif 23 24# Make sure bionic is first so we can include system headers. 25LOCAL_C_INCLUDES := \ 26 $(CLANG_ROOT_PATH)/include \ 27 $(CLANG_ROOT_PATH)/lib/CodeGen \ 28 $(LOCAL_C_INCLUDES) 29 30LOCAL_MODULE_HOST_OS := darwin linux windows 31 32# This triggers an assertion on cross Windows builds. 33LOCAL_CFLAGS_windows := -Wno-error=uninitialized 34 35LLVM_ROOT_PATH := external/llvm 36include $(LLVM_ROOT_PATH)/llvm.mk 37 38ifneq ($(LLVM_HOST_BUILD_MK),) 39include $(LLVM_HOST_BUILD_MK) 40endif 41 42########################################################### 43## Commands for running tblgen to compile a td file 44########################################################### 45define transform-host-clang-td-to-out 46@mkdir -p $(dir $@) 47@echo "Host Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<" 48$(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 57