blob: a5ead4ad7f2ed9f0cb4a9606014b738b27522932 [file] [log] [blame]
Dan Bornstein3f30fc02009-07-21 16:08:39 -07001# 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.
The Android Open Source Project7f844dd2009-03-03 19:28:47 -080014
Dan Bornstein3f30fc02009-07-21 16:08:39 -070015
16LOCAL_PATH := $(call my-dir)
17
Elliott Hughes73d3c2e2012-05-03 17:06:04 -070018local_src_files := \
Brian Carlstromdd8af232012-05-13 23:56:07 -070019 JNIHelp.cpp \
20 JniConstants.cpp \
21 toStringArray.cpp
Dan Bornstein3f30fc02009-07-21 16:08:39 -070022
23
24#
25# Build for the target (device).
26#
27
28include $(CLEAR_VARS)
Ruben Brunka77f3a22013-09-09 02:21:31 -070029LOCAL_SRC_FILES := \
30 $(local_src_files) \
31 JniInvocation.cpp
Elliott Hughes73d3c2e2012-05-03 17:06:04 -070032LOCAL_SHARED_LIBRARIES := liblog
Jesse Wilson51c0f5b2010-09-16 15:56:25 -070033LOCAL_MODULE_TAGS := optional
The Android Open Source Project7f844dd2009-03-03 19:28:47 -080034LOCAL_MODULE := libnativehelper
Andreas Gampe73ff0de2014-08-25 14:58:30 -070035LOCAL_CLANG := true
Andreas Gampe5f4f4aa2014-08-19 16:57:38 -070036LOCAL_CFLAGS := -Werror -fvisibility=protected
Dan Albert32392a32014-09-26 10:27:04 -070037LOCAL_C_INCLUDES := libcore/include
38LOCAL_SHARED_LIBRARIES += libcutils libdl
Brian Carlstromb2acfa22013-06-19 15:09:28 -070039LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
The Android Open Source Project7f844dd2009-03-03 19:28:47 -080040include $(BUILD_SHARED_LIBRARY)
Dan Bornstein3f30fc02009-07-21 16:08:39 -070041
Ruben Brunka77f3a22013-09-09 02:21:31 -070042
Sam Hasinoff9a321e12014-04-24 17:52:07 -070043#
44# NDK-only build for the target (device), using libc++.
45# - Relies only on NDK exposed functionality.
46# - This doesn't include JniInvocation.
47#
48
49include $(CLEAR_VARS)
50LOCAL_MODULE_TAGS := optional
51LOCAL_MODULE := libnativehelper_compat_libc++
Andreas Gampe73ff0de2014-08-25 14:58:30 -070052LOCAL_CLANG := true
Sam Hasinoff9a321e12014-04-24 17:52:07 -070053LOCAL_C_INCLUDES := \
54 $(LOCAL_PATH)/include/nativehelper
55LOCAL_EXPORT_C_INCLUDE_DIRS := \
56 $(LOCAL_PATH)/include/nativehelper
57LOCAL_CFLAGS := -Werror
58LOCAL_SRC_FILES := $(local_src_files)
Nicolas Geoffray9d5ffd82014-05-07 17:57:25 +000059LOCAL_LDFLAGS := -llog -ldl
Sam Hasinoff9a321e12014-04-24 17:52:07 -070060LOCAL_SDK_VERSION := 19
61LOCAL_NDK_STL_VARIANT := c++_static
62LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
63include $(BUILD_SHARED_LIBRARY)
Ruben Brunka77f3a22013-09-09 02:21:31 -070064
Dan Bornstein3f30fc02009-07-21 16:08:39 -070065
66#
67# Build for the host.
68#
69
Elliott Hughes73d3c2e2012-05-03 17:06:04 -070070include $(CLEAR_VARS)
71LOCAL_MODULE := libnativehelper
72LOCAL_MODULE_TAGS := optional
Andreas Gampe73ff0de2014-08-25 14:58:30 -070073LOCAL_CLANG := true
Ruben Brunka77f3a22013-09-09 02:21:31 -070074LOCAL_SRC_FILES := \
75 $(local_src_files) \
76 JniInvocation.cpp
Andreas Gampe5f4f4aa2014-08-19 16:57:38 -070077LOCAL_CFLAGS := -Werror -fvisibility=protected
Brian Carlstromdd8af232012-05-13 23:56:07 -070078LOCAL_C_INCLUDES := libcore/include
Elliott Hughes73d3c2e2012-05-03 17:06:04 -070079LOCAL_SHARED_LIBRARIES := liblog
Nicolas Geoffray9d5ffd82014-05-07 17:57:25 +000080LOCAL_LDFLAGS := -ldl
Brian Carlstromb2acfa22013-06-19 15:09:28 -070081LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Ian Rogers9305a752014-06-16 08:25:45 -070082LOCAL_MULTILIB := both
Elliott Hughes73d3c2e2012-05-03 17:06:04 -070083include $(BUILD_HOST_SHARED_LIBRARY)
Ningsheng Jian88b84ec2014-09-17 13:34:09 +080084
85#
86# Tests.
87#
88
89include $(LOCAL_PATH)/tests/Android.mk