Zonr Chang | 932648d | 2010-10-13 22:23:56 +0800 | [diff] [blame] | 1 | # |
Stephen Hines | db16918 | 2012-01-05 18:46:36 -0800 | [diff] [blame] | 2 | # Copyright (C) 2010-2012 The Android Open Source Project |
Zonr Chang | 932648d | 2010-10-13 22:23:56 +0800 | [diff] [blame] | 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 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 18 | LIBBCC_ROOT_PATH := $(LOCAL_PATH) |
David Gross | 0ab47eb | 2015-06-12 14:28:35 -0700 | [diff] [blame] | 19 | |
| 20 | FORCE_BUILD_LLVM_DISABLE_NDEBUG ?= false |
| 21 | # Legality check: FORCE_BUILD_LLVM_DISABLE_NDEBUG should consist of one word -- either "true" or "false". |
| 22 | ifneq "$(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) |
| 24 | endif |
| 25 | |
| 26 | FORCE_BUILD_LLVM_DEBUG ?= false |
| 27 | # Legality check: FORCE_BUILD_LLVM_DEBUG should consist of one word -- either "true" or "false". |
| 28 | ifneq "$(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) |
| 30 | endif |
| 31 | |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 32 | include $(LIBBCC_ROOT_PATH)/libbcc.mk |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 33 | |
Stephen Hines | e109434 | 2014-05-13 17:55:49 -0700 | [diff] [blame] | 34 | include frameworks/compile/slang/rs_version.mk |
| 35 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 36 | #===================================================================== |
| 37 | # Whole Static Library to Be Linked In |
| 38 | #===================================================================== |
Logan | 3584900 | 2011-01-15 07:30:43 +0800 | [diff] [blame] | 39 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 40 | libbcc_WHOLE_STATIC_LIBRARIES += \ |
Stephen Hines | e198abe | 2012-07-27 18:05:41 -0700 | [diff] [blame] | 41 | libbccRenderscript \ |
Zonr Chang | c72c4dd | 2012-04-12 15:38:53 +0800 | [diff] [blame] | 42 | libbccCore \ |
| 43 | libbccSupport |
Logan Chien | 8d3b5e1 | 2011-07-12 16:19:21 +0800 | [diff] [blame] | 44 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 45 | #===================================================================== |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 46 | # Device Shared Library libbcc |
| 47 | #===================================================================== |
Tim Murray | c6e6ee4 | 2014-04-07 14:13:26 -0700 | [diff] [blame] | 48 | ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS)) |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 49 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 50 | include $(CLEAR_VARS) |
Iliyan Malchev | 97bd44d | 2011-03-14 14:02:14 -0700 | [diff] [blame] | 51 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 52 | LOCAL_MODULE := libbcc |
Zonr Chang | 932648d | 2010-10-13 22:23:56 +0800 | [diff] [blame] | 53 | LOCAL_MODULE_TAGS := optional |
Joseph Wen | 5de1adf | 2011-06-21 15:41:31 -0700 | [diff] [blame] | 54 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 55 | |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 56 | LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES) |
| 57 | |
Tim Murray | c2074ca | 2014-04-08 15:39:08 -0700 | [diff] [blame] | 58 | LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils liblog libc++ |
Logan Chien | 41cb761 | 2011-07-12 16:12:03 +0800 | [diff] [blame] | 59 | |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 60 | # Modules that need get installed if and only if the target libbcc.so is |
| 61 | # installed. |
Jean-Luc Brouillet | c5e607a | 2014-06-18 18:14:02 -0700 | [diff] [blame] | 62 | LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.bc libcompiler_rt |
Ying Wang | 3ae8c2a | 2011-01-14 10:50:53 -0800 | [diff] [blame] | 63 | |
Colin Cross | 71df050 | 2014-02-04 16:27:32 -0800 | [diff] [blame] | 64 | LOCAL_REQUIRED_MODULES_x86 += libclcore_x86.bc |
| 65 | LOCAL_REQUIRED_MODULES_x86_64 += libclcore_x86.bc |
Michael Liao | cdcce32 | 2012-09-25 21:59:39 -0700 | [diff] [blame] | 66 | |
Stephen Hines | 43b3727 | 2012-05-08 19:02:21 -0700 | [diff] [blame] | 67 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
Colin Cross | 71df050 | 2014-02-04 16:27:32 -0800 | [diff] [blame] | 68 | LOCAL_REQUIRED_MODULES_arm += libclcore_neon.bc |
Stephen Hines | 43b3727 | 2012-05-08 19:02:21 -0700 | [diff] [blame] | 69 | endif |
| 70 | |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 71 | include $(LIBBCC_DEVICE_BUILD_MK) |
Stephen Hines | f21590e | 2014-07-15 16:49:25 -0700 | [diff] [blame] | 72 | include $(LLVM_DEVICE_BUILD_MK) |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 73 | include $(BUILD_SHARED_LIBRARY) |
Tim Murray | c6e6ee4 | 2014-04-07 14:13:26 -0700 | [diff] [blame] | 74 | endif |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 75 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 76 | #===================================================================== |
| 77 | # Host Shared Library libbcc |
| 78 | #===================================================================== |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 79 | |
Ying Wang | 8d01bd8 | 2014-08-01 14:19:38 -0700 | [diff] [blame] | 80 | # Don't build for unbundled branches |
| 81 | ifeq (,$(TARGET_BUILD_APPS)) |
| 82 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 83 | include $(CLEAR_VARS) |
| 84 | |
| 85 | LOCAL_MODULE := libbcc |
Zonr Chang | 932648d | 2010-10-13 22:23:56 +0800 | [diff] [blame] | 86 | LOCAL_MODULE_TAGS := optional |
Joseph Wen | 5de1adf | 2011-06-21 15:41:31 -0700 | [diff] [blame] | 87 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 88 | LOCAL_IS_HOST_MODULE := true |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 89 | |
Logan Chien | be11535 | 2014-05-26 23:00:06 +0800 | [diff] [blame] | 90 | ifneq ($(HOST_OS),windows) |
Tim Murray | c2074ca | 2014-04-08 15:39:08 -0700 | [diff] [blame] | 91 | LOCAL_CLANG := true |
Logan Chien | be11535 | 2014-05-26 23:00:06 +0800 | [diff] [blame] | 92 | endif |
Tim Murray | c2074ca | 2014-04-08 15:39:08 -0700 | [diff] [blame] | 93 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 94 | LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES) |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 95 | |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 96 | LOCAL_STATIC_LIBRARIES += \ |
Zonr Chang | c989dce | 2012-04-12 12:03:04 +0800 | [diff] [blame] | 97 | libutils \ |
Ying Wang | 2edf6d6 | 2013-04-09 21:54:38 -0700 | [diff] [blame] | 98 | libcutils \ |
| 99 | liblog |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 100 | |
Matt Wala | 999d924 | 2015-08-04 11:35:27 -0700 | [diff] [blame] | 101 | LOCAL_SHARED_LIBRARIES := libbcinfo |
Stephen Hines | 569986d | 2012-03-09 19:58:45 -0800 | [diff] [blame] | 102 | |
Stephen Hines | a6485fc | 2015-07-23 20:11:03 -0700 | [diff] [blame] | 103 | ifndef USE_MINGW |
| 104 | LOCAL_LDLIBS := -ldl -lpthread |
| 105 | endif |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 106 | |
Matt Wala | 999d924 | 2015-08-04 11:35:27 -0700 | [diff] [blame] | 107 | include $(LIBBCC_ROOT_PATH)/llvm-loadable-libbcc.mk |
| 108 | |
| 109 | ifeq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true) |
| 110 | LOCAL_STATIC_LIBRARIES += libLLVMLinker |
| 111 | else |
| 112 | LOCAL_SHARED_LIBRARIES += libLLVM |
| 113 | endif |
| 114 | |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 115 | include $(LIBBCC_HOST_BUILD_MK) |
Stephen Hines | f21590e | 2014-07-15 16:49:25 -0700 | [diff] [blame] | 116 | include $(LLVM_HOST_BUILD_MK) |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 117 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 118 | |
Tim Murray | 6297382 | 2013-02-06 17:22:23 -0800 | [diff] [blame] | 119 | endif # Don't build in unbundled branches |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 120 | |
| 121 | #===================================================================== |
| 122 | # Include Subdirectories |
| 123 | #===================================================================== |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 124 | include $(call all-makefiles-under,$(LOCAL_PATH)) |