blob: 06ed5718e6607ed49a5140aee388ebce9b32e13e [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.
Satoshi Kataoka3ffaf392012-06-29 12:53:34 +090020FLAG_DBG ?= false
satok1035bc92012-06-13 16:07:54 -070021FLAG_DO_PROFILE ?= false
Ying Wang32f0e242012-03-29 14:57:55 -070022
Ying Wang32f0e242012-03-29 14:57:55 -070023######################################
Ken Wakasad5e35ac2011-12-13 19:46:15 +090024include $(CLEAR_VARS)
25
Ken Wakasa3ef3e242012-03-30 09:53:51 +090026LATIN_IME_SRC_DIR := src
Ken Wakasa8fcd7692012-06-28 21:47:11 +090027LATIN_IME_SRC_FULLPATH_DIR := $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR)
Ken Wakasad5e35ac2011-12-13 19:46:15 +090028
Ken Wakasa0336ec42012-07-02 23:52:35 +090029LOCAL_C_INCLUDES += $(LATIN_IME_SRC_FULLPATH_DIR) $(LATIN_IME_SRC_FULLPATH_DIR)/gesture
Ken Wakasad5e35ac2011-12-13 19:46:15 +090030
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 \
Ken Wakasae7b34b92012-06-08 19:05:47 +090039 com_android_inputmethod_latin_NativeUtils.cpp \
Ken Wakasad5e35ac2011-12-13 19:46:15 +090040 jni_common.cpp
41
42LATIN_IME_CORE_SRC_FILES := \
satok552c3c22012-03-13 16:33:47 +090043 additional_proximity_chars.cpp \
Ken Wakasad5e35ac2011-12-13 19:46:15 +090044 basechars.cpp \
45 bigram_dictionary.cpp \
46 char_utils.cpp \
47 correction.cpp \
48 dictionary.cpp \
49 proximity_info.cpp \
Satoshi Kataoka3e8c58f2012-06-05 17:55:52 +090050 proximity_info_state.cpp \
Satoshi Kataoka91eb4d82012-06-26 16:39:07 +090051 unigram_dictionary.cpp \
Tom Ouyangeb2fe2a2012-07-18 17:08:20 +090052 gesture/gesture_decoder_wrapper.cpp \
53 gesture/incremental_decoder_wrapper.cpp
Ken Wakasa8658e552012-06-30 08:53:33 +090054
Ken Wakasad5e35ac2011-12-13 19:46:15 +090055LOCAL_SRC_FILES := \
56 $(LATIN_IME_JNI_SRC_FILES) \
Ken Wakasa0336ec42012-07-02 23:52:35 +090057 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
Ken Wakasa8fcd7692012-06-28 21:47:11 +090058
59ifeq ($(FLAG_DO_PROFILE), true)
60 $(warning Making profiling version of native library)
61 LOCAL_CFLAGS += -DFLAG_DO_PROFILE
62else # FLAG_DO_PROFILE
63ifeq ($(FLAG_DBG), true)
64 $(warning Making debug version of native library)
65 LOCAL_CFLAGS += -DFLAG_DBG
66endif # FLAG_DBG
67endif # FLAG_DO_PROFILE
68
Ken Wakasa8658e552012-06-30 08:53:33 +090069LOCAL_MODULE := libjni_latinime_common_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090070LOCAL_MODULE_TAGS := optional
71
Ken Wakasaea92b7b2012-07-10 09:19:07 +090072# TODO: Remove this conditional block once we have no issues with building against NDK
Ying Wang0493bb22012-07-09 17:47:31 -070073ifndef TARGET_BUILD_APPS # A full system image build
Ken Wakasa8fcd7692012-06-28 21:47:11 +090074include external/stlport/libstlport.mk
Ying Wang0493bb22012-07-09 17:47:31 -070075else # An unbundled build
Ken Wakasaf52c1c52012-07-06 15:53:51 +090076LOCAL_NDK_VERSION := 7
77LOCAL_SDK_VERSION := 14
78LOCAL_NDK_STL_VARIANT := stlport_static
79endif
Ken Wakasa8fcd7692012-06-28 21:47:11 +090080
81include $(BUILD_STATIC_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070082######################################
83include $(CLEAR_VARS)
84
85# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
Satoshi Kataokadeb09872012-07-03 17:45:50 +090086LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090087
Ying Wang32f0e242012-03-29 14:57:55 -070088ifeq ($(FLAG_DO_PROFILE), true)
89 $(warning Making profiling version of native library)
90 LOCAL_SHARED_LIBRARIES += libcutils libutils
91else # FLAG_DO_PROFILE
92ifeq ($(FLAG_DBG), true)
93 $(warning Making debug version of native library)
94 LOCAL_SHARED_LIBRARIES += libcutils libutils
95endif # FLAG_DBG
96endif # FLAG_DO_PROFILE
Ken Wakasad5e35ac2011-12-13 19:46:15 +090097
Ken Wakasad5e35ac2011-12-13 19:46:15 +090098LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -080099LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900100
Ken Wakasaea92b7b2012-07-10 09:19:07 +0900101# TODO: Remove this conditional block once we have no issues with building against NDK
Ying Wang0493bb22012-07-09 17:47:31 -0700102ifndef TARGET_BUILD_APPS # A full system image build
Ken Wakasac6461022012-07-06 15:17:11 +0900103LOCAL_STATIC_LIBRARIES += libstlport_static
Ying Wang0493bb22012-07-09 17:47:31 -0700104else # An unbundled build
Ken Wakasaf52c1c52012-07-06 15:53:51 +0900105LOCAL_NDK_VERSION := 7
106LOCAL_SDK_VERSION := 14
107LOCAL_NDK_STL_VARIANT := stlport_static
108endif
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +0900109
Ken Wakasad5e35ac2011-12-13 19:46:15 +0900110include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -0700111
112#################### Clean up the tmp vars
113LATIN_IME_CORE_SRC_FILES :=
114LATIN_IME_JNI_SRC_FILES :=
Ken Wakasa8fcd7692012-06-28 21:47:11 +0900115LATIN_IME_GESTURE_IMPL_SRC_FILES :=
Ying Wang32f0e242012-03-29 14:57:55 -0700116LATIN_IME_SRC_DIR :=
Ken Wakasa8fcd7692012-06-28 21:47:11 +0900117LATIN_IME_SRC_FULLPATH_DIR :=