blob: f67e14e97066b9cfa8d7c9dc403dc21307b3dbc9 [file] [log] [blame]
Stephen Hines5a470202013-05-29 15:36:18 -07001#
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 convert.ll \
Tobias Grosser1ed5ef92013-07-29 11:39:38 -070031 allocation.ll \
Matthieu Delahaye197fc092014-01-28 16:06:57 -060032 rsClamp.ll \
33 rs_idct.c \
34 rs_dct.c \
35 rs_iadst.c \
36 rs_fadst.c \
37 rs_walsh.c
Stephen Hines5a470202013-05-29 15:36:18 -070038
39clcore_files := \
40 $(clcore_base_files) \
41 math.ll \
Stephen Hines146e1382013-08-20 01:17:01 -070042 arch/generic.c
Stephen Hines5a470202013-05-29 15:36:18 -070043
44clcore_neon_files := \
45 $(clcore_base_files) \
46 math.ll \
47 arch/neon.ll \
Stephen Hines5a470202013-05-29 15:36:18 -070048 arch/clamp.c
49
Stephen Hinesc3cfa122013-12-20 16:28:28 -080050clcore_x86_files := \
Stephen Hines5a470202013-05-29 15:36:18 -070051 $(clcore_base_files) \
Stephen Hines146e1382013-08-20 01:17:01 -070052 arch/generic.c \
Stephen Hines4da42502013-10-03 14:57:51 -070053 arch/x86_sse2.ll \
54 arch/x86_sse3.ll
Stephen Hines5a470202013-05-29 15:36:18 -070055
56ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
57 RS_VERSION := $(PLATFORM_SDK_VERSION)
58else
59 # Increment by 1 whenever this is not a final release build, since we want to
60 # be able to see the RS version number change during development.
61 # See build/core/version_defaults.mk for more information about this.
62 RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
63endif
64
65# Build the base version of the library
66include $(CLEAR_VARS)
Stephen Hinesc3cfa122013-12-20 16:28:28 -080067BCC_RS_TRIPLE := $(RS_TRIPLE)
Stephen Hines5a470202013-05-29 15:36:18 -070068LOCAL_MODULE := libclcore.bc
Stephen Hines5a470202013-05-29 15:36:18 -070069LOCAL_SRC_FILES := $(clcore_files)
70
71include $(LOCAL_PATH)/build_bc_lib.mk
72
73# Build a debug version of the library
74include $(CLEAR_VARS)
Stephen Hinesc3cfa122013-12-20 16:28:28 -080075BCC_RS_TRIPLE := $(RS_TRIPLE)
Stephen Hines5a470202013-05-29 15:36:18 -070076LOCAL_MODULE := libclcore_debug.bc
Stephen Hines5a470202013-05-29 15:36:18 -070077rs_debug_runtime := 1
78LOCAL_SRC_FILES := $(clcore_files)
79
80include $(LOCAL_PATH)/build_bc_lib.mk
81
Stephen Hines4da42502013-10-03 14:57:51 -070082# Build an optimized version of the library for x86 platforms (all have SSE2/3).
83ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
Stephen Hines5a470202013-05-29 15:36:18 -070084include $(CLEAR_VARS)
Stephen Hinesc3cfa122013-12-20 16:28:28 -080085BCC_RS_TRIPLE := $(RS_TRIPLE)
Stephen Hines5a470202013-05-29 15:36:18 -070086LOCAL_MODULE := libclcore_x86.bc
Stephen Hines5a470202013-05-29 15:36:18 -070087LOCAL_SRC_FILES := $(clcore_x86_files)
88
89include $(LOCAL_PATH)/build_bc_lib.mk
90endif
91
92# Build a NEON-enabled version of the library (if possible)
93ifeq ($(ARCH_ARM_HAVE_NEON),true)
Stephen Hines5a470202013-05-29 15:36:18 -070094 include $(CLEAR_VARS)
Stephen Hinesc3cfa122013-12-20 16:28:28 -080095 BCC_RS_TRIPLE := $(RS_TRIPLE)
Stephen Hines5a470202013-05-29 15:36:18 -070096 LOCAL_MODULE := libclcore_neon.bc
Stephen Hines5a470202013-05-29 15:36:18 -070097 LOCAL_SRC_FILES := $(clcore_neon_files)
98 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
99
100 include $(LOCAL_PATH)/build_bc_lib.mk
101endif
Stephen Hinesc3cfa122013-12-20 16:28:28 -0800102
103### Build new versions (librsrt_<ARCH>.bc) as host shared libraries.
104### These will be used with bcc_compat and the support library.
105
106# Build the ARM version of the library
107include $(CLEAR_VARS)
108BCC_RS_TRIPLE := armv7-none-linux-gnueabi
109LOCAL_MODULE := librsrt_arm.bc
110LOCAL_IS_HOST_MODULE := true
111LOCAL_SRC_FILES := $(clcore_files)
112include $(LOCAL_PATH)/build_bc_lib.mk
113
114# Build the MIPS version of the library
115include $(CLEAR_VARS)
116BCC_RS_TRIPLE := mipsel-unknown-linux
117LOCAL_MODULE := librsrt_mips.bc
118LOCAL_IS_HOST_MODULE := true
119LOCAL_SRC_FILES := $(clcore_files)
120include $(LOCAL_PATH)/build_bc_lib.mk
121
122# Build the x86 version of the library
123include $(CLEAR_VARS)
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