blob: 80fbb1c51e1833bf4e38a0b720b77be1dd02c0b9 [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 \
Stephen Hines5a470202013-05-29 15:36:18 -070032 rsClamp.ll
33
34clcore_files := \
35 $(clcore_base_files) \
36 math.ll \
Stephen Hines146e1382013-08-20 01:17:01 -070037 arch/generic.c
Stephen Hines5a470202013-05-29 15:36:18 -070038
39clcore_neon_files := \
40 $(clcore_base_files) \
41 math.ll \
42 arch/neon.ll \
Stephen Hines5a470202013-05-29 15:36:18 -070043 arch/clamp.c
44
45ifeq ($(ARCH_X86_HAVE_SSE2), true)
46 clcore_x86_files := \
47 $(clcore_base_files) \
Stephen Hines146e1382013-08-20 01:17:01 -070048 arch/generic.c \
49 arch/x86_sse2.ll
Stephen Hines5a470202013-05-29 15:36:18 -070050
Stephen Hines146e1382013-08-20 01:17:01 -070051 # FIXME: without SSE3, it is still able to get better code through PSHUFD. But,
52 # so far, there is no such device with SSE2 only.
Stephen Hines5a470202013-05-29 15:36:18 -070053 ifeq ($(ARCH_X86_HAVE_SSE3), true)
Stephen Hines146e1382013-08-20 01:17:01 -070054 clcore_x86_files += arch/x86_sse3.ll
Stephen Hines5a470202013-05-29 15:36:18 -070055 endif
56endif
57
58ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
59 RS_VERSION := $(PLATFORM_SDK_VERSION)
60else
61 # Increment by 1 whenever this is not a final release build, since we want to
62 # be able to see the RS version number change during development.
63 # See build/core/version_defaults.mk for more information about this.
64 RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
65endif
66
67# Build the base version of the library
68include $(CLEAR_VARS)
69LOCAL_MODULE := libclcore.bc
70LOCAL_MODULE_TAGS := optional
71LOCAL_MODULE_CLASS := SHARED_LIBRARIES
72LOCAL_SRC_FILES := $(clcore_files)
73
74include $(LOCAL_PATH)/build_bc_lib.mk
75
76# Build a debug version of the library
77include $(CLEAR_VARS)
78LOCAL_MODULE := libclcore_debug.bc
79LOCAL_MODULE_TAGS := optional
80LOCAL_MODULE_CLASS := SHARED_LIBRARIES
81rs_debug_runtime := 1
82LOCAL_SRC_FILES := $(clcore_files)
83
84include $(LOCAL_PATH)/build_bc_lib.mk
85
86# Build an optimized version of the library if the device is SSE2- or above
87# capable.
88ifeq ($(ARCH_X86_HAVE_SSE2),true)
89include $(CLEAR_VARS)
90LOCAL_MODULE := libclcore_x86.bc
91LOCAL_MODULE_TAGS := optional
92LOCAL_MODULE_CLASS := SHARED_LIBRARIES
93LOCAL_SRC_FILES := $(clcore_x86_files)
94
95include $(LOCAL_PATH)/build_bc_lib.mk
96endif
97
98# Build a NEON-enabled version of the library (if possible)
99ifeq ($(ARCH_ARM_HAVE_NEON),true)
Stephen Hines5a470202013-05-29 15:36:18 -0700100 include $(CLEAR_VARS)
101 LOCAL_MODULE := libclcore_neon.bc
102 LOCAL_MODULE_TAGS := optional
103 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
104 LOCAL_SRC_FILES := $(clcore_neon_files)
105 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
106
107 include $(LOCAL_PATH)/build_bc_lib.mk
108endif