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