blob: 9657b9d65a73e14d42fd9da4c1a1dd3f130f51fa [file] [log] [blame]
Ken Wakasad5e35ac2011-12-13 19:46:15 +09001# Copyright (C) 2011 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
15LOCAL_PATH := $(call my-dir)
Ying Wang32f0e242012-03-29 14:57:55 -070016
17############ some local flags
Ken Wakasae3f26dd2012-07-27 18:06:06 +090018# If you change any of those flags, you need to rebuild both libjni_latinime_common_static
19# and the shared library that uses libjni_latinime_common_static.
Satoshi Kataoka3ffaf392012-06-29 12:53:34 +090020FLAG_DBG ?= false
satok1035bc92012-06-13 16:07:54 -070021FLAG_DO_PROFILE ?= false
Ying Wang32f0e242012-03-29 14:57:55 -070022
Ying Wang32f0e242012-03-29 14:57:55 -070023######################################
Ken Wakasad5e35ac2011-12-13 19:46:15 +090024include $(CLEAR_VARS)
25
Ken Wakasa3ef3e242012-03-30 09:53:51 +090026LATIN_IME_SRC_DIR := src
Ken Wakasad5e35ac2011-12-13 19:46:15 +090027
Ken Wakasa31f42ba2013-04-08 20:22:37 +090028LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR)
Ken Wakasad5e35ac2011-12-13 19:46:15 +090029
Ken Wakasa6e663492012-11-03 02:50:47 +090030LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \
Ken Wakasaabe3a352013-12-18 23:29:35 +090031 -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \
32 -Woverloaded-virtual -Wstrict-null-sentinel -Wsign-promo -Wno-system-headers
Ken Wakasaf775bf32012-11-07 07:52:34 +090033
Ken Wakasad5e35ac2011-12-13 19:46:15 +090034# To suppress compiler warnings for unused variables/functions used for debug features etc.
35LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
36
Ken Wakasaca0a0da2014-03-06 19:47:20 +090037# For C++11
38LOCAL_CFLAGS += -std=c++11
39
Jean Chalarda245d152013-12-12 15:08:10 +090040include $(LOCAL_PATH)/NativeFileList.mk
Ken Wakasa8658e552012-06-30 08:53:33 +090041
Ken Wakasad5e35ac2011-12-13 19:46:15 +090042LOCAL_SRC_FILES := \
43 $(LATIN_IME_JNI_SRC_FILES) \
Ken Wakasa0336ec42012-07-02 23:52:35 +090044 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
Ken Wakasa8fcd7692012-06-28 21:47:11 +090045
46ifeq ($(FLAG_DO_PROFILE), true)
47 $(warning Making profiling version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090048 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline
Ken Wakasa8fcd7692012-06-28 21:47:11 +090049else # FLAG_DO_PROFILE
50ifeq ($(FLAG_DBG), true)
51 $(warning Making debug version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090052 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
Ken Wakasaccebd5c2013-01-09 15:21:44 +090053ifeq ($(FLAG_FULL_DBG), true)
54 $(warning Making full debug version of native library)
55 LOCAL_CFLAGS += -DFLAG_FULL_DBG
56endif # FLAG_FULL_DBG
Ken Wakasa8fcd7692012-06-28 21:47:11 +090057endif # FLAG_DBG
58endif # FLAG_DO_PROFILE
59
Ken Wakasa8658e552012-06-30 08:53:33 +090060LOCAL_MODULE := libjni_latinime_common_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090061LOCAL_MODULE_TAGS := optional
62
Ken Wakasaf52c1c52012-07-06 15:53:51 +090063LOCAL_SDK_VERSION := 14
Ken Wakasaca0a0da2014-03-06 19:47:20 +090064LOCAL_NDK_STL_VARIANT := gnustl_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090065
66include $(BUILD_STATIC_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070067######################################
68include $(CLEAR_VARS)
69
70# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
Satoshi Kataokadeb09872012-07-03 17:45:50 +090071LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090072
Ying Wang32f0e242012-03-29 14:57:55 -070073ifeq ($(FLAG_DO_PROFILE), true)
74 $(warning Making profiling version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090075 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070076else # FLAG_DO_PROFILE
77ifeq ($(FLAG_DBG), true)
78 $(warning Making debug version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090079 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070080endif # FLAG_DBG
81endif # FLAG_DO_PROFILE
Ken Wakasad5e35ac2011-12-13 19:46:15 +090082
Ken Wakasad5e35ac2011-12-13 19:46:15 +090083LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -080084LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +090085
Ken Wakasaf52c1c52012-07-06 15:53:51 +090086LOCAL_SDK_VERSION := 14
Ken Wakasaca0a0da2014-03-06 19:47:20 +090087LOCAL_NDK_STL_VARIANT := gnustl_static
Andrew Hsieh5fe05eb2012-12-21 09:25:56 +080088LOCAL_LDFLAGS += -ldl
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090089
Ken Wakasad5e35ac2011-12-13 19:46:15 +090090include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070091
92#################### Clean up the tmp vars
Jean Chalarda245d152013-12-12 15:08:10 +090093include $(LOCAL_PATH)/CleanupNativeFileList.mk