blob: dc6fbbf96b9f6ac86236c2acd0c77a586860bb3b [file] [log] [blame]
Shih-wei Liao4c335b12010-10-25 14:30:07 -07001#
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
17ifneq ($(TARGET_SIMULATOR),true)
18
19LOCAL_PATH := $(call my-dir)
20LLVM_ROOT_PATH := external/llvm
21
22USE_DISASSEMBLER := true
23LLVM_ENABLE_ASSERTION := false
24
25# Shared library for target
26# ========================================================
27include $(CLEAR_VARS)
28LOCAL_PRELINK_MODULE := false
29LOCAL_MODULE := libbcc
30LOCAL_MODULE_TAGS := optional
31LOCAL_SRC_FILES := \
32 bcc.cpp \
33 bcc_runtime.c \
34 runtime/lib/arm/adddf3vfp.S \
35 runtime/lib/arm/addsf3vfp.S \
36 runtime/lib/arm/divdf3vfp.S \
37 runtime/lib/arm/divsf3vfp.S \
38 runtime/lib/arm/eqdf2vfp.S \
39 runtime/lib/arm/eqsf2vfp.S \
40 runtime/lib/arm/extendsfdf2vfp.S \
41 runtime/lib/arm/fixdfsivfp.S \
42 runtime/lib/arm/fixsfsivfp.S \
43 runtime/lib/arm/fixunsdfsivfp.S \
44 runtime/lib/arm/fixunssfsivfp.S \
45 runtime/lib/arm/floatsidfvfp.S \
46 runtime/lib/arm/floatsisfvfp.S \
47 runtime/lib/arm/floatunssidfvfp.S \
48 runtime/lib/arm/floatunssisfvfp.S \
49 runtime/lib/arm/gedf2vfp.S \
50 runtime/lib/arm/gesf2vfp.S \
51 runtime/lib/arm/gtdf2vfp.S \
52 runtime/lib/arm/gtsf2vfp.S \
53 runtime/lib/arm/ledf2vfp.S \
54 runtime/lib/arm/lesf2vfp.S \
55 runtime/lib/arm/ltdf2vfp.S \
56 runtime/lib/arm/ltsf2vfp.S \
57 runtime/lib/arm/muldf3vfp.S \
58 runtime/lib/arm/mulsf3vfp.S \
59 runtime/lib/arm/nedf2vfp.S \
60 runtime/lib/arm/negdf2vfp.S \
61 runtime/lib/arm/negsf2vfp.S \
62 runtime/lib/arm/nesf2vfp.S \
63 runtime/lib/arm/subdf3vfp.S \
64 runtime/lib/arm/subsf3vfp.S \
65 runtime/lib/arm/truncdfsf2vfp.S \
66 runtime/lib/arm/unorddf2vfp.S \
67 runtime/lib/arm/unordsf2vfp.S
68
69LOCAL_STATIC_LIBRARIES := \
70 libLLVMARMCodeGen \
71 libLLVMARMInfo \
72 libLLVMBitReader \
73 libLLVMSelectionDAG \
74 libLLVMAsmPrinter \
75 libLLVMCodeGen \
76 libLLVMLinker \
77 libLLVMJIT \
78 libLLVMTarget \
79 libLLVMMC \
80 libLLVMScalarOpts \
81 libLLVMInstCombine \
82 libLLVMipo \
83 libLLVMipa \
84 libLLVMTransformUtils \
85 libLLVMCore \
86 libLLVMSupport \
87 libLLVMSystem \
88 libLLVMAnalysis
89
90LOCAL_SHARED_LIBRARIES := libdl libcutils libstlport
91
92LOCAL_C_INCLUDES := \
93 $(LOCAL_PATH)/include
94
95ifeq ($(USE_DISASSEMBLER),true)
96LOCAL_CFLAGS += -DUSE_DISASSEMBLER
97LOCAL_STATIC_LIBRARIES := \
98 libLLVMARMDisassembler \
99 libLLVMARMAsmPrinter \
100 libLLVMMCParser \
101 $(LOCAL_STATIC_LIBRARIES)
102endif
103
104# This hides most of the symbols in the shared library and reduces the size
105# of libbcc.so by about 800k.
106LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
107
108include $(LLVM_ROOT_PATH)/llvm-device-build.mk
109include $(BUILD_SHARED_LIBRARY)
110
111# Shared library for host
112# ========================================================
113include $(CLEAR_VARS)
114
115LOCAL_MODULE := libbcc
116LOCAL_MODULE_TAGS := optional
117LOCAL_SRC_FILES := bcc.cpp bcc_runtime.c
118
119LOCAL_STATIC_LIBRARIES := \
120 libcutils \
121 libLLVMX86CodeGen \
122 libLLVMX86Info \
123 libLLVMBitReader \
124 libLLVMSelectionDAG \
125 libLLVMAsmPrinter \
126 libLLVMMCParser \
127 libLLVMCodeGen \
128 libLLVMLinker \
129 libLLVMJIT \
130 libLLVMTarget \
131 libLLVMMC \
132 libLLVMScalarOpts \
133 libLLVMInstCombine \
134 libLLVMipo \
135 libLLVMipa \
136 libLLVMTransformUtils \
137 libLLVMCore \
138 libLLVMSupport \
139 libLLVMSystem \
140 libLLVMAnalysis
141
142LOCAL_LDLIBS := -ldl -lpthread
143
144LOCAL_C_INCLUDES := \
145 $(LOCAL_PATH)/include
146
147ifeq ($(USE_DISASSEMBLER),true)
148LOCAL_CFLAGS += -DUSE_DISASSEMBLER
149LOCAL_STATIC_LIBRARIES := \
150 libLLVMX86Disassembler \
151 libLLVMX86AsmPrinter \
152 $(LOCAL_STATIC_LIBRARIES)
153endif
154
155include $(LLVM_ROOT_PATH)/llvm-host-build.mk
156include $(BUILD_HOST_SHARED_LIBRARY)
157
158# Build children
159# ========================================================
160
161include $(call all-makefiles-under,$(LOCAL_PATH))
162
163endif # TARGET_SIMULATOR != true