blob: 5e0d3518dc46b1837990f677b936f9d62ed60669 [file] [log] [blame]
Ken Wakasad5e35ac2011-12-13 19:46:15 +09001# 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)
Ying Wang32f0e242012-03-29 14:57:55 -070016
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######################################
Ken Wakasad5e35ac2011-12-13 19:46:15 +090042include $(CLEAR_VARS)
43
Ken Wakasa3ef3e242012-03-30 09:53:51 +090044LATIN_IME_SRC_DIR := src
Ken Wakasad5e35ac2011-12-13 19:46:15 +090045
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 := \
satok552c3c22012-03-13 16:33:47 +090059 additional_proximity_chars.cpp \
Ken Wakasad5e35ac2011-12-13 19:46:15 +090060 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
Ying Wang32f0e242012-03-29 14:57:55 -070072ifeq ($(TARGETING_UNBUNDLED_FROYO), true)
73 LOCAL_NDK_VERSION := 4
74 LOCAL_SDK_VERSION := 8
Ken Wakasad5e35ac2011-12-13 19:46:15 +090075endif
76
77ifeq ($(FLAG_DO_PROFILE), true)
Ying Wang32f0e242012-03-29 14:57:55 -070078 $(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
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090090ifdef HISTORICAL_NDK_VERSIONS_ROOT # In the platform build system
Ying Wang32f0e242012-03-29 14:57:55 -070091include external/stlport/libstlport.mk
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090092else # In the NDK build system
93LOCAL_C_INCLUDES += external/stlport/stlport bionic
94endif
95
Ying Wang32f0e242012-03-29 14:57:55 -070096include $(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
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900103
104ifdef HISTORICAL_NDK_VERSIONS_ROOT # In the platform build system
Ying Wang32f0e242012-03-29 14:57:55 -0700105LOCAL_SHARED_LIBRARIES := libstlport
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900106else # In the NDK build system
107LOCAL_SHARED_LIBRARIES := libstlport_static
108endif
Ying Wang32f0e242012-03-29 14:57:55 -0700109
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
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900119
120ifeq ($(TARGETING_UNBUNDLED_FROYO), true)
121 LOCAL_NDK_VERSION := 4
122 LOCAL_SDK_VERSION := 8
123endif
124
125LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -0800126LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900127
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900128ifdef HISTORICAL_NDK_VERSIONS_ROOT # In the platform build system
Ying Wang32f0e242012-03-29 14:57:55 -0700129include external/stlport/libstlport.mk
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900130endif
131
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900132include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -0700133
134#################### Clean up the tmp vars
135LATIN_IME_CORE_SRC_FILES :=
136LATIN_IME_JNI_SRC_FILES :=
137LATIN_IME_SRC_DIR :=
138TARGETING_UNBUNDLED_FROYO :=