Android.mk revision 2fa3693c264a4c150ac307d9bb7f6f8f18cc4ffc
1# 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)
16
17############ some local flags
18# 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.
20FLAG_DBG ?= false
21FLAG_DO_PROFILE ?= false
22
23######################################
24include $(CLEAR_VARS)
25
26LATIN_IME_SRC_DIR := src
27
28LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR)
29
30LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \
31    -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers
32
33ifeq ($(TARGET_ARCH), arm)
34ifeq ($(TARGET_GCC_VERSION), 4.6)
35LOCAL_CFLAGS += -Winline
36endif # TARGET_GCC_VERSION
37endif # TARGET_ARCH
38
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 \
45    com_android_inputmethod_latin_DicTraverseSession.cpp \
46    com_android_inputmethod_latin_makedict_Ver3DictDecoder.cpp \
47    jni_common.cpp
48
49LATIN_IME_CORE_SRC_FILES := \
50    suggest/core/suggest.cpp \
51    $(addprefix suggest/core/dicnode/, \
52        dic_node.cpp \
53        dic_node_utils.cpp \
54        dic_nodes_cache.cpp) \
55    $(addprefix suggest/core/dictionary/, \
56        bigram_dictionary.cpp \
57        bloom_filter.cpp \
58        dictionary.cpp \
59        digraph_utils.cpp \
60        error_type_utils.cpp \
61        multi_bigram_map.cpp \
62        unigram_property.cpp) \
63    $(addprefix suggest/core/layout/, \
64        additional_proximity_chars.cpp \
65        proximity_info.cpp \
66        proximity_info_params.cpp \
67        proximity_info_state.cpp \
68        proximity_info_state_utils.cpp) \
69    suggest/core/policy/weighting.cpp \
70    suggest/core/session/dic_traverse_session.cpp \
71    $(addprefix suggest/policyimpl/dictionary/, \
72        header/header_policy.cpp \
73        header/header_read_write_utils.cpp \
74        shortcut/shortcut_list_reading_utils.cpp \
75        structure/dictionary_structure_with_buffer_policy_factory.cpp) \
76    $(addprefix suggest/policyimpl/dictionary/bigram/, \
77        bigram_list_read_write_utils.cpp \
78        ver4_bigram_list_policy.cpp) \
79    $(addprefix suggest/policyimpl/dictionary/structure/pt_common/, \
80        dynamic_pt_gc_event_listeners.cpp \
81        dynamic_pt_reading_helper.cpp \
82        dynamic_pt_reading_utils.cpp \
83        dynamic_pt_updating_helper.cpp \
84        dynamic_pt_writing_utils.cpp) \
85    $(addprefix suggest/policyimpl/dictionary/structure/v2/, \
86        patricia_trie_policy.cpp \
87        patricia_trie_reading_utils.cpp) \
88    $(addprefix suggest/policyimpl/dictionary/structure/v4/, \
89        ver4_dict_buffers.cpp \
90        ver4_dict_constants.cpp \
91        ver4_patricia_trie_node_reader.cpp \
92        ver4_patricia_trie_node_writer.cpp \
93        ver4_patricia_trie_policy.cpp \
94        ver4_patricia_trie_reading_utils.cpp \
95        ver4_patricia_trie_writing_helper.cpp) \
96    $(addprefix suggest/policyimpl/dictionary/structure/v4/content/, \
97        bigram_dict_content.cpp \
98        probability_dict_content.cpp \
99        shortcut_dict_content.cpp \
100        sparse_table_dict_content.cpp \
101        terminal_position_lookup_table.cpp) \
102    $(addprefix suggest/policyimpl/dictionary/utils/, \
103        buffer_with_extendable_buffer.cpp \
104        byte_array_utils.cpp \
105        dict_file_writing_utils.cpp \
106        file_utils.cpp \
107        forgetting_curve_utils.cpp \
108        format_utils.cpp \
109        mmapped_buffer.cpp \
110        sparse_table.cpp) \
111    suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \
112    $(addprefix suggest/policyimpl/typing/, \
113        scoring_params.cpp \
114        typing_scoring.cpp \
115        typing_suggest_policy.cpp \
116        typing_traversal.cpp \
117        typing_weighting.cpp) \
118    $(addprefix utils/, \
119        autocorrection_threshold_utils.cpp \
120        char_utils.cpp \
121        log_utils.cpp \
122        time_keeper.cpp)
123
124LOCAL_SRC_FILES := \
125    $(LATIN_IME_JNI_SRC_FILES) \
126    $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
127
128ifeq ($(FLAG_DO_PROFILE), true)
129    $(warning Making profiling version of native library)
130    LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline
131else # FLAG_DO_PROFILE
132ifeq ($(FLAG_DBG), true)
133    $(warning Making debug version of native library)
134    LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
135ifeq ($(FLAG_FULL_DBG), true)
136    $(warning Making full debug version of native library)
137    LOCAL_CFLAGS += -DFLAG_FULL_DBG
138endif # FLAG_FULL_DBG
139endif # FLAG_DBG
140endif # FLAG_DO_PROFILE
141
142LOCAL_MODULE := libjni_latinime_common_static
143LOCAL_MODULE_TAGS := optional
144
145LOCAL_SDK_VERSION := 14
146LOCAL_NDK_STL_VARIANT := stlport_static
147
148include $(BUILD_STATIC_LIBRARY)
149######################################
150include $(CLEAR_VARS)
151
152# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
153LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
154
155ifeq ($(FLAG_DO_PROFILE), true)
156    $(warning Making profiling version of native library)
157    LOCAL_LDFLAGS += -llog
158else # FLAG_DO_PROFILE
159ifeq ($(FLAG_DBG), true)
160    $(warning Making debug version of native library)
161    LOCAL_LDFLAGS += -llog
162endif # FLAG_DBG
163endif # FLAG_DO_PROFILE
164
165LOCAL_MODULE := libjni_latinime
166LOCAL_MODULE_TAGS := optional
167
168LOCAL_SDK_VERSION := 14
169LOCAL_NDK_STL_VARIANT := stlport_static
170LOCAL_LDFLAGS += -ldl
171
172include $(BUILD_SHARED_LIBRARY)
173
174#################### Clean up the tmp vars
175LATIN_IME_CORE_SRC_FILES :=
176LATIN_IME_JNI_SRC_FILES :=
177LATIN_IME_SRC_DIR :=
178