Android.mk revision 3ff0fe77fdba8ad4a920dc27157d8c1786bb3661
1# 2# Copyright (C) 2013 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 17LOCAL_PATH := $(call my-dir) 18 19# C/LLVM-IR source files for the library 20clcore_base_files := \ 21 rs_allocation.c \ 22 rs_cl.c \ 23 rs_core.c \ 24 rs_element.c \ 25 rs_mesh.c \ 26 rs_matrix.c \ 27 rs_program.c \ 28 rs_sample.c \ 29 rs_sampler.c \ 30 rs_convert.c \ 31 allocation.ll 32 33clcore_files := \ 34 $(clcore_base_files) \ 35 math.ll \ 36 arch/generic.c 37 38clcore_neon_files := \ 39 $(clcore_base_files) \ 40 math.ll \ 41 arch/neon.ll \ 42 arch/clamp.c 43 44clcore_x86_files := \ 45 $(clcore_base_files) \ 46 arch/generic.c \ 47 arch/x86_sse2.ll \ 48 arch/x86_sse3.ll 49 50# Grab the current value for $(RS_VERSION_DEFINE) 51include frameworks/compile/slang/rs_version.mk 52 53# Build the base version of the library 54include $(CLEAR_VARS) 55 56LOCAL_MODULE := libclcore.bc 57LOCAL_SRC_FILES := $(clcore_files) 58 59include $(LOCAL_PATH)/build_bc_lib.mk 60 61# Build a debug version of the library 62include $(CLEAR_VARS) 63 64LOCAL_MODULE := libclcore_debug.bc 65rs_debug_runtime := 1 66LOCAL_SRC_FILES := $(clcore_files) 67 68include $(LOCAL_PATH)/build_bc_lib.mk 69 70# Build an optimized version of the library for x86 platforms (all have SSE2/3). 71ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) 72include $(CLEAR_VARS) 73 74LOCAL_MODULE := libclcore_x86.bc 75LOCAL_SRC_FILES := $(clcore_x86_files) 76 77include $(LOCAL_PATH)/build_bc_lib.mk 78endif 79 80# Build a NEON-enabled version of the library (if possible) 81ifeq ($(ARCH_ARM_HAVE_NEON),true) 82 include $(CLEAR_VARS) 83 84 LOCAL_MODULE := libclcore_neon.bc 85 LOCAL_SRC_FILES := $(clcore_neon_files) 86 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON 87 88 include $(LOCAL_PATH)/build_bc_lib.mk 89endif 90 91### Build new versions (librsrt_<ARCH>.bc) as host shared libraries. 92### These will be used with bcc_compat and the support library. 93 94# Build the ARM version of the library 95include $(CLEAR_VARS) 96 97# FIXME for 64-bit 98LOCAL_32_BIT_ONLY := true 99 100BCC_RS_TRIPLE := armv7-none-linux-gnueabi 101LOCAL_MODULE := librsrt_arm.bc 102LOCAL_IS_HOST_MODULE := true 103LOCAL_SRC_FILES := $(clcore_files) 104include $(LOCAL_PATH)/build_bc_lib.mk 105 106# Build the MIPS version of the library 107include $(CLEAR_VARS) 108 109# FIXME for 64-bit 110LOCAL_32_BIT_ONLY := true 111 112BCC_RS_TRIPLE := mipsel-unknown-linux 113LOCAL_MODULE := librsrt_mips.bc 114LOCAL_IS_HOST_MODULE := true 115LOCAL_SRC_FILES := $(clcore_files) 116include $(LOCAL_PATH)/build_bc_lib.mk 117 118# Build the x86 version of the library 119include $(CLEAR_VARS) 120 121# FIXME for 64-bit 122LOCAL_32_BIT_ONLY := true 123 124BCC_RS_TRIPLE := i686-unknown-linux 125LOCAL_MODULE := librsrt_x86.bc 126LOCAL_IS_HOST_MODULE := true 127LOCAL_SRC_FILES := $(clcore_x86_files) 128include $(LOCAL_PATH)/build_bc_lib.mk 129 130 131 132 133include $(CLEAR_VARS) 134 135BCC_RS_TRIPLE := aarch64-none-linux-gnueabi 136LOCAL_MODULE := librsrt_arm64.bc 137LOCAL_IS_HOST_MODULE := true 138LOCAL_SRC_FILES := $(clcore_files) 139include $(LOCAL_PATH)/build_bc_lib.mk 140