blob: bf188971e9c3f153127541ffcfd70f58de07d255 [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 Wakasaf775bf32012-11-07 07:52:34 +090031 -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers
32
33ifeq ($(TARGET_ARCH), arm)
Ben Chengc2fbd7c2013-04-03 16:59:29 -070034ifeq ($(TARGET_GCC_VERSION), 4.6)
Ken Wakasaf775bf32012-11-07 07:52:34 +090035LOCAL_CFLAGS += -Winline
Ken Wakasa249a6142012-11-20 10:24:32 +090036endif # TARGET_GCC_VERSION
37endif # TARGET_ARCH
Ken Wakasad5e35ac2011-12-13 19:46:15 +090038
39# To suppress compiler warnings for unused variables/functions used for debug features etc.
40LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
41
42LATIN_IME_JNI_SRC_FILES := \
43 com_android_inputmethod_keyboard_ProximityInfo.cpp \
44 com_android_inputmethod_latin_BinaryDictionary.cpp \
Satoshi Kataokac4e4dfe2012-08-08 19:40:44 +090045 com_android_inputmethod_latin_DicTraverseSession.cpp \
Yuichiro Hanada112257e2013-08-20 15:48:16 +090046 com_android_inputmethod_latin_makedict_Ver3DictDecoder.cpp \
Ken Wakasad5e35ac2011-12-13 19:46:15 +090047 jni_common.cpp
48
49LATIN_IME_CORE_SRC_FILES := \
Ken Wakasa31f42ba2013-04-08 20:22:37 +090050 suggest/core/suggest.cpp \
Ken Wakasab68e7342013-04-08 17:08:19 +090051 $(addprefix suggest/core/dicnode/, \
52 dic_node.cpp \
53 dic_node_utils.cpp \
54 dic_nodes_cache.cpp) \
Ken Wakasaa65c2672013-05-31 00:02:57 +090055 $(addprefix suggest/core/dictionary/, \
Satoshi Kataokad1811202013-06-03 13:06:32 +090056 bigram_dictionary.cpp \
Keisuke Kuroynagi1ff81e82013-06-14 20:35:41 +090057 bloom_filter.cpp \
Ken Wakasaa65c2672013-05-31 00:02:57 +090058 dictionary.cpp \
Keisuke Kuroynagi1ff81e82013-06-14 20:35:41 +090059 digraph_utils.cpp \
60 multi_bigram_map.cpp) \
Ken Wakasa29432f82013-05-30 19:45:53 +090061 $(addprefix suggest/core/layout/, \
Ken Wakasa94da44e2013-05-30 20:12:47 +090062 additional_proximity_chars.cpp \
Ken Wakasa29432f82013-05-30 19:45:53 +090063 proximity_info.cpp \
64 proximity_info_params.cpp \
65 proximity_info_state.cpp \
66 proximity_info_state_utils.cpp) \
Satoshi Kataoka3107b462013-04-01 17:57:31 +090067 suggest/core/policy/weighting.cpp \
68 suggest/core/session/dic_traverse_session.cpp \
Keisuke Kuroynagi26de7072013-07-30 17:41:13 +090069 $(addprefix suggest/policyimpl/dictionary/, \
Keisuke Kuroyanagi277053a2013-08-12 11:54:31 +090070 bigram/bigram_list_reading_utils.cpp \
Keisuke Kuroyanagi23d3ed92013-08-13 20:35:16 +090071 header/header_policy.cpp \
72 header/header_reading_utils.cpp \
Keisuke Kuroyanagif1e383e2013-08-12 17:37:59 +090073 shortcut/shortcut_list_reading_utils.cpp \
Keisuke Kuroyanagie1ebef62013-08-09 14:14:39 +090074 dictionary_structure_with_buffer_policy_factory.cpp \
Keisuke Kuroynagi2b1dd6e2013-08-06 10:18:20 +090075 dynamic_patricia_trie_node_reader.cpp \
Keisuke Kuroynagi26de7072013-07-30 17:41:13 +090076 dynamic_patricia_trie_policy.cpp \
Keisuke Kuroynagi2b1dd6e2013-08-06 10:18:20 +090077 dynamic_patricia_trie_reading_utils.cpp \
Keisuke Kuroynagi647c0002013-08-01 16:15:35 +090078 patricia_trie_policy.cpp \
79 patricia_trie_reading_utils.cpp) \
Keisuke Kuroyanagi941811c2013-08-22 18:05:15 +090080 $(addprefix suggest/policyimpl/dictionary/utils/, \
81 byte_array_utils.cpp \
82 extendable_buffer.cpp \
83 format_utils.cpp) \
Satoshi Kataokae67ede12013-04-04 17:58:10 +090084 suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \
Ken Wakasab68e7342013-04-08 17:08:19 +090085 $(addprefix suggest/policyimpl/typing/, \
86 scoring_params.cpp \
87 typing_scoring.cpp \
88 typing_suggest_policy.cpp \
89 typing_traversal.cpp \
Ken Wakasaaddea832013-06-03 12:25:57 +090090 typing_weighting.cpp) \
Keisuke Kuroynagi527c1282013-06-11 17:04:40 +090091 $(addprefix utils/, \
Jean Chalardb6f5d3e2013-07-02 12:51:16 +090092 autocorrection_threshold_utils.cpp \
Keisuke Kuroynagi527c1282013-06-11 17:04:40 +090093 char_utils.cpp \
Jean Chalardb6f5d3e2013-07-02 12:51:16 +090094 log_utils.cpp)
Ken Wakasa8658e552012-06-30 08:53:33 +090095
Ken Wakasad5e35ac2011-12-13 19:46:15 +090096LOCAL_SRC_FILES := \
97 $(LATIN_IME_JNI_SRC_FILES) \
Ken Wakasa0336ec42012-07-02 23:52:35 +090098 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
Ken Wakasa8fcd7692012-06-28 21:47:11 +090099
100ifeq ($(FLAG_DO_PROFILE), true)
101 $(warning Making profiling version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +0900102 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline
Ken Wakasa8fcd7692012-06-28 21:47:11 +0900103else # FLAG_DO_PROFILE
104ifeq ($(FLAG_DBG), true)
105 $(warning Making debug version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +0900106 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
Ken Wakasaccebd5c2013-01-09 15:21:44 +0900107ifeq ($(FLAG_FULL_DBG), true)
108 $(warning Making full debug version of native library)
109 LOCAL_CFLAGS += -DFLAG_FULL_DBG
110endif # FLAG_FULL_DBG
Ken Wakasa8fcd7692012-06-28 21:47:11 +0900111endif # FLAG_DBG
112endif # FLAG_DO_PROFILE
113
Ken Wakasa8658e552012-06-30 08:53:33 +0900114LOCAL_MODULE := libjni_latinime_common_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +0900115LOCAL_MODULE_TAGS := optional
116
Ken Wakasaf52c1c52012-07-06 15:53:51 +0900117LOCAL_SDK_VERSION := 14
118LOCAL_NDK_STL_VARIANT := stlport_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +0900119
120include $(BUILD_STATIC_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -0700121######################################
122include $(CLEAR_VARS)
123
124# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
Satoshi Kataokadeb09872012-07-03 17:45:50 +0900125LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900126
Ying Wang32f0e242012-03-29 14:57:55 -0700127ifeq ($(FLAG_DO_PROFILE), true)
128 $(warning Making profiling version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +0900129 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -0700130else # FLAG_DO_PROFILE
131ifeq ($(FLAG_DBG), true)
132 $(warning Making debug version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +0900133 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -0700134endif # FLAG_DBG
135endif # FLAG_DO_PROFILE
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900136
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900137LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -0800138LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900139
Ken Wakasaf52c1c52012-07-06 15:53:51 +0900140LOCAL_SDK_VERSION := 14
141LOCAL_NDK_STL_VARIANT := stlport_static
Andrew Hsieh5fe05eb2012-12-21 09:25:56 +0800142LOCAL_LDFLAGS += -ldl
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900143
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900144include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -0700145
146#################### Clean up the tmp vars
147LATIN_IME_CORE_SRC_FILES :=
148LATIN_IME_JNI_SRC_FILES :=
149LATIN_IME_SRC_DIR :=