1 LOCAL_PATH := $(call my-dir) 2 3 LLVM_ROOT_PATH := $(LOCAL_PATH)/../.. 4 5 6 #===---------------------------------------------------------------=== 7 # llc command line tool (common) 8 #===---------------------------------------------------------------=== 9 10 llvm_llc_SRC_FILES := \ 11 llc.cpp 12 13 llvm_llc_mips_STATIC_LIBRARIES := \ 14 libLLVMMipsInfo \ 15 libLLVMMipsCodeGen \ 16 libLLVMMipsDesc \ 17 libLLVMMipsAsmPrinter \ 18 19 llvm_llc_x86_STATIC_LIBRARIES := \ 20 libLLVMX86Info \ 21 libLLVMX86AsmParser \ 22 libLLVMX86CodeGen \ 23 libLLVMX86Disassembler \ 24 libLLVMX86Desc \ 25 libLLVMX86AsmPrinter \ 26 libLLVMX86Utils 27 28 llvm_llc_arm_STATIC_LIBRARIES := \ 29 libLLVMARMCodeGen \ 30 libLLVMARMDisassembler \ 31 libLLVMARMAsmParser \ 32 libLLVMARMDesc \ 33 libLLVMARMInfo 34 35 llvm_llc_STATIC_LIBRARIES := \ 36 libLLVMAsmPrinter \ 37 libLLVMAsmParser \ 38 libLLVMBitReader \ 39 libLLVMBitWriter \ 40 libLLVMSelectionDAG \ 41 libLLVMInstCombine \ 42 libLLVMInstrumentation \ 43 libLLVMCodeGen \ 44 libLLVMipo \ 45 libLLVMipa \ 46 libLLVMLinker \ 47 libLLVMMC \ 48 libLLVMMCParser \ 49 libLLVMScalarOpts \ 50 libLLVMTransformUtils \ 51 libLLVMVectorize \ 52 libLLVMAnalysis \ 53 libLLVMTarget \ 54 libLLVMCore \ 55 libLLVMSupport 56 57 58 #===---------------------------------------------------------------=== 59 # llc command line tool (host) 60 #===---------------------------------------------------------------=== 61 62 include $(CLEAR_VARS) 63 64 LOCAL_MODULE := llc 65 LOCAL_MODULE_TAGS := optional 66 LOCAL_MODULE_CLASS := EXECUTABLES 67 LOCAL_IS_HOST_MODULE := true 68 69 LOCAL_SRC_FILES := $(llvm_llc_SRC_FILES) 70 71 LOCAL_STATIC_LIBRARIES := \ 72 $(llvm_llc_arm_STATIC_LIBRARIES) \ 73 $(llvm_llc_mips_STATIC_LIBRARIES) \ 74 $(llvm_llc_x86_STATIC_LIBRARIES) \ 75 $(llvm_llc_STATIC_LIBRARIES) 76 77 LOCAL_LDLIBS += -lpthread -lm -ldl 78 LOCAL_C_INCLUDES += external/llvm/include 79 80 include $(LLVM_ROOT_PATH)/llvm.mk 81 include $(LLVM_HOST_BUILD_MK) 82 include $(LLVM_GEN_INTRINSICS_MK) 83 include $(BUILD_HOST_EXECUTABLE) 84 85 86 #===---------------------------------------------------------------=== 87 # llc command line tool (target) 88 #===---------------------------------------------------------------=== 89 90 include $(CLEAR_VARS) 91 92 LOCAL_MODULE := llc 93 LOCAL_MODULE_TAGS := optional 94 LOCAL_MODULE_CLASS := EXECUTABLES 95 96 LOCAL_SRC_FILES := $(llvm_llc_SRC_FILES) 97 LOCAL_C_INCLUDES += external/llvm/include 98 99 ifeq ($(TARGET_ARCH),arm) 100 LOCAL_STATIC_LIBRARIES := $(llvm_llc_arm_STATIC_LIBRARIES) 101 else 102 ifeq ($(TARGET_ARCH),mips) 103 LOCAL_STATIC_LIBRARIES := $(llvm_llc_mips_STATIC_LIBRARIES) 104 else 105 ifeq ($(TARGET_ARCH),x86) 106 LOCAL_STATIC_LIBRARIES := $(llvm_llc__STATIC_LIBRARIES) 107 else 108 $(error "Unsupport llc target $(TARGET_ARCH)") 109 endif 110 endif 111 endif 112 113 LOCAL_STATIC_LIBRARIES += $(llvm_llc_STATIC_LIBRARIES) 114 115 LOCAL_SHARED_LIBRARIES := \ 116 libdl \ 117 libstlport 118 119 include $(LLVM_ROOT_PATH)/llvm.mk 120 include $(LLVM_DEVICE_BUILD_MK) 121 include $(LLVM_GEN_INTRINSICS_MK) 122 include $(BUILD_EXECUTABLE) 123