blob: a01d620ff5f0b5a8c9b5c21bfb34153e1d36e362 [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
Shih-wei Liaocd61af32010-04-29 00:02:57 -070022USE_DISASSEMBLER := true
Ying Wang2c06c3e2010-09-07 21:24:55 -070023LLVM_ENABLE_ASSERTION := false
Shih-wei Liaocd61af32010-04-29 00:02:57 -070024
Shih-wei Liao77ed6142010-04-07 12:21:42 -070025# Shared library for target
26# ========================================================
27include $(CLEAR_VARS)
28LOCAL_PRELINK_MODULE := false
29LOCAL_MODULE := libbcc
Zonr Chang932648d2010-10-13 22:23:56 +080030LOCAL_MODULE_TAGS := optional
Shih-wei Liao77ed6142010-04-07 12:21:42 -070031LOCAL_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 \
Shih-wei Liaocd61af32010-04-29 00:02:57 -070067 runtime/lib/arm/unordsf2vfp.S
Shih-wei Liao77ed6142010-04-07 12:21:42 -070068
69LOCAL_STATIC_LIBRARIES := \
70 libLLVMARMCodeGen \
71 libLLVMARMInfo \
72 libLLVMBitReader \
73 libLLVMSelectionDAG \
74 libLLVMAsmPrinter \
75 libLLVMCodeGen \
Zonr Chang97f5e612010-10-22 20:38:26 +080076 libLLVMLinker \
Shih-wei Liao77ed6142010-04-07 12:21:42 -070077 libLLVMJIT \
78 libLLVMTarget \
79 libLLVMMC \
80 libLLVMScalarOpts \
Zonr Chang6e1d6c32010-10-23 11:57:16 +080081 libLLVMInstCombine \
82 libLLVMipo \
83 libLLVMipa \
Shih-wei Liao77ed6142010-04-07 12:21:42 -070084 libLLVMTransformUtils \
85 libLLVMCore \
86 libLLVMSupport \
87 libLLVMSystem \
88 libLLVMAnalysis
89
Shih-wei Liao7c5a5f72010-11-08 01:59:13 -080090LOCAL_SHARED_LIBRARIES := libdl libcutils libutils libstlport
Shih-wei Liao77ed6142010-04-07 12:21:42 -070091
92LOCAL_C_INCLUDES := \
Shih-wei Liaocd61af32010-04-29 00:02:57 -070093 $(LOCAL_PATH)/include
Shih-wei Liao77ed6142010-04-07 12:21:42 -070094
Shih-wei Liaocd61af32010-04-29 00:02:57 -070095ifeq ($(USE_DISASSEMBLER),true)
96LOCAL_CFLAGS += -DUSE_DISASSEMBLER
97LOCAL_STATIC_LIBRARIES := \
98 libLLVMARMDisassembler \
99 libLLVMARMAsmPrinter \
100 libLLVMMCParser \
101 $(LOCAL_STATIC_LIBRARIES)
102endif
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700103
Doug Kwan75dacc12010-07-20 16:54:58 -0700104# 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
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700108include $(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
Zonr Chang932648d2010-10-13 22:23:56 +0800116LOCAL_MODULE_TAGS := optional
Shih-wei Liaoe64c2872010-10-25 13:44:53 -0700117LOCAL_SRC_FILES := \
118 bcc.cpp \
119 hashmap.c \
120 logd_write.c \
121 bcc_runtime.c
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700122
123LOCAL_STATIC_LIBRARIES := \
124 libcutils \
125 libLLVMX86CodeGen \
126 libLLVMX86Info \
Shih-wei Liaoe64c2872010-10-25 13:44:53 -0700127 libLLVMARMCodeGen \
128 libLLVMARMInfo \
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700129 libLLVMBitReader \
130 libLLVMSelectionDAG \
131 libLLVMAsmPrinter \
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700132 libLLVMMCParser \
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700133 libLLVMCodeGen \
Zonr Chang97f5e612010-10-22 20:38:26 +0800134 libLLVMLinker \
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700135 libLLVMJIT \
136 libLLVMTarget \
137 libLLVMMC \
138 libLLVMScalarOpts \
Zonr Chang6e1d6c32010-10-23 11:57:16 +0800139 libLLVMInstCombine \
140 libLLVMipo \
141 libLLVMipa \
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700142 libLLVMTransformUtils \
143 libLLVMCore \
144 libLLVMSupport \
145 libLLVMSystem \
146 libLLVMAnalysis
147
148LOCAL_LDLIBS := -ldl -lpthread
149
150LOCAL_C_INCLUDES := \
151 $(LOCAL_PATH)/include
152
Shih-wei Liaoe64c2872010-10-25 13:44:53 -0700153# definitions for LLVM
Shih-wei Liao7c5a5f72010-11-08 01:59:13 -0800154LOCAL_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 -0700155
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700156ifeq ($(USE_DISASSEMBLER),true)
157LOCAL_CFLAGS += -DUSE_DISASSEMBLER
158LOCAL_STATIC_LIBRARIES := \
Shih-wei Liaoe64c2872010-10-25 13:44:53 -0700159 libLLVMARMDisassembler \
160 libLLVMARMAsmPrinter \
161 libLLVMMCParser \
Shih-wei Liaocd61af32010-04-29 00:02:57 -0700162 $(LOCAL_STATIC_LIBRARIES)
163endif
164
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700165include $(LLVM_ROOT_PATH)/llvm-host-build.mk
166include $(BUILD_HOST_SHARED_LIBRARY)
167
168# Build children
169# ========================================================
170
171include $(call all-makefiles-under,$(LOCAL_PATH))
Carl Shapiro105a9d22010-04-13 17:53:26 -0700172
Shih-wei Liao800e9c22010-04-18 16:08:16 -0700173endif # TARGET_SIMULATOR != true