Android.mk revision e195a3f57ace3b66d313a6ee88c6e93d5c9d87f4
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    rs_idct.c \
34    rs_dct.c \
35    rs_iadst.c  \
36    rs_fadst.c  \
37    rs_walsh.c
38
39clcore_files := \
40    $(clcore_base_files) \
41    math.ll \
42    arch/generic.c
43
44clcore_neon_files := \
45    $(clcore_base_files) \
46    math.ll \
47    arch/neon.ll \
48    arch/clamp.c
49
50clcore_x86_files := \
51    $(clcore_base_files) \
52    arch/generic.c \
53    arch/x86_sse2.ll \
54    arch/x86_sse3.ll
55
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)
67
68# FIXME for 64-bit
69LOCAL_32_BIT_ONLY := true
70
71LOCAL_MODULE := libclcore.bc
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)
78
79# FIXME for 64-bit
80LOCAL_32_BIT_ONLY := true
81
82LOCAL_MODULE := libclcore_debug.bc
83rs_debug_runtime := 1
84LOCAL_SRC_FILES := $(clcore_files)
85
86include $(LOCAL_PATH)/build_bc_lib.mk
87
88# Build an optimized version of the library for x86 platforms (all have SSE2/3).
89ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
90include $(CLEAR_VARS)
91
92# FIXME for 64-bit
93LOCAL_32_BIT_ONLY := true
94
95LOCAL_MODULE := libclcore_x86.bc
96LOCAL_SRC_FILES := $(clcore_x86_files)
97
98include $(LOCAL_PATH)/build_bc_lib.mk
99endif
100
101# Build a NEON-enabled version of the library (if possible)
102ifeq ($(ARCH_ARM_HAVE_NEON),true)
103  include $(CLEAR_VARS)
104
105  # FIXME for 64-bit
106  LOCAL_32_BIT_ONLY := true
107
108  LOCAL_MODULE := libclcore_neon.bc
109  LOCAL_SRC_FILES := $(clcore_neon_files)
110  LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
111
112  include $(LOCAL_PATH)/build_bc_lib.mk
113endif
114
115### Build new versions (librsrt_<ARCH>.bc) as host shared libraries.
116### These will be used with bcc_compat and the support library.
117
118# Build the ARM version of the library
119include $(CLEAR_VARS)
120
121# FIXME for 64-bit
122LOCAL_32_BIT_ONLY := true
123
124BCC_RS_TRIPLE := armv7-none-linux-gnueabi
125LOCAL_MODULE := librsrt_arm.bc
126LOCAL_IS_HOST_MODULE := true
127LOCAL_SRC_FILES := $(clcore_files)
128include $(LOCAL_PATH)/build_bc_lib.mk
129
130# Build the MIPS version of the library
131include $(CLEAR_VARS)
132
133# FIXME for 64-bit
134LOCAL_32_BIT_ONLY := true
135
136BCC_RS_TRIPLE := mipsel-unknown-linux
137LOCAL_MODULE := librsrt_mips.bc
138LOCAL_IS_HOST_MODULE := true
139LOCAL_SRC_FILES := $(clcore_files)
140include $(LOCAL_PATH)/build_bc_lib.mk
141
142# Build the x86 version of the library
143include $(CLEAR_VARS)
144
145# FIXME for 64-bit
146LOCAL_32_BIT_ONLY := true
147
148BCC_RS_TRIPLE := i686-unknown-linux
149LOCAL_MODULE := librsrt_x86.bc
150LOCAL_IS_HOST_MODULE := true
151LOCAL_SRC_FILES := $(clcore_x86_files)
152include $(LOCAL_PATH)/build_bc_lib.mk
153
154