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) 16 17 ############ some local flags 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. 20 FLAG_DBG ?= false 21 FLAG_DO_PROFILE ?= false 22 23 ###################################### 24 include $(CLEAR_VARS) 25 26 LATIN_IME_SRC_DIR := src 27 28 LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) 29 30 LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ 31 -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers 32 33 ifeq ($(TARGET_ARCH), arm) 34 ifeq ($(TARGET_GCC_VERSION), 4.6) 35 LOCAL_CFLAGS += -Winline 36 endif # TARGET_GCC_VERSION 37 endif # TARGET_ARCH 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 \ 45 com_android_inputmethod_latin_DicTraverseSession.cpp \ 46 jni_common.cpp 47 48 LATIN_IME_CORE_SRC_FILES := \ 49 additional_proximity_chars.cpp \ 50 bigram_dictionary.cpp \ 51 char_utils.cpp \ 52 correction.cpp \ 53 dictionary.cpp \ 54 dic_traverse_wrapper.cpp \ 55 digraph_utils.cpp \ 56 proximity_info.cpp \ 57 proximity_info_params.cpp \ 58 proximity_info_state.cpp \ 59 proximity_info_state_utils.cpp \ 60 unigram_dictionary.cpp \ 61 words_priority_queue.cpp \ 62 suggest/core/suggest.cpp \ 63 $(addprefix suggest/core/dicnode/, \ 64 dic_node.cpp \ 65 dic_node_utils.cpp \ 66 dic_nodes_cache.cpp) \ 67 suggest/core/policy/weighting.cpp \ 68 suggest/core/session/dic_traverse_session.cpp \ 69 suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \ 70 $(addprefix suggest/policyimpl/typing/, \ 71 scoring_params.cpp \ 72 typing_scoring.cpp \ 73 typing_suggest_policy.cpp \ 74 typing_traversal.cpp \ 75 typing_weighting.cpp) 76 77 LOCAL_SRC_FILES := \ 78 $(LATIN_IME_JNI_SRC_FILES) \ 79 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) 80 81 ifeq ($(FLAG_DO_PROFILE), true) 82 $(warning Making profiling version of native library) 83 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline 84 else # FLAG_DO_PROFILE 85 ifeq ($(FLAG_DBG), true) 86 $(warning Making debug version of native library) 87 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline 88 ifeq ($(FLAG_FULL_DBG), true) 89 $(warning Making full debug version of native library) 90 LOCAL_CFLAGS += -DFLAG_FULL_DBG 91 endif # FLAG_FULL_DBG 92 endif # FLAG_DBG 93 endif # FLAG_DO_PROFILE 94 95 LOCAL_MODULE := libjni_latinime_common_static 96 LOCAL_MODULE_TAGS := optional 97 98 LOCAL_SDK_VERSION := 14 99 LOCAL_NDK_STL_VARIANT := stlport_static 100 101 include $(BUILD_STATIC_LIBRARY) 102 ###################################### 103 include $(CLEAR_VARS) 104 105 # All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. 106 LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static 107 108 ifeq ($(FLAG_DO_PROFILE), true) 109 $(warning Making profiling version of native library) 110 LOCAL_LDFLAGS += -llog 111 else # FLAG_DO_PROFILE 112 ifeq ($(FLAG_DBG), true) 113 $(warning Making debug version of native library) 114 LOCAL_LDFLAGS += -llog 115 endif # FLAG_DBG 116 endif # FLAG_DO_PROFILE 117 118 LOCAL_MODULE := libjni_latinime 119 LOCAL_MODULE_TAGS := optional 120 121 LOCAL_SDK_VERSION := 14 122 LOCAL_NDK_STL_VARIANT := stlport_static 123 LOCAL_LDFLAGS += -ldl 124 125 include $(BUILD_SHARED_LIBRARY) 126 127 #################### Clean up the tmp vars 128 LATIN_IME_CORE_SRC_FILES := 129 LATIN_IME_JNI_SRC_FILES := 130 LATIN_IME_SRC_DIR := 131