1# 2# Copyright (C) 2010-2012 The Android Open Source Project 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 17# Don't build for unbundled branches 18ifeq (,$(TARGET_BUILD_APPS)) 19 20LOCAL_PATH := $(call my-dir) 21LIBBCC_ROOT_PATH := $(LOCAL_PATH) 22include $(LIBBCC_ROOT_PATH)/libbcc.mk 23 24#===================================================================== 25# Whole Static Library to Be Linked In 26#===================================================================== 27 28libbcc_WHOLE_STATIC_LIBRARIES += \ 29 libbccAndroidBitcode \ 30 libbccRenderscript \ 31 libbccExecutionEngine \ 32 libbccCore \ 33 libbccSupport 34 35libmcld_STATIC_LIBRARIES += \ 36 libmcldCodeGen \ 37 libmcldTarget \ 38 libmcldLDVariant \ 39 libmcldMC \ 40 libmcldObject \ 41 libmcldFragment \ 42 libmcldCore \ 43 libmcldSupport \ 44 libmcldADT \ 45 libmcldLD 46 47#===================================================================== 48# Calculate SHA1 checksum for libbcc.so, libRS.so and libclcore.bc 49#===================================================================== 50 51include $(CLEAR_VARS) 52 53LOCAL_MODULE := libbcc.sha1 54LOCAL_MODULE_TAGS := optional 55LOCAL_MODULE_CLASS := SHARED_LIBRARIES 56 57libbcc_SHA1_SRCS := \ 58 $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libbcc.so \ 59 $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libcompiler_rt.so \ 60 $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRS.so \ 61 $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore.bc,,)/libclcore.bc \ 62 $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore_debug.bc,,)/libclcore_debug.bc 63 64ifeq ($(ARCH_ARM_HAVE_NEON),true) 65 # Disable NEON on cortex-a15 temporarily 66 ifneq ($(strip $(TARGET_CPU_VARIANT)), cortex-a15) 67 libbcc_SHA1_SRCS += \ 68 $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore_neon.bc,,)/libclcore_neon.bc 69 endif 70endif 71 72libbcc_GEN_SHA1_STAMP := $(LOCAL_PATH)/tools/build/gen-sha1-stamp.py 73intermediates := $(call local-intermediates-dir) 74 75libbcc_SHA1_ASM := $(intermediates)/libbcc.sha1.S 76LOCAL_GENERATED_SOURCES += $(libbcc_SHA1_ASM) 77$(libbcc_SHA1_ASM): PRIVATE_SHA1_SRCS := $(libbcc_SHA1_SRCS) 78$(libbcc_SHA1_ASM): $(libbcc_SHA1_SRCS) $(libbcc_GEN_SHA1_STAMP) 79 @echo libbcc.sha1: $@ 80 $(hide) mkdir -p $(dir $@) 81 $(hide) $(libbcc_GEN_SHA1_STAMP) $(PRIVATE_SHA1_SRCS) > $@ 82 83LOCAL_CFLAGS += -D_REENTRANT -DPIC -fPIC 84LOCAL_CFLAGS += -O3 -nodefaultlibs -nostdlib 85 86include $(BUILD_SHARED_LIBRARY) 87 88#===================================================================== 89# Device Shared Library libbcc 90#===================================================================== 91 92include $(CLEAR_VARS) 93 94LOCAL_MODULE := libbcc 95LOCAL_MODULE_TAGS := optional 96LOCAL_MODULE_CLASS := SHARED_LIBRARIES 97 98LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES) 99 100LOCAL_WHOLE_STATIC_LIBRARIES += librsloader 101 102ifeq ($(TARGET_ARCH),arm) 103 LOCAL_WHOLE_STATIC_LIBRARIES += \ 104 libmcldARMTarget \ 105 libmcldARMInfo 106else 107 ifeq ($(TARGET_ARCH), mips) 108 LOCAL_WHOLE_STATIC_LIBRARIES += \ 109 libmcldMipsTarget \ 110 libmcldMipsInfo 111 else 112 ifeq ($(TARGET_ARCH),x86) # We don't support x86-64 right now 113 LOCAL_WHOLE_STATIC_LIBRARIES += \ 114 libmcldX86Target \ 115 libmcldX86Info 116 else 117 $(error Unsupported TARGET_ARCH $(TARGET_ARCH)) 118 endif 119 endif 120endif 121 122LOCAL_WHOLE_STATIC_LIBRARIES += $(libmcld_STATIC_LIBRARIES) 123LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils liblog libstlport 124 125# Modules that need get installed if and only if the target libbcc.so is 126# installed. 127LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.bc libbcc.sha1 libcompiler_rt 128 129ifeq ($(ARCH_X86_HAVE_SSE2),true) 130LOCAL_REQUIRED_MODULES += libclcore_x86.bc 131endif 132 133ifeq ($(ARCH_ARM_HAVE_NEON),true) 134 # Disable NEON on cortex-a15 temporarily 135 ifneq ($(strip $(TARGET_CPU_VARIANT)), cortex-a15) 136 LOCAL_REQUIRED_MODULES += libclcore_neon.bc 137 endif 138endif 139 140# Generate build information (Build time + Build git revision + Build Semi SHA1) 141include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk 142 143include $(LIBBCC_DEVICE_BUILD_MK) 144include $(BUILD_SHARED_LIBRARY) 145 146#===================================================================== 147# Host Shared Library libbcc 148#===================================================================== 149 150include $(CLEAR_VARS) 151 152LOCAL_MODULE := libbcc 153LOCAL_MODULE_TAGS := optional 154LOCAL_MODULE_CLASS := SHARED_LIBRARIES 155LOCAL_IS_HOST_MODULE := true 156 157LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES) 158 159LOCAL_WHOLE_STATIC_LIBRARIES += librsloader 160 161LOCAL_WHOLE_STATIC_LIBRARIES += \ 162 libmcldARMTarget \ 163 libmcldARMInfo \ 164 libmcldMipsTarget \ 165 libmcldMipsInfo \ 166 libmcldX86Target \ 167 libmcldX86Info 168 169LOCAL_WHOLE_STATIC_LIBRARIES += $(libmcld_STATIC_LIBRARIES) 170 171LOCAL_STATIC_LIBRARIES += \ 172 libutils \ 173 libcutils \ 174 liblog 175 176LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM 177 178LOCAL_LDLIBS := -ldl -lpthread 179 180# Generate build information (Build time + Build git revision + Build Semi SHA1) 181include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk 182 183include $(LIBBCC_HOST_BUILD_MK) 184include $(BUILD_HOST_SHARED_LIBRARY) 185 186endif # Don't build in unbundled branches 187 188#===================================================================== 189# Include Subdirectories 190#===================================================================== 191include $(call all-makefiles-under,$(LOCAL_PATH)) 192