Android.mk revision 94da44e43eac54047fb690c753d3af2a7d3a03c8
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 15LOCAL_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. 20FLAG_DBG ?= false 21FLAG_DO_PROFILE ?= false 22 23###################################### 24include $(CLEAR_VARS) 25 26LATIN_IME_SRC_DIR := src 27 28LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) 29 30LOCAL_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 33ifeq ($(TARGET_ARCH), arm) 34ifeq ($(TARGET_GCC_VERSION), 4.6) 35LOCAL_CFLAGS += -Winline 36endif # TARGET_GCC_VERSION 37endif # TARGET_ARCH 38 39# To suppress compiler warnings for unused variables/functions used for debug features etc. 40LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function 41 42LATIN_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 48LATIN_IME_CORE_SRC_FILES := \ 49 bigram_dictionary.cpp \ 50 char_utils.cpp \ 51 correction.cpp \ 52 dictionary.cpp \ 53 dic_traverse_wrapper.cpp \ 54 digraph_utils.cpp \ 55 unigram_dictionary.cpp \ 56 words_priority_queue.cpp \ 57 suggest/core/suggest.cpp \ 58 $(addprefix suggest/core/dicnode/, \ 59 dic_node.cpp \ 60 dic_node_utils.cpp \ 61 dic_nodes_cache.cpp) \ 62 $(addprefix suggest/core/layout/, \ 63 additional_proximity_chars.cpp \ 64 proximity_info.cpp \ 65 proximity_info_params.cpp \ 66 proximity_info_state.cpp \ 67 proximity_info_state_utils.cpp) \ 68 suggest/core/policy/weighting.cpp \ 69 suggest/core/session/dic_traverse_session.cpp \ 70 suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \ 71 $(addprefix suggest/policyimpl/typing/, \ 72 scoring_params.cpp \ 73 typing_scoring.cpp \ 74 typing_suggest_policy.cpp \ 75 typing_traversal.cpp \ 76 typing_weighting.cpp) 77 78LOCAL_SRC_FILES := \ 79 $(LATIN_IME_JNI_SRC_FILES) \ 80 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) 81 82ifeq ($(FLAG_DO_PROFILE), true) 83 $(warning Making profiling version of native library) 84 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline 85else # FLAG_DO_PROFILE 86ifeq ($(FLAG_DBG), true) 87 $(warning Making debug version of native library) 88 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline 89ifeq ($(FLAG_FULL_DBG), true) 90 $(warning Making full debug version of native library) 91 LOCAL_CFLAGS += -DFLAG_FULL_DBG 92endif # FLAG_FULL_DBG 93endif # FLAG_DBG 94endif # FLAG_DO_PROFILE 95 96LOCAL_MODULE := libjni_latinime_common_static 97LOCAL_MODULE_TAGS := optional 98 99LOCAL_SDK_VERSION := 14 100LOCAL_NDK_STL_VARIANT := stlport_static 101 102include $(BUILD_STATIC_LIBRARY) 103###################################### 104include $(CLEAR_VARS) 105 106# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. 107LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static 108 109ifeq ($(FLAG_DO_PROFILE), true) 110 $(warning Making profiling version of native library) 111 LOCAL_LDFLAGS += -llog 112else # FLAG_DO_PROFILE 113ifeq ($(FLAG_DBG), true) 114 $(warning Making debug version of native library) 115 LOCAL_LDFLAGS += -llog 116endif # FLAG_DBG 117endif # FLAG_DO_PROFILE 118 119LOCAL_MODULE := libjni_latinime 120LOCAL_MODULE_TAGS := optional 121 122LOCAL_SDK_VERSION := 14 123LOCAL_NDK_STL_VARIANT := stlport_static 124LOCAL_LDFLAGS += -ldl 125 126include $(BUILD_SHARED_LIBRARY) 127 128#################### Clean up the tmp vars 129LATIN_IME_CORE_SRC_FILES := 130LATIN_IME_JNI_SRC_FILES := 131LATIN_IME_SRC_DIR := 132