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