• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2009 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16LOCAL_PATH := $(call my-dir)
17
18local_src_files := \
19    JNIHelp.cpp \
20    JniConstants.cpp \
21    toStringArray.cpp
22
23#
24# Build for the target (device).
25#
26
27include $(CLEAR_VARS)
28LOCAL_SRC_FILES := \
29    $(local_src_files) \
30    JniInvocation.cpp \
31    AsynchronousCloseMonitor.cpp
32
33LOCAL_SHARED_LIBRARIES := liblog
34LOCAL_MODULE_TAGS := optional
35LOCAL_MODULE := libnativehelper
36LOCAL_CLANG := true
37LOCAL_CFLAGS := -Werror -fvisibility=protected
38LOCAL_C_INCLUDES := libcore/include
39LOCAL_SHARED_LIBRARIES += libdl
40LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
41include $(BUILD_SHARED_LIBRARY)
42
43
44#
45# NDK-only build for the target (device), using libc++.
46# - Relies only on NDK exposed functionality.
47# - This doesn't include JniInvocation.
48#
49
50include $(CLEAR_VARS)
51LOCAL_MODULE_TAGS := optional
52LOCAL_MODULE := libnativehelper_compat_libc++
53LOCAL_CLANG := true
54LOCAL_C_INCLUDES := \
55    $(LOCAL_PATH)/include/nativehelper
56LOCAL_EXPORT_C_INCLUDE_DIRS := \
57    $(LOCAL_PATH)/include/nativehelper
58LOCAL_CFLAGS := -Werror
59LOCAL_SRC_FILES := $(local_src_files)
60LOCAL_LDFLAGS := -llog -ldl
61LOCAL_SDK_VERSION := 19
62LOCAL_NDK_STL_VARIANT := c++_static
63LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
64include $(BUILD_SHARED_LIBRARY)
65
66
67#
68# Build for the host.
69#
70
71include $(CLEAR_VARS)
72LOCAL_MODULE := libnativehelper
73LOCAL_MODULE_TAGS := optional
74LOCAL_CLANG := true
75LOCAL_SRC_FILES := \
76    $(local_src_files) \
77    JniInvocation.cpp
78ifeq ($(HOST_OS),linux)
79LOCAL_SRC_FILES += AsynchronousCloseMonitor.cpp
80endif
81LOCAL_CFLAGS := -Werror -fvisibility=protected
82LOCAL_C_INCLUDES := libcore/include
83LOCAL_SHARED_LIBRARIES := liblog
84LOCAL_LDFLAGS := -ldl
85LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
86LOCAL_MULTILIB := both
87include $(BUILD_HOST_SHARED_LIBRARY)
88
89
90#
91# Build static for the host.
92#
93
94include $(CLEAR_VARS)
95LOCAL_MODULE := libnativehelper
96LOCAL_MODULE_TAGS := optional
97LOCAL_CLANG := true
98LOCAL_SRC_FILES := \
99    $(local_src_files) \
100    JniInvocation.cpp
101ifeq ($(HOST_OS),linux)
102LOCAL_SRC_FILES += AsynchronousCloseMonitor.cpp
103endif
104LOCAL_CFLAGS := -Werror -fvisibility=protected
105LOCAL_C_INCLUDES := libcore/include
106LOCAL_STATIC_LIBRARIES := liblog
107LOCAL_LDFLAGS := -ldl
108LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
109LOCAL_MULTILIB := both
110include $(BUILD_HOST_STATIC_LIBRARY)
111
112
113#
114# Tests.
115#
116
117include $(LOCAL_PATH)/tests/Android.mk
118