• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH:= $(call my-dir)
2
3llvm_pre_static_libraries := \
4  libLLVMLinker \
5  libLLVMipo \
6  libLLVMIRReader \
7  libLLVMBitWriter \
8  libLLVMBitReader
9
10llvm_arm_static_libraries := \
11  libLLVMARMCodeGen \
12  libLLVMARMAsmParser \
13  libLLVMARMAsmPrinter \
14  libLLVMARMInfo \
15  libLLVMARMDesc \
16  libLLVMARMDisassembler
17
18llvm_x86_static_libraries := \
19  libLLVMX86CodeGen \
20  libLLVMX86Info \
21  libLLVMX86Desc \
22  libLLVMX86AsmParser \
23  libLLVMX86AsmPrinter \
24  libLLVMX86Utils \
25  libLLVMX86Disassembler
26
27llvm_mips_static_libraries := \
28  libLLVMMipsCodeGen \
29  libLLVMMipsInfo \
30  libLLVMMipsDesc \
31  libLLVMMipsAsmParser \
32  libLLVMMipsAsmPrinter \
33  libLLVMMipsDisassembler
34
35llvm_aarch64_static_libraries := \
36  libLLVMAArch64CodeGen \
37  libLLVMAArch64Info \
38  libLLVMAArch64Desc \
39  libLLVMAArch64AsmParser \
40  libLLVMAArch64AsmPrinter \
41  libLLVMAArch64Utils \
42  libLLVMAArch64Disassembler
43
44llvm_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
65llvm_host_static_libraries := \
66  libLLVMExecutionEngine \
67  libLLVMMCDisassembler \
68  libLLVMRuntimeDyld \
69  libLLVMJIT \
70  libLLVMMCJIT \
71  libLLVMProfileData
72
73ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
74# HOST LLVM shared library build
75include $(CLEAR_VARS)
76LOCAL_IS_HOST_MODULE := true
77
78LOCAL_MODULE:= libLLVM
79
80LOCAL_MODULE_TAGS := optional
81
82# Host build pulls in all ARM, Mips, X86 components.
83LOCAL_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
92ifeq ($(HOST_OS),windows)
93  LOCAL_LDLIBS := -limagehlp -lpsapi
94else
95  LOCAL_LDLIBS := -ldl -lpthread
96endif
97
98include $(LLVM_HOST_BUILD_MK)
99include $(BUILD_HOST_SHARED_LIBRARY)
100endif
101
102ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH)))
103$(warning TODO $(TARGET_ARCH): Enable llvm build)
104endif
105
106ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
107# DEVICE LLVM shared library build
108include $(CLEAR_VARS)
109
110LOCAL_MODULE:= libLLVM
111
112LOCAL_MODULE_TAGS := optional
113
114# Device build selectively pulls in ARM, Mips, X86 components.
115LOCAL_WHOLE_STATIC_LIBRARIES := \
116  $(llvm_pre_static_libraries)
117
118LOCAL_WHOLE_STATIC_LIBRARIES_arm += $(llvm_arm_static_libraries)
119LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_x86_static_libraries)
120LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_x86_static_libraries)
121LOCAL_WHOLE_STATIC_LIBRARIES_mips += $(llvm_mips_static_libraries)
122LOCAL_WHOLE_STATIC_LIBRARIES_mips64 += $(llvm_mips_static_libraries)
123LOCAL_WHOLE_STATIC_LIBRARIES_arm64 += $(llvm_aarch64_static_libraries)
124LOCAL_WHOLE_STATIC_LIBRARIES_arm64 += $(llvm_arm_static_libraries)
125
126ifeq ($(BUILD_ARM_FOR_X86),true)
127LOCAL_WHOLE_STATIC_LIBRARIES_x86 += $(llvm_arm_static_libraries)
128LOCAL_WHOLE_STATIC_LIBRARIES_x86_64 += $(llvm_arm_static_libraries)
129endif
130
131LOCAL_WHOLE_STATIC_LIBRARIES += $(llvm_post_static_libraries)
132
133#LOCAL_LDLIBS := -ldl -lpthread
134LOCAL_SHARED_LIBRARIES := libcutils libdl libc++
135
136include $(LLVM_DEVICE_BUILD_MK)
137include $(BUILD_SHARED_LIBRARY)
138
139endif
140