Android.mk revision 531ee4ef10f54dab0ba1d5f7248073da06907425
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
45clcore_x86_files := \
46    $(clcore_base_files) \
47    arch/generic.c \
48    arch/x86_sse2.ll \
49    arch/x86_sse3.ll
50
51ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
52  RS_VERSION := $(PLATFORM_SDK_VERSION)
53else
54  # Increment by 1 whenever this is not a final release build, since we want to
55  # be able to see the RS version number change during development.
56  # See build/core/version_defaults.mk for more information about this.
57  RS_VERSION := "(1 + $(PLATFORM_SDK_VERSION))"
58endif
59
60# Build the base version of the library
61include $(CLEAR_VARS)
62LOCAL_MODULE := libclcore.bc
63LOCAL_SRC_FILES := $(clcore_files)
64
65include $(LOCAL_PATH)/build_bc_lib.mk
66
67# Build a debug version of the library
68include $(CLEAR_VARS)
69LOCAL_MODULE := libclcore_debug.bc
70rs_debug_runtime := 1
71LOCAL_SRC_FILES := $(clcore_files)
72
73include $(LOCAL_PATH)/build_bc_lib.mk
74
75# Build an optimized version of the library for x86 platforms (all have SSE2/3).
76ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
77include $(CLEAR_VARS)
78LOCAL_MODULE := libclcore_x86.bc
79LOCAL_SRC_FILES := $(clcore_x86_files)
80
81include $(LOCAL_PATH)/build_bc_lib.mk
82endif
83
84# Build a NEON-enabled version of the library (if possible)
85ifeq ($(ARCH_ARM_HAVE_NEON),true)
86  include $(CLEAR_VARS)
87  LOCAL_MODULE := libclcore_neon.bc
88  LOCAL_SRC_FILES := $(clcore_neon_files)
89  LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
90
91  include $(LOCAL_PATH)/build_bc_lib.mk
92endif
93
94### Build new versions (librsrt_<ARCH>.bc) as host shared libraries.
95### These will be used with bcc_compat and the support library.
96
97# Build the ARM version of the library
98include $(CLEAR_VARS)
99BCC_RS_TRIPLE := armv7-none-linux-gnueabi
100LOCAL_MODULE := librsrt_arm.bc
101LOCAL_IS_HOST_MODULE := true
102LOCAL_SRC_FILES := $(clcore_files)
103include $(LOCAL_PATH)/build_bc_lib.mk
104
105# Build the MIPS version of the library
106include $(CLEAR_VARS)
107BCC_RS_TRIPLE := mipsel-unknown-linux
108LOCAL_MODULE := librsrt_mips.bc
109LOCAL_IS_HOST_MODULE := true
110LOCAL_SRC_FILES := $(clcore_files)
111include $(LOCAL_PATH)/build_bc_lib.mk
112
113# Build the x86 version of the library
114include $(CLEAR_VARS)
115BCC_RS_TRIPLE := i686-unknown-linux
116LOCAL_MODULE := librsrt_x86.bc
117LOCAL_IS_HOST_MODULE := true
118LOCAL_SRC_FILES := $(clcore_x86_files)
119include $(LOCAL_PATH)/build_bc_lib.mk
120