Android.mk revision be46aa62ed595c517dbf236dfbb3d22e1c194907
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 32clcore_base_files_32 := \ 33 ll32/allocation.ll 34 35clcore_base_files_64 := \ 36 ll64/allocation.ll 37 38clcore_files := \ 39 $(clcore_base_files) \ 40 arch/generic.c 41 42clcore_files_32 := \ 43 $(clcore_base_files_32) \ 44 ll32/math.ll 45 46clcore_files_64 := \ 47 $(clcore_base_files_64) \ 48 ll64/math.ll 49 50clcore_neon_files := \ 51 $(clcore_base_files) \ 52 $(clcore_files_32) \ 53 arch/neon.ll \ 54 arch/clamp.c 55 56clcore_x86_files := \ 57 $(clcore_base_files) \ 58 arch/generic.c \ 59 arch/x86_sse2.ll \ 60 arch/x86_sse3.ll 61 62# Grab the current value for $(RS_VERSION_DEFINE) 63include frameworks/compile/slang/rs_version.mk 64 65# Build the base version of the library 66include $(CLEAR_VARS) 67 68LOCAL_MODULE := libclcore.bc 69LOCAL_SRC_FILES := $(clcore_files) 70LOCAL_SRC_FILES_32 := $(clcore_files_32) 71LOCAL_SRC_FILES_64 := $(clcore_files_64) 72 73include $(LOCAL_PATH)/build_bc_lib.mk 74 75# Build a debug version of the library 76include $(CLEAR_VARS) 77 78LOCAL_MODULE := libclcore_debug.bc 79rs_debug_runtime := 1 80LOCAL_SRC_FILES := $(clcore_files) 81LOCAL_SRC_FILES_32 := $(clcore_files_32) 82LOCAL_SRC_FILES_64 := $(clcore_files_64) 83 84include $(LOCAL_PATH)/build_bc_lib.mk 85 86# Build an optimized version of the library for x86 platforms (all have SSE2/3). 87ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) 88include $(CLEAR_VARS) 89 90LOCAL_MODULE := libclcore_x86.bc 91LOCAL_SRC_FILES := $(clcore_x86_files) 92LOCAL_SRC_FILES_32 := $(clcore_base_files_32) 93LOCAL_SRC_FILES_64 := $(clcore_base_files_64) 94 95include $(LOCAL_PATH)/build_bc_lib.mk 96endif 97 98# Build a NEON-enabled version of the library (if possible) 99# Only build on 32-bit, because we don't need a 64-bit NEON lib 100ifeq ($(ARCH_ARM_HAVE_NEON),true) 101 include $(CLEAR_VARS) 102 103 LOCAL_32_BIT_ONLY := true 104 105 LOCAL_MODULE := libclcore_neon.bc 106 LOCAL_SRC_FILES := $(clcore_neon_files) 107 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON 108 109 include $(LOCAL_PATH)/build_bc_lib.mk 110endif 111 112### Build new versions (librsrt_<ARCH>.bc) as host shared libraries. 113### These will be used with bcc_compat and the support library. 114 115# Build the ARM version of the library 116include $(CLEAR_VARS) 117 118# FIXME for 64-bit 119LOCAL_32_BIT_ONLY := true 120 121BCC_RS_TRIPLE := armv7-none-linux-gnueabi 122LOCAL_MODULE := librsrt_arm.bc 123LOCAL_IS_HOST_MODULE := true 124LOCAL_SRC_FILES := $(clcore_files) 125LOCAL_SRC_FILES_32 := $(clcore_files_32) 126include $(LOCAL_PATH)/build_bc_lib.mk 127 128# Build the MIPS version of the library 129include $(CLEAR_VARS) 130 131# FIXME for 64-bit 132LOCAL_32_BIT_ONLY := true 133 134BCC_RS_TRIPLE := mipsel-unknown-linux 135LOCAL_MODULE := librsrt_mips.bc 136LOCAL_IS_HOST_MODULE := true 137LOCAL_SRC_FILES := $(clcore_files) 138LOCAL_SRC_FILES_32 := $(clcore_files_32) 139include $(LOCAL_PATH)/build_bc_lib.mk 140 141# Build the x86 version of the library 142include $(CLEAR_VARS) 143 144# FIXME for 64-bit 145LOCAL_32_BIT_ONLY := true 146 147BCC_RS_TRIPLE := i686-unknown-linux 148LOCAL_MODULE := librsrt_x86.bc 149LOCAL_IS_HOST_MODULE := true 150LOCAL_SRC_FILES := $(clcore_x86_files) 151LOCAL_SRC_FILES_32 := $(clcore_base_files_32) 152include $(LOCAL_PATH)/build_bc_lib.mk 153 154 155 156 157include $(CLEAR_VARS) 158 159BCC_RS_TRIPLE := aarch64-none-linux-gnueabi 160LOCAL_MODULE := librsrt_arm64.bc 161LOCAL_IS_HOST_MODULE := true 162LOCAL_SRC_FILES := $(clcore_files) 163LOCAL_SRC_FILES_64 := $(clcore_files_64) 164include $(LOCAL_PATH)/build_bc_lib.mk 165