Android.mk revision 080e2ef14e9090b38a37197d1bf5c5eba69cc77f
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    convert.ll \
31    rsClamp.ll
32
33clcore_files := \
34    $(clcore_base_files) \
35    math.ll \
36    arch/generic.c \
37    arch/sqrt.c \
38    arch/dot_length.c
39
40clcore_neon_files := \
41    $(clcore_base_files) \
42    math.ll \
43    arch/neon.ll \
44    arch/sqrt.c \
45    arch/dot_length.c \
46    arch/clamp.c
47
48ifeq ($(ARCH_X86_HAVE_SSE2), true)
49    clcore_x86_files := \
50    $(clcore_base_files) \
51    arch/x86_generic.c \
52    arch/x86_clamp.ll \
53    arch/x86_math.ll
54
55    ifeq ($(ARCH_X86_HAVE_SSE3), true)
56        clcore_x86_files += arch/x86_dot_length.ll
57    else
58        # FIXME: without SSE3, it is still able to get better code through PSHUFD. But,
59        # so far, there is no such device with SSE2 only.
60        clcore_x86_files += arch/dot_length.c
61    endif
62endif
63
64ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
65  RS_VERSION := $(PLATFORM_SDK_VERSION)
66else
67  # Increment by 1 whenever this is not a final release build, since we want to
68  # be able to see the RS version number change during development.
69  # See build/core/version_defaults.mk for more information about this.
70  RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
71endif
72
73# Build the base version of the library
74include $(CLEAR_VARS)
75LOCAL_MODULE := libclcore.bc
76LOCAL_MODULE_TAGS := optional
77LOCAL_MODULE_CLASS := SHARED_LIBRARIES
78LOCAL_SRC_FILES := $(clcore_files)
79
80include $(LOCAL_PATH)/build_bc_lib.mk
81
82# Build a debug version of the library
83include $(CLEAR_VARS)
84LOCAL_MODULE := libclcore_debug.bc
85LOCAL_MODULE_TAGS := optional
86LOCAL_MODULE_CLASS := SHARED_LIBRARIES
87rs_debug_runtime := 1
88LOCAL_SRC_FILES := $(clcore_files)
89
90include $(LOCAL_PATH)/build_bc_lib.mk
91
92# Build an optimized version of the library if the device is SSE2- or above
93# capable.
94ifeq ($(ARCH_X86_HAVE_SSE2),true)
95include $(CLEAR_VARS)
96LOCAL_MODULE := libclcore_x86.bc
97LOCAL_MODULE_TAGS := optional
98LOCAL_MODULE_CLASS := SHARED_LIBRARIES
99LOCAL_SRC_FILES := $(clcore_x86_files)
100
101include $(LOCAL_PATH)/build_bc_lib.mk
102endif
103
104# Build a NEON-enabled version of the library (if possible)
105ifeq ($(ARCH_ARM_HAVE_NEON),true)
106  include $(CLEAR_VARS)
107  LOCAL_MODULE := libclcore_neon.bc
108  LOCAL_MODULE_TAGS := optional
109  LOCAL_MODULE_CLASS := SHARED_LIBRARIES
110  LOCAL_SRC_FILES := $(clcore_neon_files)
111  LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
112
113  include $(LOCAL_PATH)/build_bc_lib.mk
114endif
115