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 | 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 | |
Ken Wakasa | 6e66349 | 2012-11-03 02:50:47 +0900 | [diff] [blame] | 31 | LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ |
Ken Wakasa | f775bf3 | 2012-11-07 07:52:34 +0900 | [diff] [blame] | 32 | -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers |
| 33 | |
| 34 | ifeq ($(TARGET_ARCH), arm) |
Ken Wakasa | 249a614 | 2012-11-20 10:24:32 +0900 | [diff] [blame] | 35 | ifneq ($(TARGET_GCC_VERSION), 4.7) |
Ken Wakasa | f775bf3 | 2012-11-07 07:52:34 +0900 | [diff] [blame] | 36 | LOCAL_CFLAGS += -Winline |
Ken Wakasa | 249a614 | 2012-11-20 10:24:32 +0900 | [diff] [blame] | 37 | endif # TARGET_GCC_VERSION |
| 38 | endif # TARGET_ARCH |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 39 | |
| 40 | # To suppress compiler warnings for unused variables/functions used for debug features etc. |
| 41 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function |
| 42 | |
| 43 | LATIN_IME_JNI_SRC_FILES := \ |
| 44 | com_android_inputmethod_keyboard_ProximityInfo.cpp \ |
| 45 | com_android_inputmethod_latin_BinaryDictionary.cpp \ |
Satoshi Kataoka | c4e4dfe | 2012-08-08 19:40:44 +0900 | [diff] [blame] | 46 | com_android_inputmethod_latin_DicTraverseSession.cpp \ |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 47 | jni_common.cpp |
| 48 | |
| 49 | LATIN_IME_CORE_SRC_FILES := \ |
satok | 552c3c2 | 2012-03-13 16:33:47 +0900 | [diff] [blame] | 50 | additional_proximity_chars.cpp \ |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 51 | bigram_dictionary.cpp \ |
| 52 | char_utils.cpp \ |
| 53 | correction.cpp \ |
| 54 | dictionary.cpp \ |
Satoshi Kataoka | e9f3e18 | 2012-08-09 23:23:08 +0900 | [diff] [blame] | 55 | dic_traverse_wrapper.cpp \ |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 56 | proximity_info.cpp \ |
Satoshi Kataoka | 3e8c58f | 2012-06-05 17:55:52 +0900 | [diff] [blame] | 57 | proximity_info_state.cpp \ |
Satoshi Kataoka | 91eb4d8 | 2012-06-26 16:39:07 +0900 | [diff] [blame] | 58 | unigram_dictionary.cpp \ |
Ken Wakasa | 2c2f3a9 | 2012-11-02 18:29:03 +0900 | [diff] [blame] | 59 | words_priority_queue.cpp \ |
Tom Ouyang | eb2fe2a | 2012-07-18 17:08:20 +0900 | [diff] [blame] | 60 | gesture/gesture_decoder_wrapper.cpp \ |
| 61 | gesture/incremental_decoder_wrapper.cpp |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 62 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 63 | LOCAL_SRC_FILES := \ |
| 64 | $(LATIN_IME_JNI_SRC_FILES) \ |
Ken Wakasa | 0336ec4 | 2012-07-02 23:52:35 +0900 | [diff] [blame] | 65 | $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 66 | |
| 67 | ifeq ($(FLAG_DO_PROFILE), true) |
| 68 | $(warning Making profiling version of native library) |
| 69 | LOCAL_CFLAGS += -DFLAG_DO_PROFILE |
| 70 | else # FLAG_DO_PROFILE |
| 71 | ifeq ($(FLAG_DBG), true) |
| 72 | $(warning Making debug version of native library) |
| 73 | LOCAL_CFLAGS += -DFLAG_DBG |
| 74 | endif # FLAG_DBG |
| 75 | endif # FLAG_DO_PROFILE |
| 76 | |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 77 | LOCAL_MODULE := libjni_latinime_common_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 78 | LOCAL_MODULE_TAGS := optional |
| 79 | |
Ken Wakasa | f52c1c5 | 2012-07-06 15:53:51 +0900 | [diff] [blame] | 80 | LOCAL_SDK_VERSION := 14 |
| 81 | LOCAL_NDK_STL_VARIANT := stlport_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 82 | |
| 83 | include $(BUILD_STATIC_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 84 | ###################################### |
| 85 | include $(CLEAR_VARS) |
| 86 | |
| 87 | # 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] | 88 | LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 89 | |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 90 | ifeq ($(FLAG_DO_PROFILE), true) |
| 91 | $(warning Making profiling version of native library) |
Ken Wakasa | b543c9c | 2012-11-27 12:17:42 +0900 | [diff] [blame] | 92 | LOCAL_LDFLAGS += -llog |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 93 | else # FLAG_DO_PROFILE |
| 94 | ifeq ($(FLAG_DBG), true) |
| 95 | $(warning Making debug version of native library) |
Ken Wakasa | b543c9c | 2012-11-27 12:17:42 +0900 | [diff] [blame] | 96 | LOCAL_LDFLAGS += -llog |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 97 | endif # FLAG_DBG |
| 98 | endif # FLAG_DO_PROFILE |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 99 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 100 | LOCAL_MODULE := libjni_latinime |
Jean-Baptiste Queru | 11c4121 | 2012-01-23 09:06:00 -0800 | [diff] [blame] | 101 | LOCAL_MODULE_TAGS := optional |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 102 | |
Ken Wakasa | f52c1c5 | 2012-07-06 15:53:51 +0900 | [diff] [blame] | 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 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 106 | include $(BUILD_SHARED_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 107 | |
| 108 | #################### Clean up the tmp vars |
| 109 | LATIN_IME_CORE_SRC_FILES := |
| 110 | LATIN_IME_JNI_SRC_FILES := |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 111 | LATIN_IME_GESTURE_IMPL_SRC_FILES := |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 112 | LATIN_IME_SRC_DIR := |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 113 | LATIN_IME_SRC_FULLPATH_DIR := |