blob: 402cb3b677a4f13f734077b6aa7eef64628f351e [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
Ken Wakasa81a48d42014-07-15 20:13:05 +090037# HACK: -mstackrealign is required for x86 builds running on pre-KitKat devices to avoid crashes
38# with SSE instructions.
39ifeq ($(TARGET_ARCH), x86)
40 LOCAL_CFLAGS += -mstackrealign
41endif # x86
42
Jean Chalarda245d152013-12-12 15:08:10 +090043include $(LOCAL_PATH)/NativeFileList.mk
Ken Wakasa8658e552012-06-30 08:53:33 +090044
Ken Wakasad5e35ac2011-12-13 19:46:15 +090045LOCAL_SRC_FILES := \
46 $(LATIN_IME_JNI_SRC_FILES) \
Ken Wakasa0336ec42012-07-02 23:52:35 +090047 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
Ken Wakasa8fcd7692012-06-28 21:47:11 +090048
49ifeq ($(FLAG_DO_PROFILE), true)
50 $(warning Making profiling version of native library)
Keisuke Kuroyanagi3da610d2014-10-03 18:16:19 +090051 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables
Ken Wakasa8fcd7692012-06-28 21:47:11 +090052else # FLAG_DO_PROFILE
53ifeq ($(FLAG_DBG), true)
54 $(warning Making debug version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090055 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
Ken Wakasaccebd5c2013-01-09 15:21:44 +090056ifeq ($(FLAG_FULL_DBG), true)
57 $(warning Making full debug version of native library)
58 LOCAL_CFLAGS += -DFLAG_FULL_DBG
59endif # FLAG_FULL_DBG
Ken Wakasa8fcd7692012-06-28 21:47:11 +090060endif # FLAG_DBG
61endif # FLAG_DO_PROFILE
62
Ken Wakasa8658e552012-06-30 08:53:33 +090063LOCAL_MODULE := libjni_latinime_common_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090064LOCAL_MODULE_TAGS := optional
65
Ken Wakasa46b6f602014-03-18 12:09:10 +090066LOCAL_CLANG := true
Ken Wakasaf52c1c52012-07-06 15:53:51 +090067LOCAL_SDK_VERSION := 14
Ken Wakasa46b6f602014-03-18 12:09:10 +090068LOCAL_NDK_STL_VARIANT := c++_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090069
70include $(BUILD_STATIC_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070071######################################
72include $(CLEAR_VARS)
73
74# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
Satoshi Kataokadeb09872012-07-03 17:45:50 +090075LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090076
Ying Wang32f0e242012-03-29 14:57:55 -070077ifeq ($(FLAG_DO_PROFILE), true)
78 $(warning Making profiling version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090079 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070080else # FLAG_DO_PROFILE
81ifeq ($(FLAG_DBG), true)
82 $(warning Making debug version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090083 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070084endif # FLAG_DBG
85endif # FLAG_DO_PROFILE
Ken Wakasad5e35ac2011-12-13 19:46:15 +090086
Ken Wakasad5e35ac2011-12-13 19:46:15 +090087LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -080088LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +090089
Ken Wakasa46b6f602014-03-18 12:09:10 +090090LOCAL_CLANG := true
Ken Wakasaf52c1c52012-07-06 15:53:51 +090091LOCAL_SDK_VERSION := 14
Ken Wakasa46b6f602014-03-18 12:09:10 +090092LOCAL_NDK_STL_VARIANT := c++_static
Stephen Hines5a289ed2014-07-23 19:58:17 -070093LOCAL_LDFLAGS += -ldl
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090094
Ken Wakasa64d3f782014-11-17 18:29:13 +090095# TODO: Figure out what we should do with --hash-style=gnu for unbundled builds
96LOCAL_LDFLAGS += -Wl,--hash-style=sysv
97
Ken Wakasad5e35ac2011-12-13 19:46:15 +090098include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070099#################### Clean up the tmp vars
Jean Chalarda245d152013-12-12 15:08:10 +0900100include $(LOCAL_PATH)/CleanupNativeFileList.mk
Yohei Yukawac72652c2014-04-02 01:23:07 +0900101
102#################### Unit test on host environment
103include $(LOCAL_PATH)/HostUnitTests.mk
Yohei Yukawa7f4cca02014-06-20 16:26:13 +0900104
105#################### Unit test on target environment
106include $(LOCAL_PATH)/TargetUnitTests.mk