1LOCAL_CFLAGS := \ 2 -D_GNU_SOURCE \ 3 -D__STDC_LIMIT_MACROS \ 4 -D__STDC_CONSTANT_MACROS \ 5 -D__STDC_FORMAT_MACROS \ 6 -O2 \ 7 -fomit-frame-pointer \ 8 -Wall \ 9 -W \ 10 -Wno-unused-parameter \ 11 -Wwrite-strings \ 12 $(LOCAL_CFLAGS) 13 14ifeq ($(LLVM_ENABLE_ASSERTION),true) 15LOCAL_CFLAGS := \ 16 $(LOCAL_CFLAGS) \ 17 -D_DEBUG \ 18 -UNDEBUG 19endif 20 21ifneq ($(REQUIRES_EH),1) 22LOCAL_CFLAGS += -fno-exceptions 23else 24REQUIRES_EH := 0 25LOCAL_CFLAGS += -fexceptions 26endif 27 28ifneq ($(REQUIRES_RTTI),1) 29LOCAL_CPPFLAGS += -fno-rtti 30else 31REQUIRES_RTTI := 0 32endif 33 34LOCAL_CPPFLAGS := \ 35 $(LOCAL_CPPFLAGS) \ 36 -Woverloaded-virtual \ 37 -Wno-sign-promo 38 39# Make sure bionic is first so we can include system headers. 40LOCAL_C_INCLUDES := \ 41 $(LLVM_ROOT_PATH) \ 42 $(LLVM_ROOT_PATH)/include \ 43 $(LLVM_ROOT_PATH)/host/include \ 44 $(LOCAL_C_INCLUDES) 45 46LOCAL_IS_HOST_MODULE := true 47 48########################################################### 49## Commands for running tblgen to compile a td file 50########################################################### 51define transform-host-td-to-out 52@mkdir -p $(dir $@) 53@echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<" 54$(hide) $(TBLGEN) \ 55 -I $(dir $<) \ 56 -I $(LLVM_ROOT_PATH)/include \ 57 -I $(LLVM_ROOT_PATH)/host/include \ 58 -I $(LLVM_ROOT_PATH)/lib/Target \ 59 $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \ 60 -gen-$(strip $(1)) \ 61 -o $@ $< 62endef 63