blob: e1e19c0bf43a3308db33be77d9fcfec4fc62b1ab [file] [log] [blame]
Zonr Chang932648d2010-10-13 22:23:56 +08001#
2# Copyright (C) 2010 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Carl Shapiro105a9d22010-04-13 17:53:26 -070017ifneq ($(TARGET_SIMULATOR),true)
18
Shih-wei Liao77ed6142010-04-07 12:21:42 -070019LOCAL_PATH := $(call my-dir)
Shih-wei Liao210a1ef2010-09-07 17:06:38 -070020LLVM_ROOT_PATH := external/llvm
Shih-wei Liao77ed6142010-04-07 12:21:42 -070021
Loganeac346d2010-11-24 22:32:34 +080022USE_CACHE := true
Shih-wei Liaobc5ed672010-11-24 01:53:02 -080023USE_RELOCATE := false
24
Shih-wei Liaocd61af32010-04-29 00:02:57 -070025USE_DISASSEMBLER := true
Ying Wang2c06c3e2010-09-07 21:24:55 -070026LLVM_ENABLE_ASSERTION := false
Shih-wei Liaocd61af32010-04-29 00:02:57 -070027
Shih-wei Liao77ed6142010-04-07 12:21:42 -070028# Shared library for target
29# ========================================================
30include $(CLEAR_VARS)
31LOCAL_PRELINK_MODULE := false
32LOCAL_MODULE := libbcc
Zonr Chang932648d2010-10-13 22:23:56 +080033LOCAL_MODULE_TAGS := optional
Logan61cb2302010-11-27 14:18:26 +080034LOCAL_SRC_FILES := \
Loganc4395232010-11-27 18:54:17 +080035 lib/bcc/bcc.cpp \
Loganc4395232010-11-27 18:54:17 +080036 lib/bcc/CodeEmitter.cpp \
37 lib/bcc/CodeMemoryManager.cpp \
Loganeb3d12b2010-12-16 06:20:18 +080038 lib/bcc/Compiler.cpp \
39 lib/bcc/ContextManager.cpp \
Loganc4395232010-11-27 18:54:17 +080040 lib/bcc/Runtime.c \
Logan61cb2302010-11-27 14:18:26 +080041 runtime/lib/arm/adddf3vfp.S \
42 runtime/lib/arm/addsf3vfp.S \
43 runtime/lib/arm/divdf3vfp.S \
44 runtime/lib/arm/divsf3vfp.S \
45 runtime/lib/arm/eqdf2vfp.S \
46 runtime/lib/arm/eqsf2vfp.S \
47 runtime/lib/arm/extendsfdf2vfp.S \
48 runtime/lib/arm/fixdfsivfp.S \
49 runtime/lib/arm/fixsfsivfp.S \
50 runtime/lib/arm/fixunsdfsivfp.S \
51 runtime/lib/arm/fixunssfsivfp.S \
52 runtime/lib/arm/floatsidfvfp.S \
53 runtime/lib/arm/floatsisfvfp.S \
54 runtime/lib/arm/floatunssidfvfp.S \
55 runtime/lib/arm/floatunssisfvfp.S \
56 runtime/lib/arm/gedf2vfp.S \
57 runtime/lib/arm/gesf2vfp.S \
58 runtime/lib/arm/gtdf2vfp.S \
59 runtime/lib/arm/gtsf2vfp.S \
60 runtime/lib/arm/ledf2vfp.S \
61 runtime/lib/arm/lesf2vfp.S \
62 runtime/lib/arm/ltdf2vfp.S \
63 runtime/lib/arm/ltsf2vfp.S \
64 runtime/lib/arm/muldf3vfp.S \
65 runtime/lib/arm/mulsf3vfp.S \
66 runtime/lib/arm/nedf2vfp.S \
67 runtime/lib/arm/negdf2vfp.S \
68 runtime/lib/arm/negsf2vfp.S \
69 runtime/lib/arm/nesf2vfp.S \
70 runtime/lib/arm/subdf3vfp.S \
71 runtime/lib/arm/subsf3vfp.S \
72 runtime/lib/arm/truncdfsf2vfp.S \
73 runtime/lib/arm/unorddf2vfp.S \
74 runtime/lib/arm/unordsf2vfp.S
Shih-wei Liao77ed6142010-04-07 12:21:42 -070075
Logan61cb2302010-11-27 14:18:26 +080076LOCAL_STATIC_LIBRARIES := \
77 libLLVMARMCodeGen \
78 libLLVMARMInfo \
79 libLLVMBitReader \
80 libLLVMSelectionDAG \
81 libLLVMAsmPrinter \
82 libLLVMCodeGen \
83 libLLVMLinker \
84 libLLVMJIT \
85 libLLVMTarget \
86 libLLVMMC \
87 libLLVMScalarOpts \
88 libLLVMInstCombine \
89 libLLVMipo \
90 libLLVMipa \
91 libLLVMTransformUtils \
92 libLLVMCore \
93 libLLVMSupport \
94 libLLVMSystem \
95 libLLVMAnalysis
Shih-wei Liao77ed6142010-04-07 12:21:42 -070096
Shih-wei Liao7c5a5f72010-11-08 01:59:13 -080097LOCAL_SHARED_LIBRARIES := libdl libcutils libutils libstlport
Shih-wei Liao77ed6142010-04-07 12:21:42 -070098
Logan61cb2302010-11-27 14:18:26 +080099LOCAL_C_INCLUDES := \
Loganc4395232010-11-27 18:54:17 +0800100 $(LOCAL_PATH)/include \
101 $(LOCAL_PATH)
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700102
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700103ifeq ($(USE_DISASSEMBLER),true)
104LOCAL_CFLAGS += -DUSE_DISASSEMBLER
Logan61cb2302010-11-27 14:18:26 +0800105LOCAL_STATIC_LIBRARIES := \
106 libLLVMARMDisassembler \
107 libLLVMARMAsmPrinter \
108 libLLVMMCParser \
109 $(LOCAL_STATIC_LIBRARIES)
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700110endif
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700111
Doug Kwan75dacc12010-07-20 16:54:58 -0700112# This hides most of the symbols in the shared library and reduces the size
113# of libbcc.so by about 800k.
114LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
115
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700116include $(LLVM_ROOT_PATH)/llvm-device-build.mk
117include $(BUILD_SHARED_LIBRARY)
118
119# Shared library for host
120# ========================================================
121include $(CLEAR_VARS)
122
123LOCAL_MODULE := libbcc
Zonr Chang932648d2010-10-13 22:23:56 +0800124LOCAL_MODULE_TAGS := optional
Logan61cb2302010-11-27 14:18:26 +0800125LOCAL_SRC_FILES := \
Loganc4395232010-11-27 18:54:17 +0800126 lib/bcc/bcc.cpp \
Loganc4395232010-11-27 18:54:17 +0800127 lib/bcc/CodeEmitter.cpp \
128 lib/bcc/CodeMemoryManager.cpp \
Loganeb3d12b2010-12-16 06:20:18 +0800129 lib/bcc/Compiler.cpp \
130 lib/bcc/ContextManager.cpp \
Loganc4395232010-11-27 18:54:17 +0800131 lib/bcc/Runtime.c \
132 helper/logd_write.c
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700133
Logan61cb2302010-11-27 14:18:26 +0800134LOCAL_STATIC_LIBRARIES := \
135 libcutils \
136 libLLVMX86CodeGen \
137 libLLVMX86Info \
138 libLLVMARMCodeGen \
139 libLLVMARMInfo \
140 libLLVMBitReader \
141 libLLVMSelectionDAG \
142 libLLVMAsmPrinter \
143 libLLVMMCParser \
144 libLLVMCodeGen \
145 libLLVMLinker \
146 libLLVMJIT \
147 libLLVMTarget \
148 libLLVMMC \
149 libLLVMScalarOpts \
150 libLLVMInstCombine \
151 libLLVMipo \
152 libLLVMipa \
153 libLLVMTransformUtils \
154 libLLVMCore \
155 libLLVMSupport \
156 libLLVMSystem \
157 libLLVMAnalysis
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700158
159LOCAL_LDLIBS := -ldl -lpthread
160
Logan61cb2302010-11-27 14:18:26 +0800161LOCAL_C_INCLUDES := \
Loganc4395232010-11-27 18:54:17 +0800162 $(LOCAL_PATH)/include \
163 $(LOCAL_PATH)
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700164
Shih-wei Liaoe64c2872010-10-25 13:44:53 -0700165# definitions for LLVM
Shih-wei Liao7c5a5f72010-11-08 01:59:13 -0800166LOCAL_CFLAGS += -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DUSE_DISASSEMBLER=1 -DFORCE_ARM_CODEGEN=1 -DDEBUG_CODEGEN=1
Shih-wei Liaoe64c2872010-10-25 13:44:53 -0700167
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700168ifeq ($(USE_DISASSEMBLER),true)
169LOCAL_CFLAGS += -DUSE_DISASSEMBLER
Logan61cb2302010-11-27 14:18:26 +0800170LOCAL_STATIC_LIBRARIES := \
171 libLLVMARMDisassembler \
172 libLLVMARMAsmPrinter \
173 libLLVMMCParser \
174 $(LOCAL_STATIC_LIBRARIES)
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700175endif
176
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700177include $(LLVM_ROOT_PATH)/llvm-host-build.mk
178include $(BUILD_HOST_SHARED_LIBRARY)
179
180# Build children
181# ========================================================
182
183include $(call all-makefiles-under,$(LOCAL_PATH))
Carl Shapiro105a9d22010-04-13 17:53:26 -0700184
Shih-wei Liao800e9c22010-04-18 16:08:16 -0700185endif # TARGET_SIMULATOR != true