blob: 5c117cea9aad4cfd90b239c992469d6dcd0cfbbe [file] [log] [blame]
Ken Wakasad5e35ac2011-12-13 19:46:15 +09001# 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)
Ying Wang32f0e242012-03-29 14:57:55 -070016
17############ some local flags
Ken Wakasae3f26dd2012-07-27 18:06:06 +090018# 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 Kataoka3ffaf392012-06-29 12:53:34 +090020FLAG_DBG ?= false
satok1035bc92012-06-13 16:07:54 -070021FLAG_DO_PROFILE ?= false
Ying Wang32f0e242012-03-29 14:57:55 -070022
Ying Wang32f0e242012-03-29 14:57:55 -070023######################################
Ken Wakasad5e35ac2011-12-13 19:46:15 +090024include $(CLEAR_VARS)
25
Ken Wakasa3ef3e242012-03-30 09:53:51 +090026LATIN_IME_SRC_DIR := src
Ken Wakasad5e35ac2011-12-13 19:46:15 +090027
Ken Wakasa31f42ba2013-04-08 20:22:37 +090028LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR)
Ken Wakasad5e35ac2011-12-13 19:46:15 +090029
Ken Wakasa6e663492012-11-03 02:50:47 +090030LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \
Ken Wakasaabe3a352013-12-18 23:29:35 +090031 -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \
Ken Wakasa46b6f602014-03-18 12:09:10 +090032 -Woverloaded-virtual -Wsign-promo -Wno-system-headers
Ken Wakasaf775bf32012-11-07 07:52:34 +090033
Ken Wakasad5e35ac2011-12-13 19:46:15 +090034# To suppress compiler warnings for unused variables/functions used for debug features etc.
35LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
36
Jean Chalarda245d152013-12-12 15:08:10 +090037include $(LOCAL_PATH)/NativeFileList.mk
Ken Wakasa8658e552012-06-30 08:53:33 +090038
Ken Wakasad5e35ac2011-12-13 19:46:15 +090039LOCAL_SRC_FILES := \
40 $(LATIN_IME_JNI_SRC_FILES) \
Ken Wakasa0336ec42012-07-02 23:52:35 +090041 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
Ken Wakasa8fcd7692012-06-28 21:47:11 +090042
43ifeq ($(FLAG_DO_PROFILE), true)
44 $(warning Making profiling version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090045 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline
Ken Wakasa8fcd7692012-06-28 21:47:11 +090046else # FLAG_DO_PROFILE
47ifeq ($(FLAG_DBG), true)
48 $(warning Making debug version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090049 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
Ken Wakasaccebd5c2013-01-09 15:21:44 +090050ifeq ($(FLAG_FULL_DBG), true)
51 $(warning Making full debug version of native library)
52 LOCAL_CFLAGS += -DFLAG_FULL_DBG
53endif # FLAG_FULL_DBG
Ken Wakasa8fcd7692012-06-28 21:47:11 +090054endif # FLAG_DBG
55endif # FLAG_DO_PROFILE
56
Ken Wakasa8658e552012-06-30 08:53:33 +090057LOCAL_MODULE := libjni_latinime_common_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090058LOCAL_MODULE_TAGS := optional
59
Ken Wakasa46b6f602014-03-18 12:09:10 +090060LOCAL_CLANG := true
Ken Wakasaf52c1c52012-07-06 15:53:51 +090061LOCAL_SDK_VERSION := 14
Ken Wakasa46b6f602014-03-18 12:09:10 +090062LOCAL_NDK_STL_VARIANT := c++_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090063
64include $(BUILD_STATIC_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070065######################################
66include $(CLEAR_VARS)
67
68# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
Satoshi Kataokadeb09872012-07-03 17:45:50 +090069LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090070
Ying Wang32f0e242012-03-29 14:57:55 -070071ifeq ($(FLAG_DO_PROFILE), true)
72 $(warning Making profiling version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090073 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070074else # FLAG_DO_PROFILE
75ifeq ($(FLAG_DBG), true)
76 $(warning Making debug version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090077 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070078endif # FLAG_DBG
79endif # FLAG_DO_PROFILE
Ken Wakasad5e35ac2011-12-13 19:46:15 +090080
Ken Wakasad5e35ac2011-12-13 19:46:15 +090081LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -080082LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +090083
Ken Wakasa46b6f602014-03-18 12:09:10 +090084LOCAL_CLANG := true
Ken Wakasaf52c1c52012-07-06 15:53:51 +090085LOCAL_SDK_VERSION := 14
Ken Wakasa46b6f602014-03-18 12:09:10 +090086LOCAL_NDK_STL_VARIANT := c++_static
Andrew Hsieh5fe05eb2012-12-21 09:25:56 +080087LOCAL_LDFLAGS += -ldl
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090088
Ken Wakasad5e35ac2011-12-13 19:46:15 +090089include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070090#################### Clean up the tmp vars
Jean Chalarda245d152013-12-12 15:08:10 +090091include $(LOCAL_PATH)/CleanupNativeFileList.mk
Yohei Yukawac72652c2014-04-02 01:23:07 +090092
93#################### Unit test on host environment
94include $(LOCAL_PATH)/HostUnitTests.mk