blob: 4ed3ebd0d8e689f25b0910fffadf5c4c7097a0a5 [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
Shih-wei Liao77ed6142010-04-07 12:21:42 -070017LOCAL_PATH := $(call my-dir)
Zonr Changddf56612012-04-12 15:38:42 +080018LIBBCC_ROOT_PATH := $(LOCAL_PATH)
David Gross0ab47eb2015-06-12 14:28:35 -070019
20FORCE_BUILD_LLVM_DISABLE_NDEBUG ?= false
21# Legality check: FORCE_BUILD_LLVM_DISABLE_NDEBUG should consist of one word -- either "true" or "false".
22ifneq "$(words $(FORCE_BUILD_LLVM_DISABLE_NDEBUG))$(words $(filter-out true false,$(FORCE_BUILD_LLVM_DISABLE_NDEBUG)))" "10"
23 $(error FORCE_BUILD_LLVM_DISABLE_NDEBUG may only be true, false, or unset)
24endif
25
26FORCE_BUILD_LLVM_DEBUG ?= false
27# Legality check: FORCE_BUILD_LLVM_DEBUG should consist of one word -- either "true" or "false".
28ifneq "$(words $(FORCE_BUILD_LLVM_DEBUG))$(words $(filter-out true false,$(FORCE_BUILD_LLVM_DEBUG)))" "10"
29 $(error FORCE_BUILD_LLVM_DEBUG may only be true, false, or unset)
30endif
31
Zonr Changddf56612012-04-12 15:38:42 +080032include $(LIBBCC_ROOT_PATH)/libbcc.mk
Shih-wei Liao77ed6142010-04-07 12:21:42 -070033
Stephen Hinese1094342014-05-13 17:55:49 -070034include frameworks/compile/slang/rs_version.mk
35
Logan Chien74396852011-07-12 15:50:26 +080036#=====================================================================
37# Whole Static Library to Be Linked In
38#=====================================================================
Logan35849002011-01-15 07:30:43 +080039
Logan Chien74396852011-07-12 15:50:26 +080040libbcc_WHOLE_STATIC_LIBRARIES += \
Stephen Hinese198abe2012-07-27 18:05:41 -070041 libbccRenderscript \
Zonr Changc72c4dd2012-04-12 15:38:53 +080042 libbccCore \
43 libbccSupport
Logan Chien8d3b5e12011-07-12 16:19:21 +080044
Logan Chien74396852011-07-12 15:50:26 +080045#=====================================================================
Logan Chien74396852011-07-12 15:50:26 +080046# Device Shared Library libbcc
47#=====================================================================
Tim Murrayc6e6ee42014-04-07 14:13:26 -070048ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
Logan Chien74396852011-07-12 15:50:26 +080049
Shih-wei Liao77ed6142010-04-07 12:21:42 -070050include $(CLEAR_VARS)
Iliyan Malchev97bd44d2011-03-14 14:02:14 -070051
Shih-wei Liao77ed6142010-04-07 12:21:42 -070052LOCAL_MODULE := libbcc
Zonr Chang932648d2010-10-13 22:23:56 +080053LOCAL_MODULE_TAGS := optional
Joseph Wen5de1adf2011-06-21 15:41:31 -070054LOCAL_MODULE_CLASS := SHARED_LIBRARIES
Shih-wei Liao77ed6142010-04-07 12:21:42 -070055
Logan Chien21392f02011-11-26 20:32:01 +080056LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES)
57
Tim Murrayc2074ca2014-04-08 15:39:08 -070058LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils liblog libc++
Logan Chien41cb7612011-07-12 16:12:03 +080059
Logan Chien21392f02011-11-26 20:32:01 +080060# Modules that need get installed if and only if the target libbcc.so is
61# installed.
Dean De Leo0bbbd662015-11-25 13:03:21 +000062LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.bc libclcore_g.bc libcompiler_rt
Ying Wang3ae8c2a2011-01-14 10:50:53 -080063
Colin Cross71df0502014-02-04 16:27:32 -080064LOCAL_REQUIRED_MODULES_x86 += libclcore_x86.bc
65LOCAL_REQUIRED_MODULES_x86_64 += libclcore_x86.bc
Michael Liaocdcce322012-09-25 21:59:39 -070066
Stephen Hines43b37272012-05-08 19:02:21 -070067ifeq ($(ARCH_ARM_HAVE_NEON),true)
Colin Cross71df0502014-02-04 16:27:32 -080068 LOCAL_REQUIRED_MODULES_arm += libclcore_neon.bc
Stephen Hines43b37272012-05-08 19:02:21 -070069endif
70
Zonr Changddf56612012-04-12 15:38:42 +080071include $(LIBBCC_DEVICE_BUILD_MK)
Stephen Hinesf21590e2014-07-15 16:49:25 -070072include $(LLVM_DEVICE_BUILD_MK)
Shih-wei Liao77ed6142010-04-07 12:21:42 -070073include $(BUILD_SHARED_LIBRARY)
Tim Murrayc6e6ee42014-04-07 14:13:26 -070074endif
Shih-wei Liao77ed6142010-04-07 12:21:42 -070075
Logan Chien74396852011-07-12 15:50:26 +080076#=====================================================================
77# Host Shared Library libbcc
78#=====================================================================
Logan Chien21392f02011-11-26 20:32:01 +080079
Ying Wang8d01bd82014-08-01 14:19:38 -070080# Don't build for unbundled branches
81ifeq (,$(TARGET_BUILD_APPS))
82
Shih-wei Liao77ed6142010-04-07 12:21:42 -070083include $(CLEAR_VARS)
84
85LOCAL_MODULE := libbcc
Dan Willemsen6af50b72015-08-18 16:52:32 -070086LOCAL_MODULE_HOST_OS := darwin linux windows
Joseph Wen5de1adf2011-06-21 15:41:31 -070087LOCAL_MODULE_CLASS := SHARED_LIBRARIES
88LOCAL_IS_HOST_MODULE := true
Logan Chien74396852011-07-12 15:50:26 +080089
90LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES)
Shih-wei Liao77ed6142010-04-07 12:21:42 -070091
Logan Chien21392f02011-11-26 20:32:01 +080092LOCAL_STATIC_LIBRARIES += \
Zonr Changc989dce2012-04-12 12:03:04 +080093 libutils \
Ying Wang2edf6d62013-04-09 21:54:38 -070094 libcutils \
95 liblog
Logan Chien21392f02011-11-26 20:32:01 +080096
Matt Wala999d9242015-08-04 11:35:27 -070097LOCAL_SHARED_LIBRARIES := libbcinfo
Stephen Hines569986d2012-03-09 19:58:45 -080098
Dan Willemsen6af50b72015-08-18 16:52:32 -070099LOCAL_LDLIBS_darwin := -ldl -lpthread
100LOCAL_LDLIBS_linux := -ldl -lpthread
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700101
Matt Wala999d9242015-08-04 11:35:27 -0700102include $(LIBBCC_ROOT_PATH)/llvm-loadable-libbcc.mk
103
104ifeq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true)
Dan Willemsen6af50b72015-08-18 16:52:32 -0700105LOCAL_STATIC_LIBRARIES_linux += libLLVMLinker
Matt Wala999d9242015-08-04 11:35:27 -0700106else
Dan Willemsen6af50b72015-08-18 16:52:32 -0700107LOCAL_SHARED_LIBRARIES_linux += libLLVM
Matt Wala999d9242015-08-04 11:35:27 -0700108endif
Dan Willemsen6af50b72015-08-18 16:52:32 -0700109LOCAL_SHARED_LIBRARIES_darwin += libLLVM
110LOCAL_SHARED_LIBRARIES_windows += libLLVM
Matt Wala999d9242015-08-04 11:35:27 -0700111
Zonr Changddf56612012-04-12 15:38:42 +0800112include $(LIBBCC_HOST_BUILD_MK)
Stephen Hinesf21590e2014-07-15 16:49:25 -0700113include $(LLVM_HOST_BUILD_MK)
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700114include $(BUILD_HOST_SHARED_LIBRARY)
115
Tim Murray62973822013-02-06 17:22:23 -0800116endif # Don't build in unbundled branches
Logan Chien74396852011-07-12 15:50:26 +0800117
118#=====================================================================
119# Include Subdirectories
120#=====================================================================
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700121include $(call all-makefiles-under,$(LOCAL_PATH))