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