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 18 ifeq (,$(TARGET_BUILD_APPS)) 19 20 LOCAL_PATH := $(call my-dir) 21 LIBBCC_ROOT_PATH := $(LOCAL_PATH) 22 include $(LIBBCC_ROOT_PATH)/libbcc.mk 23 24 #===================================================================== 25 # Whole Static Library to Be Linked In 26 #===================================================================== 27 28 libbcc_WHOLE_STATIC_LIBRARIES += \ 29 libbccRenderscript \ 30 libbccExecutionEngine \ 31 libbccCore \ 32 libbccSupport 33 34 #===================================================================== 35 # Calculate SHA1 checksum for libbcc.so, libRS.so and libclcore.bc 36 #===================================================================== 37 38 include $(CLEAR_VARS) 39 40 LOCAL_MODULE := libbcc.sha1 41 LOCAL_MODULE_TAGS := optional 42 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 43 44 libbcc_SHA1_SRCS := \ 45 $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libbcc.so \ 46 $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libcompiler_rt.so \ 47 $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRS.so \ 48 $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore.bc,,)/libclcore.bc \ 49 $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore_debug.bc,,)/libclcore_debug.bc 50 51 ifeq ($(ARCH_ARM_HAVE_NEON),true) 52 libbcc_SHA1_SRCS += \ 53 $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore_neon.bc,,)/libclcore_neon.bc 54 endif 55 56 libbcc_GEN_SHA1_STAMP := $(LOCAL_PATH)/tools/build/gen-sha1-stamp.py 57 intermediates := $(call local-intermediates-dir) 58 59 libbcc_SHA1_ASM := $(intermediates)/libbcc.sha1.S 60 LOCAL_GENERATED_SOURCES += $(libbcc_SHA1_ASM) 61 $(libbcc_SHA1_ASM): PRIVATE_SHA1_SRCS := $(libbcc_SHA1_SRCS) 62 $(libbcc_SHA1_ASM): $(libbcc_SHA1_SRCS) $(libbcc_GEN_SHA1_STAMP) 63 @echo libbcc.sha1: $@ 64 $(hide) mkdir -p $(dir $@) 65 $(hide) $(libbcc_GEN_SHA1_STAMP) $(PRIVATE_SHA1_SRCS) > $@ 66 67 LOCAL_CFLAGS += -D_REENTRANT -DPIC -fPIC 68 LOCAL_CFLAGS += -O3 -nodefaultlibs -nostdlib 69 70 include $(BUILD_SHARED_LIBRARY) 71 72 #===================================================================== 73 # Device Shared Library libbcc 74 #===================================================================== 75 76 include $(CLEAR_VARS) 77 78 LOCAL_MODULE := libbcc 79 LOCAL_MODULE_TAGS := optional 80 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 81 82 LOCAL_WHOLE_STATIC_LIBRARIES := $(libbcc_WHOLE_STATIC_LIBRARIES) 83 84 LOCAL_WHOLE_STATIC_LIBRARIES += librsloader 85 86 LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM libdl libutils libcutils liblog libstlport 87 88 # Modules that need get installed if and only if the target libbcc.so is 89 # installed. 90 LOCAL_REQUIRED_MODULES := libclcore.bc libclcore_debug.bc libbcc.sha1 libcompiler_rt 91 92 ifeq ($(ARCH_X86_HAVE_SSE2),true) 93 LOCAL_REQUIRED_MODULES += libclcore_x86.bc 94 endif 95 96 ifeq ($(ARCH_ARM_HAVE_NEON),true) 97 LOCAL_REQUIRED_MODULES += libclcore_neon.bc 98 endif 99 100 # Generate build information (Build time + Build git revision + Build Semi SHA1) 101 include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk 102 103 include $(LIBBCC_DEVICE_BUILD_MK) 104 include $(BUILD_SHARED_LIBRARY) 105 106 #===================================================================== 107 # Host Shared Library libbcc 108 #===================================================================== 109 110 include $(CLEAR_VARS) 111 112 LOCAL_MODULE := libbcc 113 LOCAL_MODULE_TAGS := optional 114 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 115 LOCAL_IS_HOST_MODULE := true 116 117 LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES) 118 119 LOCAL_WHOLE_STATIC_LIBRARIES += librsloader 120 121 LOCAL_STATIC_LIBRARIES += \ 122 libutils \ 123 libcutils \ 124 liblog 125 126 LOCAL_SHARED_LIBRARIES := libbcinfo libLLVM 127 128 ifndef USE_MINGW 129 LOCAL_LDLIBS := -ldl -lpthread 130 endif 131 132 # Generate build information (Build time + Build git revision + Build Semi SHA1) 133 include $(LIBBCC_ROOT_PATH)/libbcc-gen-build-info.mk 134 135 include $(LIBBCC_HOST_BUILD_MK) 136 include $(BUILD_HOST_SHARED_LIBRARY) 137 138 endif # Don't build in unbundled branches 139 140 #===================================================================== 141 # Include Subdirectories 142 #===================================================================== 143 include $(call all-makefiles-under,$(LOCAL_PATH)) 144