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