blob: 7827db302ccf9bf59b34e85969620b74cbbcb6aa [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 Wakasaf775bf32012-11-07 07:52:34 +090031 -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls -Wno-system-headers
32
33ifeq ($(TARGET_ARCH), arm)
Ben Chengc2fbd7c2013-04-03 16:59:29 -070034ifeq ($(TARGET_GCC_VERSION), 4.6)
Ken Wakasaf775bf32012-11-07 07:52:34 +090035LOCAL_CFLAGS += -Winline
Ken Wakasa249a6142012-11-20 10:24:32 +090036endif # TARGET_GCC_VERSION
37endif # TARGET_ARCH
Ken Wakasad5e35ac2011-12-13 19:46:15 +090038
39# To suppress compiler warnings for unused variables/functions used for debug features etc.
40LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
41
Jean Chalarda245d152013-12-12 15:08:10 +090042include $(LOCAL_PATH)/NativeFileList.mk
Ken Wakasa8658e552012-06-30 08:53:33 +090043
Ken Wakasad5e35ac2011-12-13 19:46:15 +090044LOCAL_SRC_FILES := \
45 $(LATIN_IME_JNI_SRC_FILES) \
Ken Wakasa0336ec42012-07-02 23:52:35 +090046 $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
Ken Wakasa8fcd7692012-06-28 21:47:11 +090047
48ifeq ($(FLAG_DO_PROFILE), true)
49 $(warning Making profiling version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090050 LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -fno-inline
Ken Wakasa8fcd7692012-06-28 21:47:11 +090051else # FLAG_DO_PROFILE
52ifeq ($(FLAG_DBG), true)
53 $(warning Making debug version of native library)
Ken Wakasa6cee61d2013-01-15 16:15:48 +090054 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
Ken Wakasaccebd5c2013-01-09 15:21:44 +090055ifeq ($(FLAG_FULL_DBG), true)
56 $(warning Making full debug version of native library)
57 LOCAL_CFLAGS += -DFLAG_FULL_DBG
58endif # FLAG_FULL_DBG
Ken Wakasa8fcd7692012-06-28 21:47:11 +090059endif # FLAG_DBG
60endif # FLAG_DO_PROFILE
61
Ken Wakasa8658e552012-06-30 08:53:33 +090062LOCAL_MODULE := libjni_latinime_common_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090063LOCAL_MODULE_TAGS := optional
64
Ken Wakasaf52c1c52012-07-06 15:53:51 +090065LOCAL_SDK_VERSION := 14
66LOCAL_NDK_STL_VARIANT := stlport_static
Ken Wakasa8fcd7692012-06-28 21:47:11 +090067
68include $(BUILD_STATIC_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070069######################################
70include $(CLEAR_VARS)
71
72# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library.
Satoshi Kataokadeb09872012-07-03 17:45:50 +090073LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090074
Ying Wang32f0e242012-03-29 14:57:55 -070075ifeq ($(FLAG_DO_PROFILE), true)
76 $(warning Making profiling version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090077 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070078else # FLAG_DO_PROFILE
79ifeq ($(FLAG_DBG), true)
80 $(warning Making debug version of native library)
Ken Wakasab543c9c2012-11-27 12:17:42 +090081 LOCAL_LDFLAGS += -llog
Ying Wang32f0e242012-03-29 14:57:55 -070082endif # FLAG_DBG
83endif # FLAG_DO_PROFILE
Ken Wakasad5e35ac2011-12-13 19:46:15 +090084
Ken Wakasad5e35ac2011-12-13 19:46:15 +090085LOCAL_MODULE := libjni_latinime
Jean-Baptiste Queru11c41212012-01-23 09:06:00 -080086LOCAL_MODULE_TAGS := optional
Ken Wakasad5e35ac2011-12-13 19:46:15 +090087
Ken Wakasaf52c1c52012-07-06 15:53:51 +090088LOCAL_SDK_VERSION := 14
89LOCAL_NDK_STL_VARIANT := stlport_static
Andrew Hsieh5fe05eb2012-12-21 09:25:56 +080090LOCAL_LDFLAGS += -ldl
Ken Wakasa0c1a3ec2012-03-31 05:07:32 +090091
Ken Wakasad5e35ac2011-12-13 19:46:15 +090092include $(BUILD_SHARED_LIBRARY)
Ying Wang32f0e242012-03-29 14:57:55 -070093
94#################### Clean up the tmp vars
Jean Chalarda245d152013-12-12 15:08:10 +090095include $(LOCAL_PATH)/CleanupNativeFileList.mk