Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 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 | |
| 15 | LOCAL_PATH := $(call my-dir) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 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. |
Satoshi Kataoka | 3ffaf39 | 2012-06-29 12:53:34 +0900 | [diff] [blame] | 20 | FLAG_DBG ?= false |
satok | 1035bc9 | 2012-06-13 16:07:54 -0700 | [diff] [blame] | 21 | FLAG_DO_PROFILE ?= false |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 22 | |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 23 | ###################################### |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 24 | include $(CLEAR_VARS) |
| 25 | |
Ken Wakasa | 3ef3e24 | 2012-03-30 09:53:51 +0900 | [diff] [blame] | 26 | LATIN_IME_SRC_DIR := src |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 27 | LATIN_IME_SRC_FULLPATH_DIR := $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 28 | |
Ken Wakasa | 0336ec4 | 2012-07-02 23:52:35 +0900 | [diff] [blame] | 29 | LOCAL_C_INCLUDES += $(LATIN_IME_SRC_FULLPATH_DIR) $(LATIN_IME_SRC_FULLPATH_DIR)/gesture |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 30 | |
| 31 | LOCAL_CFLAGS += -Werror -Wall |
| 32 | |
| 33 | # To suppress compiler warnings for unused variables/functions used for debug features etc. |
| 34 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function |
| 35 | |
| 36 | LATIN_IME_JNI_SRC_FILES := \ |
| 37 | com_android_inputmethod_keyboard_ProximityInfo.cpp \ |
| 38 | com_android_inputmethod_latin_BinaryDictionary.cpp \ |
Ken Wakasa | e7b34b9 | 2012-06-08 19:05:47 +0900 | [diff] [blame] | 39 | com_android_inputmethod_latin_NativeUtils.cpp \ |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 40 | jni_common.cpp |
| 41 | |
| 42 | LATIN_IME_CORE_SRC_FILES := \ |
satok | 552c3c2 | 2012-03-13 16:33:47 +0900 | [diff] [blame] | 43 | additional_proximity_chars.cpp \ |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 44 | basechars.cpp \ |
| 45 | bigram_dictionary.cpp \ |
| 46 | char_utils.cpp \ |
| 47 | correction.cpp \ |
| 48 | dictionary.cpp \ |
| 49 | proximity_info.cpp \ |
Satoshi Kataoka | 3e8c58f | 2012-06-05 17:55:52 +0900 | [diff] [blame] | 50 | proximity_info_state.cpp \ |
Satoshi Kataoka | 91eb4d8 | 2012-06-26 16:39:07 +0900 | [diff] [blame] | 51 | unigram_dictionary.cpp \ |
Satoshi Kataoka | deb0987 | 2012-07-03 17:45:50 +0900 | [diff] [blame] | 52 | gesture/gesture_decoder_wrapper.cpp |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 53 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 54 | LOCAL_SRC_FILES := \ |
| 55 | $(LATIN_IME_JNI_SRC_FILES) \ |
Ken Wakasa | 0336ec4 | 2012-07-02 23:52:35 +0900 | [diff] [blame] | 56 | $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 57 | |
| 58 | ifeq ($(FLAG_DO_PROFILE), true) |
| 59 | $(warning Making profiling version of native library) |
| 60 | LOCAL_CFLAGS += -DFLAG_DO_PROFILE |
| 61 | else # FLAG_DO_PROFILE |
| 62 | ifeq ($(FLAG_DBG), true) |
| 63 | $(warning Making debug version of native library) |
| 64 | LOCAL_CFLAGS += -DFLAG_DBG |
| 65 | endif # FLAG_DBG |
| 66 | endif # FLAG_DO_PROFILE |
| 67 | |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 68 | LOCAL_MODULE := libjni_latinime_common_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 69 | LOCAL_MODULE_TAGS := optional |
| 70 | |
Ken Wakasa | c646102 | 2012-07-06 15:17:11 +0900 | [diff] [blame] | 71 | ifdef ANDROID_BUILD_TOP # In the platform build system |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 72 | include external/stlport/libstlport.mk |
Ken Wakasa | c646102 | 2012-07-06 15:17:11 +0900 | [diff] [blame] | 73 | else # In the unbundled build system |
| 74 | LOCAL_NDK_VERSION := 7 |
| 75 | LOCAL_SDK_VERSION := 14 |
| 76 | LOCAL_NDK_STL_VARIANT := stlport_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 77 | endif |
| 78 | |
| 79 | include $(BUILD_STATIC_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 80 | ###################################### |
| 81 | include $(CLEAR_VARS) |
| 82 | |
| 83 | # All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. |
Satoshi Kataoka | deb0987 | 2012-07-03 17:45:50 +0900 | [diff] [blame] | 84 | LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 85 | |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 86 | ifeq ($(FLAG_DO_PROFILE), true) |
| 87 | $(warning Making profiling version of native library) |
| 88 | LOCAL_SHARED_LIBRARIES += libcutils libutils |
| 89 | else # FLAG_DO_PROFILE |
| 90 | ifeq ($(FLAG_DBG), true) |
| 91 | $(warning Making debug version of native library) |
| 92 | LOCAL_SHARED_LIBRARIES += libcutils libutils |
| 93 | endif # FLAG_DBG |
| 94 | endif # FLAG_DO_PROFILE |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 95 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 96 | LOCAL_MODULE := libjni_latinime |
Jean-Baptiste Queru | 11c4121 | 2012-01-23 09:06:00 -0800 | [diff] [blame] | 97 | LOCAL_MODULE_TAGS := optional |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 98 | |
Ken Wakasa | c646102 | 2012-07-06 15:17:11 +0900 | [diff] [blame] | 99 | ifdef ANDROID_BUILD_TOP # In the platform build system |
| 100 | LOCAL_STATIC_LIBRARIES += libstlport_static |
| 101 | else # In the unbundled build system |
| 102 | LOCAL_NDK_VERSION := 7 |
| 103 | LOCAL_SDK_VERSION := 14 |
| 104 | LOCAL_NDK_STL_VARIANT := stlport_static |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 105 | endif |
| 106 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 107 | include $(BUILD_SHARED_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 108 | |
| 109 | #################### Clean up the tmp vars |
| 110 | LATIN_IME_CORE_SRC_FILES := |
| 111 | LATIN_IME_JNI_SRC_FILES := |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 112 | LATIN_IME_GESTURE_IMPL_SRC_FILES := |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 113 | LATIN_IME_SRC_DIR := |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 114 | LATIN_IME_SRC_FULLPATH_DIR := |