1 LOCAL_PATH:= $(call my-dir) 2 3 llvm_pre_static_libraries := \ 4 libLLVMLinker \ 5 libLLVMipo \ 6 libLLVMIRReader \ 7 libLLVMBitWriter \ 8 libLLVMBitReader 9 10 llvm_arm_static_libraries := \ 11 libLLVMARMCodeGen \ 12 libLLVMARMAsmParser \ 13 libLLVMARMAsmPrinter \ 14 libLLVMARMInfo \ 15 libLLVMARMDesc \ 16 libLLVMARMDisassembler 17 18 llvm_x86_static_libraries := \ 19 libLLVMX86CodeGen \ 20 libLLVMX86Info \ 21 libLLVMX86Desc \ 22 libLLVMX86AsmParser \ 23 libLLVMX86AsmPrinter \ 24 libLLVMX86Utils \ 25 libLLVMX86Disassembler 26 27 llvm_mips_static_libraries := \ 28 libLLVMMipsCodeGen \ 29 libLLVMMipsInfo \ 30 libLLVMMipsDesc \ 31 libLLVMMipsAsmParser \ 32 libLLVMMipsAsmPrinter \ 33 libLLVMMipsDisassembler 34 35 llvm_aarch64_static_libraries := \ 36 libLLVMAArch64CodeGen \ 37 libLLVMAArch64Info \ 38 libLLVMAArch64Desc \ 39 libLLVMAArch64AsmParser \ 40 libLLVMAArch64AsmPrinter \ 41 libLLVMAArch64Utils \ 42 libLLVMAArch64Disassembler 43 44 llvm_post_static_libraries := \ 45 libLLVMAsmPrinter \ 46 libLLVMSelectionDAG \ 47 libLLVMCodeGen \ 48 libLLVMObject \ 49 libLLVMScalarOpts \ 50 libLLVMInstCombine \ 51 libLLVMInstrumentation \ 52 libLLVMTransformObjCARC \ 53 libLLVMTransformUtils \ 54 libLLVMipa \ 55 libLLVMAnalysis \ 56 libLLVMTarget \ 57 libLLVMMC \ 58 libLLVMMCParser \ 59 libLLVMCore \ 60 libLLVMAsmParser \ 61 libLLVMOption \ 62 libLLVMSupport \ 63 libLLVMVectorize \ 64 65 llvm_host_static_libraries := \ 66 libLLVMExecutionEngine \ 67 libLLVMMCDisassembler \ 68 libLLVMRuntimeDyld \ 69 libLLVMJIT \ 70 libLLVMMCJIT \ 71 libLLVMProfileData 72 73 ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS)) 74 # HOST LLVM shared library build 75 include $(CLEAR_VARS) 76 LOCAL_IS_HOST_MODULE := true 77 78 LOCAL_MODULE:= libLLVM 79 80 LOCAL_MODULE_TAGS := optional 81 82 # Host build pulls in all ARM, Mips, X86 components. 83 LOCAL_WHOLE_STATIC_LIBRARIES := \ 84 $(llvm_pre_static_libraries) \ 85 $(llvm_arm_static_libraries) \ 86 $(llvm_x86_static_libraries) \ 87 $(llvm_mips_static_libraries) \ 88 $(llvm_aarch64_static_libraries) \ 89 $(llvm_host_static_libraries) \ 90 $(llvm_post_static_libraries) 91 92 ifeq ($(HOST_OS),windows) 93 LOCAL_LDLIBS := -limagehlp -lpsapi 94 else 95 LOCAL_LDLIBS := -ldl -lpthread 96 endif 97 98 include $(LLVM_HOST_BUILD_MK) 99 include $(BUILD_HOST_SHARED_LIBRARY) 100 endif 101 102 ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH))) 103 $(warning TODO $(TARGET_ARCH): Enable llvm build) 104 endif 105 106 ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) 107 # DEVICE LLVM shared library build 108 include $(CLEAR_VARS) 109 110 LOCAL_MODULE:= libLLVM 111 112 LOCAL_MODULE_TAGS := optional 113 114 # Device build selectively pulls in ARM, Mips, X86 components. 115 LOCAL_WHOLE_STATIC_LIBRARIES := \ 116 $(llvm_pre_static_libraries) 117 118 LOCAL_WHOLE_STATIC_LIBRARIES_arm += $(llvm_arm_static_libraries) 119 LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_x86_static_libraries) 120 LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_x86_static_libraries) 121 LOCAL_WHOLE_STATIC_LIBRARIES_mips += $(llvm_mips_static_libraries) 122 LOCAL_WHOLE_STATIC_LIBRARIES_mips64 += $(llvm_mips_static_libraries) 123 LOCAL_WHOLE_STATIC_LIBRARIES_arm64 += $(llvm_aarch64_static_libraries) 124 LOCAL_WHOLE_STATIC_LIBRARIES_arm64 += $(llvm_arm_static_libraries) 125 126 ifeq ($(BUILD_ARM_FOR_X86),true) 127 LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_arm_static_libraries) 128 LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_arm_static_libraries) 129 endif 130 131 LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_post_static_libraries) 132 133 #LOCAL_LDLIBS := -ldl -lpthread 134 LOCAL_SHARED_LIBRARIES := libcutils libdl libc++ 135 136 include $(LLVM_DEVICE_BUILD_MK) 137 include $(BUILD_SHARED_LIBRARY) 138 139 endif 140