Android.mk revision 2c2f3a90d8115777adbe9ffd597f344aede84276
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
27LATIN_IME_SRC_FULLPATH_DIR := $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR)
28
29LOCAL_C_INCLUDES += $(LATIN_IME_SRC_FULLPATH_DIR) $(LATIN_IME_SRC_FULLPATH_DIR)/gesture
30
31LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wno-system-headers
32
33# To suppress compiler warnings for unused variables/functions used for debug features etc.
34LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
35
36LATIN_IME_JNI_SRC_FILES := \
37    com_android_inputmethod_keyboard_ProximityInfo.cpp \
38    com_android_inputmethod_latin_BinaryDictionary.cpp \
39    com_android_inputmethod_latin_DicTraverseSession.cpp \
40    jni_common.cpp
41
42LATIN_IME_CORE_SRC_FILES := \
43    additional_proximity_chars.cpp \
44    basechars.cpp \
45    bigram_dictionary.cpp \
46    char_utils.cpp \
47    correction.cpp \
48    dictionary.cpp \
49    dic_traverse_wrapper.cpp \
50    proximity_info.cpp \
51    proximity_info_state.cpp \
52    unigram_dictionary.cpp \
53    words_priority_queue.cpp \
54    gesture/gesture_decoder_wrapper.cpp \
55    gesture/incremental_decoder_wrapper.cpp
56
57LOCAL_SRC_FILES := \
58    $(LATIN_IME_JNI_SRC_FILES) \
59    $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
60
61ifeq ($(FLAG_DO_PROFILE), true)
62    $(warning Making profiling version of native library)
63    LOCAL_CFLAGS += -DFLAG_DO_PROFILE
64else # FLAG_DO_PROFILE
65ifeq ($(FLAG_DBG), true)
66    $(warning Making debug version of native library)
67    LOCAL_CFLAGS += -DFLAG_DBG
68endif # FLAG_DBG
69endif # FLAG_DO_PROFILE
70
71LOCAL_MODULE := libjni_latinime_common_static
72LOCAL_MODULE_TAGS := optional
73
74LOCAL_SDK_VERSION := 14
75LOCAL_NDK_STL_VARIANT := stlport_static
76
77include $(BUILD_STATIC_LIBRARY)
78######################################
79include $(CLEAR_VARS)
80
81# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
82LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
83
84ifeq ($(FLAG_DO_PROFILE), true)
85    $(warning Making profiling version of native library)
86    LOCAL_SHARED_LIBRARIES += liblog
87else # FLAG_DO_PROFILE
88ifeq ($(FLAG_DBG), true)
89    $(warning Making debug version of native library)
90    LOCAL_SHARED_LIBRARIES += liblog
91endif # FLAG_DBG
92endif # FLAG_DO_PROFILE
93
94LOCAL_MODULE := libjni_latinime
95LOCAL_MODULE_TAGS := optional
96
97LOCAL_SDK_VERSION := 14
98LOCAL_NDK_STL_VARIANT := stlport_static
99
100include $(BUILD_SHARED_LIBRARY)
101
102#################### Clean up the tmp vars
103LATIN_IME_CORE_SRC_FILES :=
104LATIN_IME_JNI_SRC_FILES :=
105LATIN_IME_GESTURE_IMPL_SRC_FILES :=
106LATIN_IME_SRC_DIR :=
107LATIN_IME_SRC_FULLPATH_DIR :=
108