Android.mk revision ffd08e37881e9e7f403d04c1a1a8aaba409d36b5
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 27LATIN_IME_SRC_FULLPATH_DIR := $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) 28 29LOCAL_C_INCLUDES += $(LATIN_IME_SRC_FULLPATH_DIR) $(LATIN_IME_SRC_FULLPATH_DIR)/suggest 30 31LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ 32 -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers 33 34ifeq ($(TARGET_ARCH), arm) 35ifneq ($(TARGET_GCC_VERSION), 4.7) 36LOCAL_CFLAGS += -Winline 37endif # TARGET_GCC_VERSION 38endif # TARGET_ARCH 39 40# To suppress compiler warnings for unused variables/functions used for debug features etc. 41LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function 42 43LATIN_IME_JNI_SRC_FILES := \ 44 com_android_inputmethod_keyboard_ProximityInfo.cpp \ 45 com_android_inputmethod_latin_BinaryDictionary.cpp \ 46 com_android_inputmethod_latin_DicTraverseSession.cpp \ 47 jni_common.cpp 48 49LATIN_IME_CORE_SRC_FILES := \ 50 additional_proximity_chars.cpp \ 51 bigram_dictionary.cpp \ 52 char_utils.cpp \ 53 correction.cpp \ 54 dictionary.cpp \ 55 dic_traverse_wrapper.cpp \ 56 proximity_info.cpp \ 57 proximity_info_state.cpp \ 58 unigram_dictionary.cpp \ 59 words_priority_queue.cpp \ 60 suggest/gesture_suggest.cpp \ 61 suggest/typing_suggest.cpp 62 63LOCAL_SRC_FILES := \ 64 $(LATIN_IME_JNI_SRC_FILES) \ 65 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) 66 67ifeq ($(FLAG_DO_PROFILE), true) 68 $(warning Making profiling version of native library) 69 LOCAL_CFLAGS += -DFLAG_DO_PROFILE 70else # FLAG_DO_PROFILE 71ifeq ($(FLAG_DBG), true) 72 $(warning Making debug version of native library) 73 LOCAL_CFLAGS += -DFLAG_DBG 74endif # FLAG_DBG 75endif # FLAG_DO_PROFILE 76 77LOCAL_MODULE := libjni_latinime_common_static 78LOCAL_MODULE_TAGS := optional 79 80LOCAL_SDK_VERSION := 14 81LOCAL_NDK_STL_VARIANT := stlport_static 82 83include $(BUILD_STATIC_LIBRARY) 84###################################### 85include $(CLEAR_VARS) 86 87# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. 88LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static 89 90ifeq ($(FLAG_DO_PROFILE), true) 91 $(warning Making profiling version of native library) 92 LOCAL_LDFLAGS += -llog 93else # FLAG_DO_PROFILE 94ifeq ($(FLAG_DBG), true) 95 $(warning Making debug version of native library) 96 LOCAL_LDFLAGS += -llog 97endif # FLAG_DBG 98endif # FLAG_DO_PROFILE 99 100LOCAL_MODULE := libjni_latinime 101LOCAL_MODULE_TAGS := optional 102 103LOCAL_SDK_VERSION := 14 104LOCAL_NDK_STL_VARIANT := stlport_static 105 106include $(BUILD_SHARED_LIBRARY) 107 108#################### Clean up the tmp vars 109LATIN_IME_CORE_SRC_FILES := 110LATIN_IME_JNI_SRC_FILES := 111LATIN_IME_GESTURE_IMPL_SRC_FILES := 112LATIN_IME_SRC_DIR := 113LATIN_IME_SRC_FULLPATH_DIR := 114