Android.mk revision f7f0ac5d3e12b2e84bd18aa32add4a11bf296dbb
1#
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_CACHE := true
23USE_RELOCATE := false
24
25USE_DISASSEMBLER := true
26LLVM_ENABLE_ASSERTION := false
27
28libbcc_SRC_FILES := \
29  lib/bcc/bcc.cpp \
30  lib/bcc/CacheReader.cpp \
31  lib/bcc/CodeEmitter.cpp \
32  lib/bcc/CodeMemoryManager.cpp \
33  lib/bcc/Compiler.cpp \
34  lib/bcc/ContextManager.cpp \
35  lib/bcc/FileHandle.cpp \
36  lib/bcc/Runtime.c \
37  lib/bcc/Script.cpp \
38  lib/bcc/ScriptCompiled.cpp \
39  lib/bcc/ScriptCached.cpp \
40  helper/sha1.c
41
42# Shared library for target
43# ========================================================
44include $(CLEAR_VARS)
45LOCAL_PRELINK_MODULE := false
46LOCAL_MODULE := libbcc
47LOCAL_MODULE_TAGS := optional
48LOCAL_SRC_FILES := \
49  $(libbcc_SRC_FILES) \
50  runtime/lib/arm/adddf3vfp.S \
51  runtime/lib/arm/addsf3vfp.S \
52  runtime/lib/arm/divdf3vfp.S \
53  runtime/lib/arm/divsf3vfp.S \
54  runtime/lib/arm/eqdf2vfp.S \
55  runtime/lib/arm/eqsf2vfp.S \
56  runtime/lib/arm/extendsfdf2vfp.S \
57  runtime/lib/arm/fixdfsivfp.S \
58  runtime/lib/arm/fixsfsivfp.S \
59  runtime/lib/arm/fixunsdfsivfp.S \
60  runtime/lib/arm/fixunssfsivfp.S \
61  runtime/lib/arm/floatsidfvfp.S \
62  runtime/lib/arm/floatsisfvfp.S \
63  runtime/lib/arm/floatunssidfvfp.S \
64  runtime/lib/arm/floatunssisfvfp.S \
65  runtime/lib/arm/gedf2vfp.S \
66  runtime/lib/arm/gesf2vfp.S \
67  runtime/lib/arm/gtdf2vfp.S \
68  runtime/lib/arm/gtsf2vfp.S \
69  runtime/lib/arm/ledf2vfp.S \
70  runtime/lib/arm/lesf2vfp.S \
71  runtime/lib/arm/ltdf2vfp.S \
72  runtime/lib/arm/ltsf2vfp.S \
73  runtime/lib/arm/muldf3vfp.S \
74  runtime/lib/arm/mulsf3vfp.S \
75  runtime/lib/arm/nedf2vfp.S \
76  runtime/lib/arm/negdf2vfp.S \
77  runtime/lib/arm/negsf2vfp.S \
78  runtime/lib/arm/nesf2vfp.S \
79  runtime/lib/arm/subdf3vfp.S \
80  runtime/lib/arm/subsf3vfp.S \
81  runtime/lib/arm/truncdfsf2vfp.S \
82  runtime/lib/arm/unorddf2vfp.S \
83  runtime/lib/arm/unordsf2vfp.S
84
85LOCAL_STATIC_LIBRARIES := \
86  libLLVMARMCodeGen \
87  libLLVMARMInfo \
88  libLLVMBitReader \
89  libLLVMSelectionDAG \
90  libLLVMAsmPrinter \
91  libLLVMCodeGen \
92  libLLVMLinker \
93  libLLVMJIT \
94  libLLVMTarget \
95  libLLVMMC \
96  libLLVMScalarOpts \
97  libLLVMInstCombine \
98  libLLVMipo \
99  libLLVMipa \
100  libLLVMTransformUtils \
101  libLLVMCore \
102  libLLVMSupport \
103  libLLVMSystem \
104  libLLVMAnalysis
105
106LOCAL_SHARED_LIBRARIES := libdl libcutils libutils libstlport
107
108LOCAL_C_INCLUDES := \
109  $(LOCAL_PATH)/helper \
110  $(LOCAL_PATH)/include \
111  $(LOCAL_PATH)
112
113ifeq ($(USE_DISASSEMBLER),true)
114LOCAL_CFLAGS += -DUSE_DISASSEMBLER
115LOCAL_STATIC_LIBRARIES := \
116  libLLVMARMDisassembler \
117  libLLVMARMAsmPrinter \
118  libLLVMMCParser \
119  $(LOCAL_STATIC_LIBRARIES)
120endif
121
122# This hides most of the symbols in the shared library and reduces the size
123# of libbcc.so by about 800k.
124LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL
125
126include $(LLVM_ROOT_PATH)/llvm-device-build.mk
127include $(BUILD_SHARED_LIBRARY)
128
129# Shared library for host
130# ========================================================
131include $(CLEAR_VARS)
132
133LOCAL_MODULE := libbcc
134LOCAL_MODULE_TAGS := optional
135LOCAL_SRC_FILES := \
136  $(libbcc_SRC_FILES) \
137  helper/logd_write.c
138
139LOCAL_STATIC_LIBRARIES := \
140  libcutils \
141  libLLVMX86CodeGen \
142  libLLVMX86Info \
143  libLLVMARMCodeGen \
144  libLLVMARMInfo \
145  libLLVMBitReader \
146  libLLVMSelectionDAG \
147  libLLVMAsmPrinter \
148  libLLVMMCParser \
149  libLLVMCodeGen \
150  libLLVMLinker \
151  libLLVMJIT \
152  libLLVMTarget \
153  libLLVMMC \
154  libLLVMScalarOpts \
155  libLLVMInstCombine \
156  libLLVMipo \
157  libLLVMipa \
158  libLLVMTransformUtils \
159  libLLVMCore \
160  libLLVMSupport \
161  libLLVMSystem \
162  libLLVMAnalysis
163
164LOCAL_LDLIBS := -ldl -lpthread
165
166LOCAL_C_INCLUDES := \
167  $(LOCAL_PATH)/helper \
168  $(LOCAL_PATH)/include \
169  $(LOCAL_PATH)
170
171# definitions for LLVM
172LOCAL_CFLAGS += -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DUSE_DISASSEMBLER=1 -DFORCE_ARM_CODEGEN=1 -DDEBUG_CODEGEN=1
173
174ifeq ($(USE_DISASSEMBLER),true)
175LOCAL_CFLAGS += -DUSE_DISASSEMBLER
176LOCAL_STATIC_LIBRARIES := \
177  libLLVMARMDisassembler \
178  libLLVMARMAsmPrinter \
179  libLLVMMCParser \
180  $(LOCAL_STATIC_LIBRARIES)
181endif
182
183include $(LLVM_ROOT_PATH)/llvm-host-build.mk
184include $(BUILD_HOST_SHARED_LIBRARY)
185
186# Build children
187# ========================================================
188
189include $(call all-makefiles-under,$(LOCAL_PATH))
190
191endif # TARGET_SIMULATOR != true
192