1#
2# Copyright (C) 2016 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)/libopus
18
19include $(CLEAR_VARS)
20
21include $(LOCAL_PATH)/celt_headers.mk
22include $(LOCAL_PATH)/celt_sources.mk
23include $(LOCAL_PATH)/opus_headers.mk
24include $(LOCAL_PATH)/opus_sources.mk
25include $(LOCAL_PATH)/silk_headers.mk
26include $(LOCAL_PATH)/silk_sources.mk
27
28LOCAL_MODULE := libopus
29LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
30LOCAL_LICENSE_CONDITIONS := notice
31LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../../../LICENSE
32LOCAL_ARM_MODE := arm
33LOCAL_CFLAGS := -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT \
34                -DHAVE_LRINTF
35LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src \
36                    $(LOCAL_PATH)/silk $(LOCAL_PATH)/celt \
37                    $(LOCAL_PATH)/silk/fixed
38LOCAL_SRC_FILES := $(CELT_SOURCES) $(OPUS_SOURCES) $(OPUS_SOURCES_FLOAT) \
39                   $(SILK_SOURCES) $(SILK_SOURCES_FIXED)
40
41ifneq ($(findstring armeabi-v7a, $(TARGET_ARCH_ABI)),)
42LOCAL_SRC_FILES += $(CELT_SOURCES_ARM)
43LOCAL_SRC_FILES += celt/arm/armopts_gnu.s.neon
44LOCAL_SRC_FILES += $(subst .s,_gnu.s.neon,$(CELT_SOURCES_ARM_ASM))
45LOCAL_CFLAGS += -DOPUS_ARM_ASM -DOPUS_ARM_INLINE_ASM -DOPUS_ARM_INLINE_EDSP \
46                -DOPUS_ARM_INLINE_MEDIA -DOPUS_ARM_INLINE_NEON \
47                -DOPUS_ARM_MAY_HAVE_NEON -DOPUS_ARM_MAY_HAVE_MEDIA \
48                -DOPUS_ARM_MAY_HAVE_EDSP
49endif
50
51LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
52
53include $(BUILD_STATIC_LIBRARY)
54