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 |
Ken Wakasa | e3f26dd | 2012-07-27 18:06:06 +0900 | [diff] [blame] | 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. |
Satoshi Kataoka | 3ffaf39 | 2012-06-29 12:53:34 +0900 | [diff] [blame] | 20 | FLAG_DBG ?= false |
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 | |
Ken Wakasa | 31f42ba | 2013-04-08 20:22:37 +0900 | [diff] [blame] | 28 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 29 | |
Ken Wakasa | 6e66349 | 2012-11-03 02:50:47 +0900 | [diff] [blame] | 30 | LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ |
Ken Wakasa | abe3a35 | 2013-12-18 23:29:35 +0900 | [diff] [blame] | 31 | -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \ |
Ken Wakasa | 46b6f60 | 2014-03-18 12:09:10 +0900 | [diff] [blame] | 32 | -Woverloaded-virtual -Wsign-promo -Wno-system-headers |
Ken Wakasa | f775bf3 | 2012-11-07 07:52:34 +0900 | [diff] [blame] | 33 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 34 | # To suppress compiler warnings for unused variables/functions used for debug features etc. |
| 35 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function |
| 36 | |
Jean Chalard | a245d15 | 2013-12-12 15:08:10 +0900 | [diff] [blame] | 37 | include $(LOCAL_PATH)/NativeFileList.mk |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 38 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 39 | LOCAL_SRC_FILES := \ |
| 40 | $(LATIN_IME_JNI_SRC_FILES) \ |
Ken Wakasa | 0336ec4 | 2012-07-02 23:52:35 +0900 | [diff] [blame] | 41 | $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 42 | |
| 43 | ifeq ($(FLAG_DO_PROFILE), true) |
| 44 | $(warning Making profiling version of native library) |
Ken Wakasa | 6cee61d | 2013-01-15 16:15:48 +0900 | [diff] [blame] | 45 | LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 46 | else # FLAG_DO_PROFILE |
| 47 | ifeq ($(FLAG_DBG), true) |
| 48 | $(warning Making debug version of native library) |
Ken Wakasa | 6cee61d | 2013-01-15 16:15:48 +0900 | [diff] [blame] | 49 | LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline |
Ken Wakasa | ccebd5c | 2013-01-09 15:21:44 +0900 | [diff] [blame] | 50 | ifeq ($(FLAG_FULL_DBG), true) |
| 51 | $(warning Making full debug version of native library) |
| 52 | LOCAL_CFLAGS += -DFLAG_FULL_DBG |
| 53 | endif # FLAG_FULL_DBG |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 54 | endif # FLAG_DBG |
| 55 | endif # FLAG_DO_PROFILE |
| 56 | |
Ken Wakasa | 8658e55 | 2012-06-30 08:53:33 +0900 | [diff] [blame] | 57 | LOCAL_MODULE := libjni_latinime_common_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 58 | LOCAL_MODULE_TAGS := optional |
| 59 | |
Ken Wakasa | 46b6f60 | 2014-03-18 12:09:10 +0900 | [diff] [blame] | 60 | LOCAL_CLANG := true |
Ken Wakasa | f52c1c5 | 2012-07-06 15:53:51 +0900 | [diff] [blame] | 61 | LOCAL_SDK_VERSION := 14 |
Ken Wakasa | 46b6f60 | 2014-03-18 12:09:10 +0900 | [diff] [blame] | 62 | LOCAL_NDK_STL_VARIANT := c++_static |
Ken Wakasa | 8fcd769 | 2012-06-28 21:47:11 +0900 | [diff] [blame] | 63 | |
| 64 | include $(BUILD_STATIC_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 65 | ###################################### |
| 66 | include $(CLEAR_VARS) |
| 67 | |
| 68 | # All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. |
Satoshi Kataoka | deb0987 | 2012-07-03 17:45:50 +0900 | [diff] [blame] | 69 | LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 70 | |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 71 | ifeq ($(FLAG_DO_PROFILE), true) |
| 72 | $(warning Making profiling version of native library) |
Ken Wakasa | b543c9c | 2012-11-27 12:17:42 +0900 | [diff] [blame] | 73 | LOCAL_LDFLAGS += -llog |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 74 | else # FLAG_DO_PROFILE |
| 75 | ifeq ($(FLAG_DBG), true) |
| 76 | $(warning Making debug version of native library) |
Ken Wakasa | b543c9c | 2012-11-27 12:17:42 +0900 | [diff] [blame] | 77 | LOCAL_LDFLAGS += -llog |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 78 | endif # FLAG_DBG |
| 79 | endif # FLAG_DO_PROFILE |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 80 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 81 | LOCAL_MODULE := libjni_latinime |
Jean-Baptiste Queru | 11c4121 | 2012-01-23 09:06:00 -0800 | [diff] [blame] | 82 | LOCAL_MODULE_TAGS := optional |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 83 | |
Ken Wakasa | 46b6f60 | 2014-03-18 12:09:10 +0900 | [diff] [blame] | 84 | LOCAL_CLANG := true |
Ken Wakasa | f52c1c5 | 2012-07-06 15:53:51 +0900 | [diff] [blame] | 85 | LOCAL_SDK_VERSION := 14 |
Ken Wakasa | 46b6f60 | 2014-03-18 12:09:10 +0900 | [diff] [blame] | 86 | LOCAL_NDK_STL_VARIANT := c++_static |
Andrew Hsieh | 5fe05eb | 2012-12-21 09:25:56 +0800 | [diff] [blame] | 87 | LOCAL_LDFLAGS += -ldl |
Ken Wakasa | 0c1a3ec | 2012-03-31 05:07:32 +0900 | [diff] [blame] | 88 | |
Ken Wakasa | d5e35ac | 2011-12-13 19:46:15 +0900 | [diff] [blame] | 89 | include $(BUILD_SHARED_LIBRARY) |
Ying Wang | 32f0e24 | 2012-03-29 14:57:55 -0700 | [diff] [blame] | 90 | #################### Clean up the tmp vars |
Jean Chalard | a245d15 | 2013-12-12 15:08:10 +0900 | [diff] [blame] | 91 | include $(LOCAL_PATH)/CleanupNativeFileList.mk |
Yohei Yukawa | c72652c | 2014-04-02 01:23:07 +0900 | [diff] [blame^] | 92 | |
| 93 | #################### Unit test on host environment |
| 94 | include $(LOCAL_PATH)/HostUnitTests.mk |