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