blob: 1ab83868122f8f32563573d152addd70ef76d801 [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.
Jean-Luc Brouilletc5e607a2014-06-18 18:14:02 -070062LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.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
Zonr Chang932648d2010-10-13 22:23:56 +080086LOCAL_MODULE_TAGS := optional
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
Logan Chienbe115352014-05-26 23:00:06 +080090ifneq ($(HOST_OS),windows)
Tim Murrayc2074ca2014-04-08 15:39:08 -070091LOCAL_CLANG := true
Logan Chienbe115352014-05-26 23:00:06 +080092endif
Tim Murrayc2074ca2014-04-08 15:39:08 -070093
Logan Chien74396852011-07-12 15:50:26 +080094LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES)
Shih-wei Liao77ed6142010-04-07 12:21:42 -070095
Logan Chien21392f02011-11-26 20:32:01 +080096LOCAL_STATIC_LIBRARIES += \
Zonr Changc989dce2012-04-12 12:03:04 +080097 libutils \
Ying Wang2edf6d62013-04-09 21:54:38 -070098 libcutils \
99 liblog
Logan Chien21392f02011-11-26 20:32:01 +0800100
Stephen Hinesba8d7ce2013-02-27 00:40:04 -0800101LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM
Stephen Hines569986d2012-03-09 19:58:45 -0800102
Stephen Hines48cd7452013-07-30 22:33:44 -0700103ifndef USE_MINGW
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700104LOCAL_LDLIBS := -ldl -lpthread
Stephen Hines48cd7452013-07-30 22:33:44 -0700105endif
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700106
Zonr Changddf56612012-04-12 15:38:42 +0800107include $(LIBBCC_HOST_BUILD_MK)
Stephen Hinesf21590e2014-07-15 16:49:25 -0700108include $(LLVM_HOST_BUILD_MK)
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700109include $(BUILD_HOST_SHARED_LIBRARY)
110
Tim Murray62973822013-02-06 17:22:23 -0800111endif # Don't build in unbundled branches
Logan Chien74396852011-07-12 15:50:26 +0800112
113#=====================================================================
114# Include Subdirectories
115#=====================================================================
Shih-wei Liao77ed6142010-04-07 12:21:42 -0700116include $(call all-makefiles-under,$(LOCAL_PATH))