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 |
Ken Wakasa | e3f26dd | 2012-07-27 18:06:06 +0900 | [diff] [blame] | 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. |
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 | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 27 | |
Ken Wakasa | 31f42ba | 2013-04-08 20:22:37 +0900 | [diff] [blame] | 28 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 29 | |
Ken Wakasa | 6e66349 | 2012-11-03 02:50:47 +0900 | [diff] [blame] | 30 | LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ |
Ken Wakasa | f775bf3 | 2012-11-07 07:52:34 +0900 | [diff] [blame] | 31 | -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers |
| 32 | |
| 33 | ifeq ($(TARGET_ARCH), arm) |
Ben Cheng | c2fbd7c | 2013-04-03 16:59:29 -0700 | [diff] [blame] | 34 | ifeq ($(TARGET_GCC_VERSION), 4.6) |
Ken Wakasa | f775bf3 | 2012-11-07 07:52:34 +0900 | [diff] [blame] | 35 | LOCAL_CFLAGS += -Winline |
Ken Wakasa | 249a614 | 2012-11-20 10:24:32 +0900 | [diff] [blame] | 36 | endif # TARGET_GCC_VERSION |
| 37 | endif # TARGET_ARCH |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 38 | |
| 39 | # To suppress compiler warnings for unused variables/functions used for debug features etc. |
| 40 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function |
| 41 | |
| 42 | LATIN_IME_JNI_SRC_FILES := \ |
| 43 | com_android_inputmethod_keyboard_ProximityInfo.cpp \ |
| 44 | com_android_inputmethod_latin_BinaryDictionary.cpp \ |
Satoshi Kataoka | c4e4dfe | 2012-08-08 19:40:44 +0900 | [diff] [blame] | 45 | com_android_inputmethod_latin_DicTraverseSession.cpp \ |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 46 | jni_common.cpp |
| 47 | |
| 48 | LATIN_IME_CORE_SRC_FILES := \ |
Ken Wakasa | 31f42ba | 2013-04-08 20:22:37 +0900 | [diff] [blame] | 49 | suggest/core/suggest.cpp \ |
Ken Wakasa | b68e734 | 2013-04-08 17:08:19 +0900 | [diff] [blame] | 50 | $(addprefix suggest/core/dicnode/, \ |
| 51 | dic_node.cpp \ |
| 52 | dic_node_utils.cpp \ |
| 53 | dic_nodes_cache.cpp) \ |
Ken Wakasa | a65c267 | 2013-05-31 00:02:57 +0900 | [diff] [blame] | 54 | $(addprefix suggest/core/dictionary/, \ |
Satoshi Kataoka | d181120 | 2013-06-03 13:06:32 +0900 | [diff] [blame] | 55 | bigram_dictionary.cpp \ |
Keisuke Kuroynagi | a71ed8c | 2013-06-14 18:12:56 +0900 | [diff] [blame] | 56 | binary_dictionary_bigrams_reading_utils.cpp \ |
Keisuke Kuroynagi | bd0d1af | 2013-06-11 12:01:49 +0900 | [diff] [blame] | 57 | binary_dictionary_format_utils.cpp \ |
| 58 | binary_dictionary_header.cpp \ |
| 59 | binary_dictionary_header_reading_utils.cpp \ |
Keisuke Kuroynagi | 1ff81e8 | 2013-06-14 20:35:41 +0900 | [diff] [blame^] | 60 | bloom_filter.cpp \ |
Keisuke Kuroyanagi | 0ecfb94 | 2013-06-02 16:34:42 -0700 | [diff] [blame] | 61 | byte_array_utils.cpp \ |
Ken Wakasa | a65c267 | 2013-05-31 00:02:57 +0900 | [diff] [blame] | 62 | dictionary.cpp \ |
Keisuke Kuroynagi | 1ff81e8 | 2013-06-14 20:35:41 +0900 | [diff] [blame^] | 63 | digraph_utils.cpp \ |
| 64 | multi_bigram_map.cpp) \ |
Ken Wakasa | 29432f8 | 2013-05-30 19:45:53 +0900 | [diff] [blame] | 65 | $(addprefix suggest/core/layout/, \ |
Ken Wakasa | 94da44e | 2013-05-30 20:12:47 +0900 | [diff] [blame] | 66 | additional_proximity_chars.cpp \ |
Ken Wakasa | 29432f8 | 2013-05-30 19:45:53 +0900 | [diff] [blame] | 67 | proximity_info.cpp \ |
| 68 | proximity_info_params.cpp \ |
| 69 | proximity_info_state.cpp \ |
| 70 | proximity_info_state_utils.cpp) \ |
Satoshi Kataoka | 3107b46 | 2013-04-01 17:57:31 +0900 | [diff] [blame] | 71 | suggest/core/policy/weighting.cpp \ |
| 72 | suggest/core/session/dic_traverse_session.cpp \ |
Satoshi Kataoka | e67ede1 | 2013-04-04 17:58:10 +0900 | [diff] [blame] | 73 | suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \ |
Ken Wakasa | b68e734 | 2013-04-08 17:08:19 +0900 | [diff] [blame] | 74 | $(addprefix suggest/policyimpl/typing/, \ |
| 75 | scoring_params.cpp \ |
| 76 | typing_scoring.cpp \ |
| 77 | typing_suggest_policy.cpp \ |
| 78 | typing_traversal.cpp \ |
Ken Wakasa | addea83 | 2013-06-03 12:25:57 +0900 | [diff] [blame] | 79 | typing_weighting.cpp) \ |
Keisuke Kuroynagi | 527c128 | 2013-06-11 17:04:40 +0900 | [diff] [blame] | 80 | $(addprefix utils/, \ |
| 81 | char_utils.cpp \ |
Keisuke Kuroynagi | 0b7cd6a | 2013-06-11 18:05:04 +0900 | [diff] [blame] | 82 | autocorrection_threshold_utils.cpp) |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 83 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 84 | LOCAL_SRC_FILES := \ |
| 85 | $(LATIN_IME_JNI_SRC_FILES) \ |
Ken Wakasa | 0336ec4 | 2012-07-02 23:52:35 +0900 | [diff] [blame] | 86 | $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 87 | |
| 88 | ifeq ($(FLAG_DO_PROFILE), true) |
| 89 | $(warning Making profiling version of native library) |
Ken Wakasa | 6cee61d | 2013-01-15 16:15:48 +0900 | [diff] [blame] | 90 | LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 91 | else # FLAG_DO_PROFILE |
| 92 | ifeq ($(FLAG_DBG), true) |
| 93 | $(warning Making debug version of native library) |
Ken Wakasa | 6cee61d | 2013-01-15 16:15:48 +0900 | [diff] [blame] | 94 | LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline |
Ken Wakasa | ccebd5c | 2013-01-09 15:21:44 +0900 | [diff] [blame] | 95 | ifeq ($(FLAG_FULL_DBG), true) |
| 96 | $(warning Making full debug version of native library) |
| 97 | LOCAL_CFLAGS += -DFLAG_FULL_DBG |
| 98 | endif # FLAG_FULL_DBG |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 99 | endif # FLAG_DBG |
| 100 | endif # FLAG_DO_PROFILE |
| 101 | |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 102 | LOCAL_MODULE := libjni_latinime_common_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 103 | LOCAL_MODULE_TAGS := optional |
| 104 | |
Ken Wakasa | f52c1c5 | 2012-07-06 15:53:51 +0900 | [diff] [blame] | 105 | LOCAL_SDK_VERSION := 14 |
| 106 | LOCAL_NDK_STL_VARIANT := stlport_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 107 | |
| 108 | include $(BUILD_STATIC_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 109 | ###################################### |
| 110 | include $(CLEAR_VARS) |
| 111 | |
| 112 | # 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] | 113 | LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 114 | |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 115 | ifeq ($(FLAG_DO_PROFILE), true) |
| 116 | $(warning Making profiling version of native library) |
Ken Wakasa | b543c9c | 2012-11-27 12:17:42 +0900 | [diff] [blame] | 117 | LOCAL_LDFLAGS += -llog |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 118 | else # FLAG_DO_PROFILE |
| 119 | ifeq ($(FLAG_DBG), true) |
| 120 | $(warning Making debug version of native library) |
Ken Wakasa | b543c9c | 2012-11-27 12:17:42 +0900 | [diff] [blame] | 121 | LOCAL_LDFLAGS += -llog |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 122 | endif # FLAG_DBG |
| 123 | endif # FLAG_DO_PROFILE |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 124 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 125 | LOCAL_MODULE := libjni_latinime |
Jean-Baptiste Queru | 11c4121 | 2012-01-23 09:06:00 -0800 | [diff] [blame] | 126 | LOCAL_MODULE_TAGS := optional |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 127 | |
Ken Wakasa | f52c1c5 | 2012-07-06 15:53:51 +0900 | [diff] [blame] | 128 | LOCAL_SDK_VERSION := 14 |
| 129 | LOCAL_NDK_STL_VARIANT := stlport_static |
Andrew Hsieh | 5fe05eb | 2012-12-21 09:25:56 +0800 | [diff] [blame] | 130 | LOCAL_LDFLAGS += -ldl |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 131 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 132 | include $(BUILD_SHARED_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 133 | |
| 134 | #################### Clean up the tmp vars |
| 135 | LATIN_IME_CORE_SRC_FILES := |
| 136 | LATIN_IME_JNI_SRC_FILES := |
| 137 | LATIN_IME_SRC_DIR := |