Android.mk revision c2fbd7c64d97743723d4d4da3f8dacf797ad0339
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)/suggest
30
31LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \
32    -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers
33
34ifeq ($(TARGET_ARCH), arm)
35ifeq ($(TARGET_GCC_VERSION), 4.6)
36LOCAL_CFLAGS += -Winline
37endif # TARGET_GCC_VERSION
38endif # TARGET_ARCH
39
40# To suppress compiler warnings for unused variables/functions used for debug features etc.
41LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
42
43LATIN_IME_JNI_SRC_FILES := \
44    com_android_inputmethod_keyboard_ProximityInfo.cpp \
45    com_android_inputmethod_latin_BinaryDictionary.cpp \
46    com_android_inputmethod_latin_DicTraverseSession.cpp \
47    jni_common.cpp
48
49LATIN_IME_CORE_SRC_FILES := \
50    additional_proximity_chars.cpp \
51    bigram_dictionary.cpp \
52    char_utils.cpp \
53    correction.cpp \
54    dictionary.cpp \
55    dic_traverse_wrapper.cpp \
56    proximity_info.cpp \
57    proximity_info_params.cpp \
58    proximity_info_state.cpp \
59    proximity_info_state_utils.cpp \
60    unigram_dictionary.cpp \
61    words_priority_queue.cpp \
62    suggest/gesture_suggest.cpp \
63    suggest/typing_suggest.cpp
64
65LOCAL_SRC_FILES := \
66    $(LATIN_IME_JNI_SRC_FILES) \
67    $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
68
69ifeq ($(FLAG_DO_PROFILE), true)
70    $(warning Making profiling version of native library)
71    LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline
72else # FLAG_DO_PROFILE
73ifeq ($(FLAG_DBG), true)
74    $(warning Making debug version of native library)
75    LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
76ifeq ($(FLAG_FULL_DBG), true)
77    $(warning Making full debug version of native library)
78    LOCAL_CFLAGS += -DFLAG_FULL_DBG
79endif # FLAG_FULL_DBG
80endif # FLAG_DBG
81endif # FLAG_DO_PROFILE
82
83LOCAL_MODULE := libjni_latinime_common_static
84LOCAL_MODULE_TAGS := optional
85
86LOCAL_SDK_VERSION := 14
87LOCAL_NDK_STL_VARIANT := stlport_static
88
89include $(BUILD_STATIC_LIBRARY)
90######################################
91include $(CLEAR_VARS)
92
93# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
94LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
95
96ifeq ($(FLAG_DO_PROFILE), true)
97    $(warning Making profiling version of native library)
98    LOCAL_LDFLAGS += -llog
99else # FLAG_DO_PROFILE
100ifeq ($(FLAG_DBG), true)
101    $(warning Making debug version of native library)
102    LOCAL_LDFLAGS += -llog
103endif # FLAG_DBG
104endif # FLAG_DO_PROFILE
105
106LOCAL_MODULE := libjni_latinime
107LOCAL_MODULE_TAGS := optional
108
109LOCAL_SDK_VERSION := 14
110LOCAL_NDK_STL_VARIANT := stlport_static
111LOCAL_LDFLAGS += -ldl
112
113include $(BUILD_SHARED_LIBRARY)
114
115#################### Clean up the tmp vars
116LATIN_IME_CORE_SRC_FILES :=
117LATIN_IME_JNI_SRC_FILES :=
118LATIN_IME_GESTURE_IMPL_SRC_FILES :=
119LATIN_IME_SRC_DIR :=
120LATIN_IME_SRC_FULLPATH_DIR :=
121