blob: 95f767dc9ece26e47862743321f91a9a94fad69c [file] [log] [blame]
Jean Chalarde7870a22013-08-12 12:44:04 +09001#
2# Copyright (C) 2013 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Ken Wakasa344742b2014-03-07 12:37:40 +090016# HACK: Temporarily disable host tool build on Mac until the build system is ready for C++11.
17LATINIME_HOST_OSNAME := $(shell uname -s)
18ifneq ($(LATINIME_HOST_OSNAME), Darwin) # TODO: Remove this
19
Jean Chalarde7870a22013-08-12 12:44:04 +090020LOCAL_PATH := $(call my-dir)
21include $(CLEAR_VARS)
22
23# Need to define the name of the library in the caller in LATINIME_HOST_NATIVE_LIBNAME
24
25LATINIME_DIR_RELATIVE_TO_DICTTOOL := ../..
26
Jean Chalarda245d152013-12-12 15:08:10 +090027ifeq ($(FLAG_DBG), true)
28 $(warning Making debug version of native library)
29 LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline
30endif #FLAG_DBG
31
Jean Chalarde7870a22013-08-12 12:44:04 +090032ifneq ($(strip $(HOST_JDK_IS_64BIT_VERSION)),)
33LOCAL_CFLAGS += -m64
34LOCAL_LDFLAGS += -m64
35endif #HOST_JDK_IS_64BIT_VERSION
36
Jean Chalarda245d152013-12-12 15:08:10 +090037LOCAL_CFLAGS += -DHOST_TOOL -fPIC -Wno-deprecated
Jean Chalarde7870a22013-08-12 12:44:04 +090038LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
39
Ken Wakasaca0a0da2014-03-06 19:47:20 +090040# For C++11
41# TODO: Change this to -std=c++11
42LOCAL_CFLAGS += -std=gnu++0x
43
Jean Chalarde7870a22013-08-12 12:44:04 +090044LATINIME_NATIVE_JNI_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni
45LATINIME_NATIVE_SRC_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni/src
46LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(LATINIME_NATIVE_SRC_DIR)
47# Used in jni_common.cpp to avoid registering useless methods.
48
Jean Chalarda245d152013-12-12 15:08:10 +090049include $(LOCAL_PATH)/$(LATINIME_NATIVE_JNI_DIR)/NativeFileList.mk
Jean Chalarde7870a22013-08-12 12:44:04 +090050
51LOCAL_SRC_FILES := \
52 $(addprefix $(LATINIME_NATIVE_JNI_DIR)/, $(LATIN_IME_JNI_SRC_FILES)) \
53 $(addprefix $(LATINIME_NATIVE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
54
55LOCAL_MODULE := $(LATINIME_HOST_NATIVE_LIBNAME)
Ken Wakasa344742b2014-03-07 12:37:40 +090056LOCAL_IS_HOST_MODULE := true
Jean Chalarde7870a22013-08-12 12:44:04 +090057
58include $(BUILD_HOST_SHARED_LIBRARY)
59
Ken Wakasa344742b2014-03-07 12:37:40 +090060endif # Darwin - TODO: Remove this
61
Jean Chalarde7870a22013-08-12 12:44:04 +090062# Clear our private variables
Jean Chalarda245d152013-12-12 15:08:10 +090063include $(LOCAL_PATH)/$(LATINIME_NATIVE_JNI_DIR)/CleanupNativeFileList.mk
Jean Chalarde7870a22013-08-12 12:44:04 +090064LATINIME_DIR_RELATIVE_TO_DICTTOOL := ../..
Ken Wakasa344742b2014-03-07 12:37:40 +090065LATINIME_HOST_OSNAME :=