Android.mk revision 4da42506a08ed7fdb61615b3524f111df939fc6e
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    allocation.ll \
32    rsClamp.ll
33
34clcore_files := \
35    $(clcore_base_files) \
36    math.ll \
37    arch/generic.c
38
39clcore_neon_files := \
40    $(clcore_base_files) \
41    math.ll \
42    arch/neon.ll \
43    arch/clamp.c
44
45ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
46    clcore_x86_files := \
47    $(clcore_base_files) \
48    arch/generic.c \
49    arch/x86_sse2.ll \
50    arch/x86_sse3.ll
51endif
52
53ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
54  RS_VERSION := $(PLATFORM_SDK_VERSION)
55else
56  # Increment by 1 whenever this is not a final release build, since we want to
57  # be able to see the RS version number change during development.
58  # See build/core/version_defaults.mk for more information about this.
59  RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
60endif
61
62# Build the base version of the library
63include $(CLEAR_VARS)
64LOCAL_MODULE := libclcore.bc
65LOCAL_MODULE_TAGS := optional
66LOCAL_MODULE_CLASS := SHARED_LIBRARIES
67LOCAL_SRC_FILES := $(clcore_files)
68
69include $(LOCAL_PATH)/build_bc_lib.mk
70
71# Build a debug version of the library
72include $(CLEAR_VARS)
73LOCAL_MODULE := libclcore_debug.bc
74LOCAL_MODULE_TAGS := optional
75LOCAL_MODULE_CLASS := SHARED_LIBRARIES
76rs_debug_runtime := 1
77LOCAL_SRC_FILES := $(clcore_files)
78
79include $(LOCAL_PATH)/build_bc_lib.mk
80
81# Build an optimized version of the library for x86 platforms (all have SSE2/3).
82ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
83include $(CLEAR_VARS)
84LOCAL_MODULE := libclcore_x86.bc
85LOCAL_MODULE_TAGS := optional
86LOCAL_MODULE_CLASS := SHARED_LIBRARIES
87LOCAL_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)
94  include $(CLEAR_VARS)
95  LOCAL_MODULE := libclcore_neon.bc
96  LOCAL_MODULE_TAGS := optional
97  LOCAL_MODULE_CLASS := SHARED_LIBRARIES
98  LOCAL_SRC_FILES := $(clcore_neon_files)
99  LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
100
101  include $(LOCAL_PATH)/build_bc_lib.mk
102endif
103