Android.mk revision c17fa065b6fee1d2176bd057de98b93d723b59e5
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    rs_convert.c \
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
51# Grab the current value for $(RS_VERSION_DEFINE)
52include frameworks/compile/slang/rs_version.mk
53
54# Build the base version of the library
55include $(CLEAR_VARS)
56
57LOCAL_MODULE := libclcore.bc
58LOCAL_SRC_FILES := $(clcore_files)
59
60include $(LOCAL_PATH)/build_bc_lib.mk
61
62# Build a debug version of the library
63include $(CLEAR_VARS)
64
65LOCAL_MODULE := libclcore_debug.bc
66rs_debug_runtime := 1
67LOCAL_SRC_FILES := $(clcore_files)
68
69include $(LOCAL_PATH)/build_bc_lib.mk
70
71# Build an optimized version of the library for x86 platforms (all have SSE2/3).
72ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
73include $(CLEAR_VARS)
74
75LOCAL_MODULE := libclcore_x86.bc
76LOCAL_SRC_FILES := $(clcore_x86_files)
77
78include $(LOCAL_PATH)/build_bc_lib.mk
79endif
80
81# Build a NEON-enabled version of the library (if possible)
82ifeq ($(ARCH_ARM_HAVE_NEON),true)
83  include $(CLEAR_VARS)
84
85  LOCAL_MODULE := libclcore_neon.bc
86  LOCAL_SRC_FILES := $(clcore_neon_files)
87  LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
88
89  include $(LOCAL_PATH)/build_bc_lib.mk
90endif
91
92### Build new versions (librsrt_<ARCH>.bc) as host shared libraries.
93### These will be used with bcc_compat and the support library.
94
95# Build the ARM version of the library
96include $(CLEAR_VARS)
97
98# FIXME for 64-bit
99LOCAL_32_BIT_ONLY := true
100
101BCC_RS_TRIPLE := armv7-none-linux-gnueabi
102LOCAL_MODULE := librsrt_arm.bc
103LOCAL_IS_HOST_MODULE := true
104LOCAL_SRC_FILES := $(clcore_files)
105include $(LOCAL_PATH)/build_bc_lib.mk
106
107# Build the MIPS version of the library
108include $(CLEAR_VARS)
109
110# FIXME for 64-bit
111LOCAL_32_BIT_ONLY := true
112
113BCC_RS_TRIPLE := mipsel-unknown-linux
114LOCAL_MODULE := librsrt_mips.bc
115LOCAL_IS_HOST_MODULE := true
116LOCAL_SRC_FILES := $(clcore_files)
117include $(LOCAL_PATH)/build_bc_lib.mk
118
119# Build the x86 version of the library
120include $(CLEAR_VARS)
121
122# FIXME for 64-bit
123LOCAL_32_BIT_ONLY := true
124
125BCC_RS_TRIPLE := i686-unknown-linux
126LOCAL_MODULE := librsrt_x86.bc
127LOCAL_IS_HOST_MODULE := true
128LOCAL_SRC_FILES := $(clcore_x86_files)
129include $(LOCAL_PATH)/build_bc_lib.mk
130
131
132
133
134include $(CLEAR_VARS)
135
136BCC_RS_TRIPLE := aarch64-none-linux-gnueabi
137LOCAL_MODULE := librsrt_arm64.bc
138LOCAL_IS_HOST_MODULE := true
139LOCAL_SRC_FILES := $(clcore_files)
140include $(LOCAL_PATH)/build_bc_lib.mk
141