blob: bd465d6bc9f2c38d9dc2177e80395543bf33aee9 [file] [log] [blame]
Zonr Chang932648d2010-10-13 22:23:56 +08001#
Stephen Hinesdb169182012-01-05 18:46:36 -08002# Copyright (C) 2010-2012 The Android Open Source Project
Zonr Chang932648d2010-10-13 22:23:56 +08003#
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
Tim Murray62973822013-02-06 17:22:23 -080017# Don't build for unbundled branches
18ifeq (,$(TARGET_BUILD_APPS))
19
Shih-wei Liao77ed6142010-04-07 12:21:42 -070020LOCAL_PATH := $(call my-dir)
Zonr Changddf56612012-04-12 15:38:42 +080021LIBBCC_ROOT_PATH := $(LOCAL_PATH)
22include $(LIBBCC_ROOT_PATH)/libbcc.mk
Shih-wei Liao77ed6142010-04-07 12:21:42 -070023
Logan Chien74396852011-07-12 15:50:26 +080024#=====================================================================
25# Whole Static Library to Be Linked In
26#=====================================================================
Logan35849002011-01-15 07:30:43 +080027
Logan Chien74396852011-07-12 15:50:26 +080028libbcc_WHOLE_STATIC_LIBRARIES += \
Stephen Hinese198abe2012-07-27 18:05:41 -070029 libbccRenderscript \
Logan Chien74396852011-07-12 15:50:26 +080030 libbccExecutionEngine \
Zonr Changc72c4dd2012-04-12 15:38:53 +080031 libbccCore \
32 libbccSupport
Logan Chien8d3b5e12011-07-12 16:19:21 +080033
Logan Chien74396852011-07-12 15:50:26 +080034#=====================================================================
Shih-wei Liao2665c2f2012-04-25 04:06:52 -070035# Calculate SHA1 checksum for libbcc.so, libRS.so and libclcore.bc
Logan Chien74396852011-07-12 15:50:26 +080036#=====================================================================
37
Colin Cross71df0502014-02-04 16:27:32 -080038my_2nd_arch_prefix :=
39include $(LOCAL_PATH)/libbcc.sha1.mk
40ifneq ($(TARGET_2ND_ARCH),)
41my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
42include $(LOCAL_PATH)/libbcc.sha1.mk
Shih-wei Liaob1cc74f2012-06-30 11:27:01 -070043endif
Colin Cross71df0502014-02-04 16:27:32 -080044my_2nd_arch_prefix :=
Logan Chien74396852011-07-12 15:50:26 +080045
46#=====================================================================
47# Device Shared Library libbcc
48#=====================================================================
Tim Murrayc6e6ee42014-04-07 14:13:26 -070049ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
Colin Cross71df0502014-02-04 16:27:32 -080050ifeq ($(TARGET_ARCH),arm64)
51$(info TODOArm64: $(LOCAL_PATH)/Android.mk Enable libbcc build)
52endif
53
54ifeq ($(TARGET_ARCH),mips64)
55$(info TODOMips64: $(LOCAL_PATH)/Android.mk Enable libbcc build)
56endif
Logan Chien74396852011-07-12 15:50:26 +080057
Shih-wei Liao77ed6142010-04-07 12:21:42 -070058include $(CLEAR_VARS)
Iliyan Malchev97bd44d2011-03-14 14:02:14 -070059
Shih-wei Liao77ed6142010-04-07 12:21:42 -070060LOCAL_MODULE := libbcc
Zonr Chang932648d2010-10-13 22:23:56 +080061LOCAL_MODULE_TAGS := optional
Joseph Wen5de1adf2011-06-21 15:41:31 -070062LOCAL_MODULE_CLASS := SHARED_LIBRARIES
Shih-wei Liao77ed6142010-04-07 12:21:42 -070063
Logan Chien21392f02011-11-26 20:32:01 +080064LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES)
65
Shih-wei Liao590a2492012-07-22 16:33:34 -070066LOCAL_WHOLE_STATIC_LIBRARIES += librsloader
Shih-wei Liaoddfd1ad2011-06-18 01:47:27 -070067
Tim Murrayc2074ca2014-04-08 15:39:08 -070068LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils liblog libc++
Logan Chien41cb7612011-07-12 16:12:03 +080069
Logan Chien21392f02011-11-26 20:32:01 +080070# Modules that need get installed if and only if the target libbcc.so is
71# installed.
Stephen Hines8ee82d42013-04-16 19:57:34 -070072LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.bc libbcc.sha1 libcompiler_rt
Ying Wang3ae8c2a2011-01-14 10:50:53 -080073
Colin Cross71df0502014-02-04 16:27:32 -080074LOCAL_REQUIRED_MODULES_x86 += libclcore_x86.bc
75LOCAL_REQUIRED_MODULES_x86_64 += libclcore_x86.bc
Michael Liaocdcce322012-09-25 21:59:39 -070076
Stephen Hines43b37272012-05-08 19:02:21 -070077ifeq ($(ARCH_ARM_HAVE_NEON),true)
Colin Cross71df0502014-02-04 16:27:32 -080078 LOCAL_REQUIRED_MODULES_arm += libclcore_neon.bc
Stephen Hines43b37272012-05-08 19:02:21 -070079endif
80
Zonr Chang7a5d4232012-04-12 15:39:06 +080081# Generate build information (Build time + Build git revision + Build Semi SHA1)
Colin Cross71df0502014-02-04 16:27:32 -080082my_2nd_arch_prefix :=
Zonr Chang7a5d4232012-04-12 15:39:06 +080083include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk
Colin Cross71df0502014-02-04 16:27:32 -080084ifdef TARGET_2ND_ARCH
85my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
86include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk
87endif
88my_2nd_arch_prefix :=
Logan Chien48dc01d2011-07-13 18:12:06 +080089
Zonr Changddf56612012-04-12 15:38:42 +080090include $(LIBBCC_DEVICE_BUILD_MK)
Shih-wei Liao77ed6142010-04-07 12:21:42 -070091include $(BUILD_SHARED_LIBRARY)
Tim Murrayc6e6ee42014-04-07 14:13:26 -070092endif
Shih-wei Liao77ed6142010-04-07 12:21:42 -070093
Logan Chien74396852011-07-12 15:50:26 +080094#=====================================================================
95# Host Shared Library libbcc
96#=====================================================================
Logan Chien21392f02011-11-26 20:32:01 +080097
Shih-wei Liao77ed6142010-04-07 12:21:42 -070098include $(CLEAR_VARS)
99
100LOCAL_MODULE := libbcc
Zonr Chang932648d2010-10-13 22:23:56 +0800101LOCAL_MODULE_TAGS := optional
Joseph Wen5de1adf2011-06-21 15:41:31 -0700102LOCAL_MODULE_CLASS := SHARED_LIBRARIES
103LOCAL_IS_HOST_MODULE := true
Logan Chien74396852011-07-12 15:50:26 +0800104
Tim Murrayc2074ca2014-04-08 15:39:08 -0700105LOCAL_CLANG := true
106
Logan Chien74396852011-07-12 15:50:26 +0800107LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES)
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700108
Shih-wei Liao590a2492012-07-22 16:33:34 -0700109LOCAL_WHOLE_STATIC_LIBRARIES += librsloader
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700110
Logan Chien21392f02011-11-26 20:32:01 +0800111LOCAL_STATIC_LIBRARIES += \
Zonr Changc989dce2012-04-12 12:03:04 +0800112 libutils \
Ying Wang2edf6d62013-04-09 21:54:38 -0700113 libcutils \
114 liblog
Logan Chien21392f02011-11-26 20:32:01 +0800115
Stephen Hinesba8d7ce2013-02-27 00:40:04 -0800116LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM
Stephen Hines569986d2012-03-09 19:58:45 -0800117
Stephen Hines48cd7452013-07-30 22:33:44 -0700118ifndef USE_MINGW
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700119LOCAL_LDLIBS := -ldl -lpthread
Stephen Hines48cd7452013-07-30 22:33:44 -0700120endif
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700121
Zonr Chang7a5d4232012-04-12 15:39:06 +0800122# Generate build information (Build time + Build git revision + Build Semi SHA1)
Colin Cross71df0502014-02-04 16:27:32 -0800123my_2nd_arch_prefix :=
Zonr Chang7a5d4232012-04-12 15:39:06 +0800124include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk
Logan Chien48dc01d2011-07-13 18:12:06 +0800125
Zonr Changddf56612012-04-12 15:38:42 +0800126include $(LIBBCC_HOST_BUILD_MK)
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700127include $(BUILD_HOST_SHARED_LIBRARY)
128
Tim Murray62973822013-02-06 17:22:23 -0800129endif # Don't build in unbundled branches
Logan Chien74396852011-07-12 15:50:26 +0800130
131#=====================================================================
132# Include Subdirectories
133#=====================================================================
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700134include $(call all-makefiles-under,$(LOCAL_PATH))