Android.mk revision 50eadf798535cee9dd367ad0faf583938356ff40
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
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    gesture/gesture_decoder_wrapper.cpp \
54    gesture/incremental_decoder_wrapper.cpp
55
56LOCAL_SRC_FILES := \
57    $(LATIN_IME_JNI_SRC_FILES) \
58    $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
59
60ifeq ($(FLAG_DO_PROFILE), true)
61    $(warning Making profiling version of native library)
62    LOCAL_CFLAGS += -DFLAG_DO_PROFILE
63else # FLAG_DO_PROFILE
64ifeq ($(FLAG_DBG), true)
65    $(warning Making debug version of native library)
66    LOCAL_CFLAGS += -DFLAG_DBG
67endif # FLAG_DBG
68endif # FLAG_DO_PROFILE
69
70LOCAL_MODULE := libjni_latinime_common_static
71LOCAL_MODULE_TAGS := optional
72
73LOCAL_SDK_VERSION := 14
74LOCAL_NDK_STL_VARIANT := stlport_static
75
76include $(BUILD_STATIC_LIBRARY)
77######################################
78include $(CLEAR_VARS)
79
80# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
81LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
82
83ifeq ($(FLAG_DO_PROFILE), true)
84    $(warning Making profiling version of native library)
85    LOCAL_SHARED_LIBRARIES += liblog
86else # FLAG_DO_PROFILE
87ifeq ($(FLAG_DBG), true)
88    $(warning Making debug version of native library)
89    LOCAL_SHARED_LIBRARIES += liblog
90endif # FLAG_DBG
91endif # FLAG_DO_PROFILE
92
93LOCAL_MODULE := libjni_latinime
94LOCAL_MODULE_TAGS := optional
95
96LOCAL_SDK_VERSION := 14
97LOCAL_NDK_STL_VARIANT := stlport_static
98
99include $(BUILD_SHARED_LIBRARY)
100
101#################### Clean up the tmp vars
102LATIN_IME_CORE_SRC_FILES :=
103LATIN_IME_JNI_SRC_FILES :=
104LATIN_IME_GESTURE_IMPL_SRC_FILES :=
105LATIN_IME_SRC_DIR :=
106LATIN_IME_SRC_FULLPATH_DIR :=
107