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 | |
Tim Murray | 6297382 | 2013-02-06 17:22:23 -0800 | [diff] [blame] | 17 | # Don't build for unbundled branches |
| 18 | ifeq (,$(TARGET_BUILD_APPS)) |
| 19 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 20 | LOCAL_PATH := $(call my-dir) |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 21 | LIBBCC_ROOT_PATH := $(LOCAL_PATH) |
| 22 | include $(LIBBCC_ROOT_PATH)/libbcc.mk |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 23 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 24 | #===================================================================== |
| 25 | # Whole Static Library to Be Linked In |
| 26 | #===================================================================== |
Logan | 3584900 | 2011-01-15 07:30:43 +0800 | [diff] [blame] | 27 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 28 | libbcc_WHOLE_STATIC_LIBRARIES += \ |
Shih-wei Liao | 52aefd8 | 2012-07-27 03:12:56 -0700 | [diff] [blame] | 29 | libbccAndroidBitcode \ |
Stephen Hines | e198abe | 2012-07-27 18:05:41 -0700 | [diff] [blame] | 30 | libbccRenderscript \ |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 31 | libbccExecutionEngine \ |
Zonr Chang | c72c4dd | 2012-04-12 15:38:53 +0800 | [diff] [blame] | 32 | libbccCore \ |
| 33 | libbccSupport |
Logan Chien | 8d3b5e1 | 2011-07-12 16:19:21 +0800 | [diff] [blame] | 34 | |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 35 | libmcld_STATIC_LIBRARIES += \ |
| 36 | libmcldCodeGen \ |
| 37 | libmcldTarget \ |
| 38 | libmcldLDVariant \ |
| 39 | libmcldMC \ |
Shih-wei Liao | 52acbab | 2012-12-17 01:59:15 -0800 | [diff] [blame] | 40 | libmcldObject \ |
| 41 | libmcldFragment \ |
| 42 | libmcldCore \ |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 43 | libmcldSupport \ |
| 44 | libmcldADT \ |
| 45 | libmcldLD |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 46 | |
| 47 | #===================================================================== |
Shih-wei Liao | 2665c2f | 2012-04-25 04:06:52 -0700 | [diff] [blame] | 48 | # Calculate SHA1 checksum for libbcc.so, libRS.so and libclcore.bc |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 49 | #===================================================================== |
| 50 | |
Joseph Wen | 2ca6e57 | 2011-06-24 14:12:23 -0700 | [diff] [blame] | 51 | include $(CLEAR_VARS) |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 52 | |
Zonr Chang | f290793 | 2012-04-13 11:56:21 +0800 | [diff] [blame] | 53 | LOCAL_MODULE := libbcc.sha1 |
Joseph Wen | 2ca6e57 | 2011-06-24 14:12:23 -0700 | [diff] [blame] | 54 | LOCAL_MODULE_TAGS := optional |
| 55 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 56 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 57 | libbcc_SHA1_SRCS := \ |
| 58 | $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libbcc.so \ |
Shih-wei Liao | f7401ab | 2013-01-25 16:29:44 -0800 | [diff] [blame] | 59 | $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libcompiler_rt.so \ |
Shih-wei Liao | 2665c2f | 2012-04-25 04:06:52 -0700 | [diff] [blame] | 60 | $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRS.so \ |
| 61 | $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore.bc,,)/libclcore.bc |
Ying Wang | 0b48695 | 2011-07-01 13:37:01 -0700 | [diff] [blame] | 62 | |
Shih-wei Liao | b1cc74f | 2012-06-30 11:27:01 -0700 | [diff] [blame] | 63 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
| 64 | libbcc_SHA1_SRCS += \ |
| 65 | $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore_neon.bc,,)/libclcore_neon.bc |
| 66 | endif |
| 67 | |
Zonr Chang | b4db722 | 2012-02-06 14:21:20 +0800 | [diff] [blame] | 68 | libbcc_GEN_SHA1_STAMP := $(LOCAL_PATH)/tools/build/gen-sha1-stamp.py |
Zonr Chang | f290793 | 2012-04-13 11:56:21 +0800 | [diff] [blame] | 69 | intermediates := $(call local-intermediates-dir) |
Logan Chien | 6888aae | 2011-07-12 16:47:10 +0800 | [diff] [blame] | 70 | |
Zonr Chang | f290793 | 2012-04-13 11:56:21 +0800 | [diff] [blame] | 71 | libbcc_SHA1_ASM := $(intermediates)/libbcc.sha1.S |
| 72 | LOCAL_GENERATED_SOURCES += $(libbcc_SHA1_ASM) |
| 73 | $(libbcc_SHA1_ASM): PRIVATE_SHA1_SRCS := $(libbcc_SHA1_SRCS) |
| 74 | $(libbcc_SHA1_ASM): $(libbcc_SHA1_SRCS) $(libbcc_GEN_SHA1_STAMP) |
| 75 | @echo libbcc.sha1: $@ |
| 76 | $(hide) mkdir -p $(dir $@) |
| 77 | $(hide) $(libbcc_GEN_SHA1_STAMP) $(PRIVATE_SHA1_SRCS) > $@ |
Joseph Wen | 2ca6e57 | 2011-06-24 14:12:23 -0700 | [diff] [blame] | 78 | |
Zonr Chang | f290793 | 2012-04-13 11:56:21 +0800 | [diff] [blame] | 79 | LOCAL_CFLAGS += -D_REENTRANT -DPIC -fPIC |
| 80 | LOCAL_CFLAGS += -O3 -nodefaultlibs -nostdlib |
| 81 | |
| 82 | include $(BUILD_SHARED_LIBRARY) |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 83 | |
| 84 | #===================================================================== |
| 85 | # Device Shared Library libbcc |
| 86 | #===================================================================== |
| 87 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 88 | include $(CLEAR_VARS) |
Iliyan Malchev | 97bd44d | 2011-03-14 14:02:14 -0700 | [diff] [blame] | 89 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 90 | LOCAL_MODULE := libbcc |
Zonr Chang | 932648d | 2010-10-13 22:23:56 +0800 | [diff] [blame] | 91 | LOCAL_MODULE_TAGS := optional |
Joseph Wen | 5de1adf | 2011-06-21 15:41:31 -0700 | [diff] [blame] | 92 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 93 | |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 94 | LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES) |
| 95 | |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 96 | LOCAL_WHOLE_STATIC_LIBRARIES += librsloader |
Shih-wei Liao | ddfd1ad | 2011-06-18 01:47:27 -0700 | [diff] [blame] | 97 | |
Logan Chien | 41cb761 | 2011-07-12 16:12:03 +0800 | [diff] [blame] | 98 | ifeq ($(TARGET_ARCH),arm) |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 99 | LOCAL_WHOLE_STATIC_LIBRARIES += \ |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 100 | libmcldARMTarget \ |
Stephen Hines | 4b77872 | 2013-02-27 23:22:45 -0800 | [diff] [blame] | 101 | libmcldARMInfo |
Logan Chien | 41cb761 | 2011-07-12 16:12:03 +0800 | [diff] [blame] | 102 | else |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 103 | ifeq ($(TARGET_ARCH), mips) |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 104 | LOCAL_WHOLE_STATIC_LIBRARIES += \ |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 105 | libmcldMipsTarget \ |
Stephen Hines | 4b77872 | 2013-02-27 23:22:45 -0800 | [diff] [blame] | 106 | libmcldMipsInfo |
Logan Chien | 41cb761 | 2011-07-12 16:12:03 +0800 | [diff] [blame] | 107 | else |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 108 | ifeq ($(TARGET_ARCH),x86) # We don't support x86-64 right now |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 109 | LOCAL_WHOLE_STATIC_LIBRARIES += \ |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 110 | libmcldX86Target \ |
Stephen Hines | 4b77872 | 2013-02-27 23:22:45 -0800 | [diff] [blame] | 111 | libmcldX86Info |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 112 | else |
| 113 | $(error Unsupported TARGET_ARCH $(TARGET_ARCH)) |
| 114 | endif |
Logan Chien | 41cb761 | 2011-07-12 16:12:03 +0800 | [diff] [blame] | 115 | endif |
| 116 | endif |
| 117 | |
Stephen Hines | 4b77872 | 2013-02-27 23:22:45 -0800 | [diff] [blame] | 118 | LOCAL_WHOLE_STATIC_LIBRARIES += $(libmcld_STATIC_LIBRARIES) |
| 119 | LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils libstlport |
Logan Chien | 41cb761 | 2011-07-12 16:12:03 +0800 | [diff] [blame] | 120 | |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 121 | # Modules that need get installed if and only if the target libbcc.so is |
| 122 | # installed. |
Shih-wei Liao | f7401ab | 2013-01-25 16:29:44 -0800 | [diff] [blame] | 123 | LOCAL_REQUIRED_MODULES := libclcore.bc libbcc.sha1 libcompiler_rt |
Ying Wang | 3ae8c2a | 2011-01-14 10:50:53 -0800 | [diff] [blame] | 124 | |
Michael Liao | cdcce32 | 2012-09-25 21:59:39 -0700 | [diff] [blame] | 125 | ifeq ($(ARCH_X86_HAVE_SSE2),true) |
| 126 | LOCAL_REQUIRED_MODULES += libclcore_x86.bc |
| 127 | endif |
| 128 | |
Stephen Hines | 43b3727 | 2012-05-08 19:02:21 -0700 | [diff] [blame] | 129 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
| 130 | LOCAL_REQUIRED_MODULES += libclcore_neon.bc |
| 131 | endif |
| 132 | |
Zonr Chang | 7a5d423 | 2012-04-12 15:39:06 +0800 | [diff] [blame] | 133 | # Generate build information (Build time + Build git revision + Build Semi SHA1) |
| 134 | include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk |
Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 135 | |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 136 | include $(LIBBCC_DEVICE_BUILD_MK) |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 137 | include $(BUILD_SHARED_LIBRARY) |
| 138 | |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 139 | #===================================================================== |
| 140 | # Host Shared Library libbcc |
| 141 | #===================================================================== |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 142 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 143 | include $(CLEAR_VARS) |
| 144 | |
| 145 | LOCAL_MODULE := libbcc |
Zonr Chang | 932648d | 2010-10-13 22:23:56 +0800 | [diff] [blame] | 146 | LOCAL_MODULE_TAGS := optional |
Joseph Wen | 5de1adf | 2011-06-21 15:41:31 -0700 | [diff] [blame] | 147 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 148 | LOCAL_IS_HOST_MODULE := true |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 149 | |
| 150 | LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES) |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 151 | |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 152 | LOCAL_WHOLE_STATIC_LIBRARIES += librsloader |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 153 | |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 154 | LOCAL_WHOLE_STATIC_LIBRARIES += \ |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 155 | libmcldARMTarget \ |
| 156 | libmcldARMInfo \ |
| 157 | libmcldMipsTarget \ |
| 158 | libmcldMipsInfo \ |
| 159 | libmcldX86Target \ |
| 160 | libmcldX86Info |
| 161 | |
Shih-wei Liao | 590a249 | 2012-07-22 16:33:34 -0700 | [diff] [blame] | 162 | LOCAL_WHOLE_STATIC_LIBRARIES += $(libmcld_STATIC_LIBRARIES) |
Shih-wei Liao | e636266 | 2012-07-16 10:17:55 -0700 | [diff] [blame] | 163 | |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 164 | LOCAL_STATIC_LIBRARIES += \ |
Zonr Chang | c989dce | 2012-04-12 12:03:04 +0800 | [diff] [blame] | 165 | libutils \ |
| 166 | libcutils |
Logan Chien | 21392f0 | 2011-11-26 20:32:01 +0800 | [diff] [blame] | 167 | |
Stephen Hines | ba8d7ce | 2013-02-27 00:40:04 -0800 | [diff] [blame] | 168 | LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM |
Stephen Hines | 569986d | 2012-03-09 19:58:45 -0800 | [diff] [blame] | 169 | |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 170 | LOCAL_LDLIBS := -ldl -lpthread |
| 171 | |
Zonr Chang | 7a5d423 | 2012-04-12 15:39:06 +0800 | [diff] [blame] | 172 | # Generate build information (Build time + Build git revision + Build Semi SHA1) |
| 173 | include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk |
Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 174 | |
Zonr Chang | ddf5661 | 2012-04-12 15:38:42 +0800 | [diff] [blame] | 175 | include $(LIBBCC_HOST_BUILD_MK) |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 176 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 177 | |
Tim Murray | 6297382 | 2013-02-06 17:22:23 -0800 | [diff] [blame] | 178 | endif # Don't build in unbundled branches |
Logan Chien | 7439685 | 2011-07-12 15:50:26 +0800 | [diff] [blame] | 179 | |
| 180 | #===================================================================== |
| 181 | # Include Subdirectories |
| 182 | #===================================================================== |
Shih-wei Liao | 77ed614 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 183 | include $(call all-makefiles-under,$(LOCAL_PATH)) |