Android.mk revision 0c1a3ec629a7df8e5dcf0cc000b68c8f1a809a40
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_static
19# and the shared library.
20#FLAG_DBG := true
21#FLAG_DO_PROFILE := true
22
23TARGETING_UNBUNDLED_FROYO := true
24
25ifeq ($(TARGET_ARCH), x86)
26    TARGETING_UNBUNDLED_FROYO := false
27endif
28
29ifeq ($(TARGET_ARCH), mips)
30    TARGETING_UNBUNDLED_FROYO := false
31endif
32
33ifeq ($(FLAG_DBG), true)
34    TARGETING_UNBUNDLED_FROYO := false
35endif
36
37ifeq ($(FLAG_DO_PROFILE), true)
38    TARGETING_UNBUNDLED_FROYO := false
39endif
40
41######################################
42include $(CLEAR_VARS)
43
44LATIN_IME_SRC_DIR := src
45
46LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR)
47
48LOCAL_CFLAGS += -Werror -Wall
49
50# To suppress compiler warnings for unused variables/functions used for debug features etc.
51LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
52
53LATIN_IME_JNI_SRC_FILES := \
54    com_android_inputmethod_keyboard_ProximityInfo.cpp \
55    com_android_inputmethod_latin_BinaryDictionary.cpp \
56    jni_common.cpp
57
58LATIN_IME_CORE_SRC_FILES := \
59    additional_proximity_chars.cpp \
60    basechars.cpp \
61    bigram_dictionary.cpp \
62    char_utils.cpp \
63    correction.cpp \
64    dictionary.cpp \
65    proximity_info.cpp \
66    unigram_dictionary.cpp
67
68LOCAL_SRC_FILES := \
69    $(LATIN_IME_JNI_SRC_FILES) \
70    $(addprefix $(LATIN_IME_SRC_DIR)/,$(LATIN_IME_CORE_SRC_FILES))
71
72ifeq ($(TARGETING_UNBUNDLED_FROYO), true)
73    LOCAL_NDK_VERSION := 4
74    LOCAL_SDK_VERSION := 8
75endif
76
77ifeq ($(FLAG_DO_PROFILE), true)
78    $(warning Making profiling version of native library)
79    LOCAL_CFLAGS += -DFLAG_DO_PROFILE
80else # FLAG_DO_PROFILE
81ifeq ($(FLAG_DBG), true)
82    $(warning Making debug version of native library)
83    LOCAL_CFLAGS += -DFLAG_DBG
84endif # FLAG_DBG
85endif # FLAG_DO_PROFILE
86
87LOCAL_MODULE := libjni_latinime_static
88LOCAL_MODULE_TAGS := optional
89
90ifdef HISTORICAL_NDK_VERSIONS_ROOT # In the platform build system
91include external/stlport/libstlport.mk
92else # In the NDK build system
93LOCAL_C_INCLUDES += external/stlport/stlport bionic
94endif
95
96include $(BUILD_STATIC_LIBRARY)
97
98######################################
99include $(CLEAR_VARS)
100
101# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
102LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_static
103
104ifdef HISTORICAL_NDK_VERSIONS_ROOT # In the platform build system
105LOCAL_SHARED_LIBRARIES := libstlport
106else # In the NDK build system
107LOCAL_SHARED_LIBRARIES := libstlport_static
108endif
109
110ifeq ($(FLAG_DO_PROFILE), true)
111    $(warning Making profiling version of native library)
112    LOCAL_SHARED_LIBRARIES += libcutils libutils
113else # FLAG_DO_PROFILE
114ifeq ($(FLAG_DBG), true)
115    $(warning Making debug version of native library)
116    LOCAL_SHARED_LIBRARIES += libcutils libutils
117endif # FLAG_DBG
118endif # FLAG_DO_PROFILE
119
120ifeq ($(TARGETING_UNBUNDLED_FROYO), true)
121    LOCAL_NDK_VERSION := 4
122    LOCAL_SDK_VERSION := 8
123endif
124
125LOCAL_MODULE := libjni_latinime
126LOCAL_MODULE_TAGS := optional
127
128ifdef HISTORICAL_NDK_VERSIONS_ROOT # In the platform build system
129include external/stlport/libstlport.mk
130endif
131
132include $(BUILD_SHARED_LIBRARY)
133
134#################### Clean up the tmp vars
135LATIN_IME_CORE_SRC_FILES :=
136LATIN_IME_JNI_SRC_FILES :=
137LATIN_IME_SRC_DIR :=
138TARGETING_UNBUNDLED_FROYO :=
139