Android.mk revision 1d279546c73b667c5afd855554c0120503e48f9f
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 85rs_debug_runtime := 86 87# Build an optimized version of the library for x86 platforms (all have SSE2/3). 88ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) 89include $(CLEAR_VARS) 90 91LOCAL_MODULE := libclcore_x86.bc 92LOCAL_SRC_FILES := $(clcore_x86_files) 93LOCAL_SRC_FILES_32 := $(clcore_base_files_32) 94LOCAL_SRC_FILES_64 := $(clcore_base_files_64) 95 96include $(LOCAL_PATH)/build_bc_lib.mk 97endif 98 99# Build a NEON-enabled version of the library (if possible) 100# Only build on 32-bit, because we don't need a 64-bit NEON lib 101ifeq ($(ARCH_ARM_HAVE_NEON),true) 102 include $(CLEAR_VARS) 103 104 LOCAL_32_BIT_ONLY := true 105 106 LOCAL_MODULE := libclcore_neon.bc 107 LOCAL_SRC_FILES := $(clcore_neon_files) 108 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON 109 110 include $(LOCAL_PATH)/build_bc_lib.mk 111endif 112 113### Build new versions (librsrt_<ARCH>.bc) as host shared libraries. 114### These will be used with bcc_compat and the support library. 115 116# Build the ARM version of the library 117include $(CLEAR_VARS) 118 119# FIXME for 64-bit 120LOCAL_32_BIT_ONLY := true 121 122BCC_RS_TRIPLE := armv7-none-linux-gnueabi 123RS_TRIPLE_CFLAGS := 124LOCAL_MODULE := librsrt_arm.bc 125LOCAL_IS_HOST_MODULE := true 126LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_32) 127include $(LOCAL_PATH)/build_bc_lib.mk 128 129# Build the MIPS 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 136RS_TRIPLE_CFLAGS := 137LOCAL_MODULE := librsrt_mips.bc 138LOCAL_IS_HOST_MODULE := true 139LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_32) 140include $(LOCAL_PATH)/build_bc_lib.mk 141 142# Build the x86 version of the library 143include $(CLEAR_VARS) 144 145# FIXME for 64-bit 146LOCAL_32_BIT_ONLY := true 147 148BCC_RS_TRIPLE := armv7-none-linux-gnueabi 149RS_TRIPLE_CFLAGS := -D__i386__ 150LOCAL_MODULE := librsrt_x86.bc 151LOCAL_IS_HOST_MODULE := true 152LOCAL_SRC_FILES := $(clcore_x86_files) $(clcore_base_files_32) 153include $(LOCAL_PATH)/build_bc_lib.mk 154 155 156 157 158include $(CLEAR_VARS) 159 160BCC_RS_TRIPLE := aarch64-linux-android 161RS_TRIPLE_CFLAGS := 162LOCAL_MODULE := librsrt_arm64.bc 163LOCAL_IS_HOST_MODULE := true 164LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_64) 165include $(LOCAL_PATH)/build_bc_lib.mk 166