| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | # C/LLVM-IR source files for the library |
| 20 | clcore_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 \ |
| Tobias Grosser | 1ed5ef9 | 2013-07-29 11:39:38 -0700 | [diff] [blame] | 31 | allocation.ll \ |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 32 | rsClamp.ll |
| 33 | |
| 34 | clcore_files := \ |
| 35 | $(clcore_base_files) \ |
| 36 | math.ll \ |
| Stephen Hines | 146e138 | 2013-08-20 01:17:01 -0700 | [diff] [blame] | 37 | arch/generic.c |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 38 | |
| 39 | clcore_neon_files := \ |
| 40 | $(clcore_base_files) \ |
| 41 | math.ll \ |
| 42 | arch/neon.ll \ |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 43 | arch/clamp.c |
| 44 | |
| Stephen Hines | c3cfa12 | 2013-12-20 16:28:28 -0800 | [diff] [blame^] | 45 | clcore_x86_files := \ |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 46 | $(clcore_base_files) \ |
| Stephen Hines | 146e138 | 2013-08-20 01:17:01 -0700 | [diff] [blame] | 47 | arch/generic.c \ |
| Stephen Hines | 4da4250 | 2013-10-03 14:57:51 -0700 | [diff] [blame] | 48 | arch/x86_sse2.ll \ |
| 49 | arch/x86_sse3.ll |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 50 | |
| 51 | ifeq "REL" "$(PLATFORM_VERSION_CODENAME)" |
| 52 | RS_VERSION := $(PLATFORM_SDK_VERSION) |
| 53 | else |
| 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))" |
| 58 | endif |
| 59 | |
| 60 | # Build the base version of the library |
| 61 | include $(CLEAR_VARS) |
| Stephen Hines | c3cfa12 | 2013-12-20 16:28:28 -0800 | [diff] [blame^] | 62 | BCC_RS_TRIPLE := $(RS_TRIPLE) |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 63 | LOCAL_MODULE := libclcore.bc |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 64 | LOCAL_SRC_FILES := $(clcore_files) |
| 65 | |
| 66 | include $(LOCAL_PATH)/build_bc_lib.mk |
| 67 | |
| 68 | # Build a debug version of the library |
| 69 | include $(CLEAR_VARS) |
| Stephen Hines | c3cfa12 | 2013-12-20 16:28:28 -0800 | [diff] [blame^] | 70 | BCC_RS_TRIPLE := $(RS_TRIPLE) |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 71 | LOCAL_MODULE := libclcore_debug.bc |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 72 | rs_debug_runtime := 1 |
| 73 | LOCAL_SRC_FILES := $(clcore_files) |
| 74 | |
| 75 | include $(LOCAL_PATH)/build_bc_lib.mk |
| 76 | |
| Stephen Hines | 4da4250 | 2013-10-03 14:57:51 -0700 | [diff] [blame] | 77 | # Build an optimized version of the library for x86 platforms (all have SSE2/3). |
| 78 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 79 | include $(CLEAR_VARS) |
| Stephen Hines | c3cfa12 | 2013-12-20 16:28:28 -0800 | [diff] [blame^] | 80 | BCC_RS_TRIPLE := $(RS_TRIPLE) |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 81 | LOCAL_MODULE := libclcore_x86.bc |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 82 | LOCAL_SRC_FILES := $(clcore_x86_files) |
| 83 | |
| 84 | include $(LOCAL_PATH)/build_bc_lib.mk |
| 85 | endif |
| 86 | |
| 87 | # Build a NEON-enabled version of the library (if possible) |
| 88 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 89 | include $(CLEAR_VARS) |
| Stephen Hines | c3cfa12 | 2013-12-20 16:28:28 -0800 | [diff] [blame^] | 90 | BCC_RS_TRIPLE := $(RS_TRIPLE) |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 91 | LOCAL_MODULE := libclcore_neon.bc |
| Stephen Hines | 5a47020 | 2013-05-29 15:36:18 -0700 | [diff] [blame] | 92 | LOCAL_SRC_FILES := $(clcore_neon_files) |
| 93 | LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON |
| 94 | |
| 95 | include $(LOCAL_PATH)/build_bc_lib.mk |
| 96 | endif |
| Stephen Hines | c3cfa12 | 2013-12-20 16:28:28 -0800 | [diff] [blame^] | 97 | |
| 98 | ### Build new versions (librsrt_<ARCH>.bc) as host shared libraries. |
| 99 | ### These will be used with bcc_compat and the support library. |
| 100 | |
| 101 | # Build the ARM version of the library |
| 102 | include $(CLEAR_VARS) |
| 103 | BCC_RS_TRIPLE := armv7-none-linux-gnueabi |
| 104 | LOCAL_MODULE := librsrt_arm.bc |
| 105 | LOCAL_IS_HOST_MODULE := true |
| 106 | LOCAL_SRC_FILES := $(clcore_files) |
| 107 | include $(LOCAL_PATH)/build_bc_lib.mk |
| 108 | |
| 109 | # Build the MIPS version of the library |
| 110 | include $(CLEAR_VARS) |
| 111 | BCC_RS_TRIPLE := mipsel-unknown-linux |
| 112 | LOCAL_MODULE := librsrt_mips.bc |
| 113 | LOCAL_IS_HOST_MODULE := true |
| 114 | LOCAL_SRC_FILES := $(clcore_files) |
| 115 | include $(LOCAL_PATH)/build_bc_lib.mk |
| 116 | |
| 117 | # Build the x86 version of the library |
| 118 | include $(CLEAR_VARS) |
| 119 | BCC_RS_TRIPLE := i686-unknown-linux |
| 120 | LOCAL_MODULE := librsrt_x86.bc |
| 121 | LOCAL_IS_HOST_MODULE := true |
| 122 | LOCAL_SRC_FILES := $(clcore_x86_files) |
| 123 | include $(LOCAL_PATH)/build_bc_lib.mk |