blob: 70e337623ee2a9805634e7a0bc4719579897b55a [file] [log] [blame]
andrew@webrtc.orgb9d7d932012-01-25 19:21:13 +00001# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
leozwang@google.com79835d12011-08-05 21:01:02 +00002#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
niklase@google.com470e71d2011-07-07 08:21:25 +00008
kma@webrtc.orgb59c0312011-12-03 18:34:50 +00009#############################
10# Build the non-neon library.
niklase@google.com470e71d2011-07-07 08:21:25 +000011LOCAL_PATH := $(call my-dir)
12
13include $(CLEAR_VARS)
14
andrew@webrtc.org4d5d5c12011-10-19 01:40:33 +000015include $(LOCAL_PATH)/../../../../android-webrtc.mk
leozwang@google.com79835d12011-08-05 21:01:02 +000016
niklase@google.com470e71d2011-07-07 08:21:25 +000017LOCAL_MODULE_CLASS := STATIC_LIBRARIES
18LOCAL_MODULE := libwebrtc_ns
19LOCAL_MODULE_TAGS := optional
20LOCAL_GENERATED_SOURCES :=
21LOCAL_SRC_FILES := \
22 noise_suppression_x.c \
kma@google.com579ee4d2011-08-09 04:30:06 +000023 nsx_core.c
niklase@google.com470e71d2011-07-07 08:21:25 +000024
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000025# Files for floating point.
kma@webrtc.org0d321da2012-05-26 01:05:27 +000026# noise_suppression.c ns_core.c
niklase@google.com470e71d2011-07-07 08:21:25 +000027
28# Flags passed to both C and C++ files.
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000029LOCAL_CFLAGS := $(MY_WEBRTC_COMMON_DEFS)
kma@google.com579ee4d2011-08-09 04:30:06 +000030
leozwang@google.com58d09cf2011-07-25 22:49:00 +000031LOCAL_C_INCLUDES := \
andrew@webrtc.orgb9d7d932012-01-25 19:21:13 +000032 $(LOCAL_PATH)/include \
andrew@webrtc.org4d5d5c12011-10-19 01:40:33 +000033 $(LOCAL_PATH)/../utility \
34 $(LOCAL_PATH)/../../.. \
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000035 $(LOCAL_PATH)/../../../common_audio/signal_processing/include \
leozwang@webrtc.orgf3adba42012-11-15 18:17:40 +000036 $(LOCAL_PATH)/../../../system_wrappers/interface \
37 external/webrtc
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000038
39LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers
niklase@google.com470e71d2011-07-07 08:21:25 +000040
leozwang@google.com58d09cf2011-07-25 22:49:00 +000041LOCAL_SHARED_LIBRARIES := \
42 libcutils \
niklase@google.com470e71d2011-07-07 08:21:25 +000043 libdl \
44 libstlport
niklase@google.com470e71d2011-07-07 08:21:25 +000045
leozwang@google.com58d09cf2011-07-25 22:49:00 +000046ifndef NDK_ROOT
niklase@google.com470e71d2011-07-07 08:21:25 +000047include external/stlport/libstlport.mk
leozwang@google.com58d09cf2011-07-25 22:49:00 +000048endif
niklase@google.com470e71d2011-07-07 08:21:25 +000049include $(BUILD_STATIC_LIBRARY)
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000050
51#############################
52# Build the neon library.
kma@webrtc.org746f9e32012-01-04 17:47:57 +000053ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000054
55include $(CLEAR_VARS)
56
kma@webrtc.org746f9e32012-01-04 17:47:57 +000057LOCAL_ARM_MODE := arm
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000058LOCAL_MODULE_CLASS := STATIC_LIBRARIES
59LOCAL_MODULE := libwebrtc_ns_neon
60LOCAL_MODULE_TAGS := optional
kma@webrtc.org12454022012-11-07 22:34:31 +000061NS_ASM_HEADER := $(intermediates)/ns_core_neon_offsets.h
62NS_ASM_HEADER_DIR := $(intermediates)
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000063
kma@webrtc.org0d321da2012-05-26 01:05:27 +000064# Generate a header file nsx_core_neon_offsets.h which will be included in
65# assembly file nsx_core_neon.S, from file nsx_core_neon_offsets.c.
kma@webrtc.org12454022012-11-07 22:34:31 +000066$(NS_ASM_HEADER): $(LOCAL_PATH)/../../../build/generate_asm_header.py \
67 $(LOCAL_PATH)/nsx_core_neon_offsets.c
68 @python $^ --compiler=$(TARGET_CC) --options="$(addprefix -I, \
69 $(LOCAL_INCLUDES)) $(addprefix -isystem , $(TARGET_C_INCLUDES)) -S" \
70 --dir=$(NS_ASM_HEADER_DIR)
kma@webrtc.org0d321da2012-05-26 01:05:27 +000071
kma@webrtc.org12454022012-11-07 22:34:31 +000072LOCAL_GENERATED_SOURCES := $(NS_ASM_HEADER)
kma@webrtc.org0d321da2012-05-26 01:05:27 +000073LOCAL_SRC_FILES := nsx_core_neon.S
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000074
75# Flags passed to both C and C++ files.
76LOCAL_CFLAGS := \
77 $(MY_WEBRTC_COMMON_DEFS) \
78 -mfpu=neon \
kma@webrtc.org746f9e32012-01-04 17:47:57 +000079 -mfloat-abi=softfp \
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000080 -flax-vector-conversions
81
82LOCAL_C_INCLUDES := \
kma@webrtc.org12454022012-11-07 22:34:31 +000083 $(NS_ASM_HEADER_DIR) \
andrew@webrtc.orgb9d7d932012-01-25 19:21:13 +000084 $(LOCAL_PATH)/include \
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000085 $(LOCAL_PATH)/../../.. \
leozwang@webrtc.orgf3adba42012-11-15 18:17:40 +000086 $(LOCAL_PATH)/../../../common_audio/signal_processing/include \
87 external/webrtc
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000088
kma@webrtc.org0d321da2012-05-26 01:05:27 +000089LOCAL_INCLUDES := $(LOCAL_C_INCLUDES)
90
kma@webrtc.orgb59c0312011-12-03 18:34:50 +000091ifndef NDK_ROOT
92include external/stlport/libstlport.mk
93endif
94include $(BUILD_STATIC_LIBRARY)
kma@webrtc.org746f9e32012-01-04 17:47:57 +000095endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)