Jean Chalard | ddcb484 | 2012-05-28 17:30:18 +0900 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 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 | |
Ying Wang | ece7240 | 2014-07-29 10:46:38 -0700 | [diff] [blame] | 16 | # Only build if it's explicitly requested, or running mm/mmm. |
| 17 | ifneq ($(ONE_SHOT_MAKEFILE)$(filter $(MAKECMDGOALS),dicttool_aosp),) |
| 18 | |
Ken Wakasa | 344742b | 2014-03-07 12:37:40 +0900 | [diff] [blame] | 19 | # HACK: Temporarily disable host tool build on Mac until the build system is ready for C++11. |
| 20 | LATINIME_HOST_OSNAME := $(shell uname -s) |
Tadashi G. Takaoka | 99258cb | 2014-05-24 03:07:58 +0900 | [diff] [blame] | 21 | ifeq ($(LATINIME_HOST_OSNAME), Darwin) # TODO: Remove this |
| 22 | $(warning dicttool_aosp is not supported on $(LATINIME_HOST_OSNAME)) |
| 23 | else # TODO: Remove this |
Ken Wakasa | 344742b | 2014-03-07 12:37:40 +0900 | [diff] [blame] | 24 | |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 25 | LATINIME_DICTTOOL_AOSP_LOCAL_PATH := $(call my-dir) |
| 26 | LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH) |
| 27 | LATINIME_HOST_NATIVE_LIBNAME := liblatinime-aosp-dicttool-host |
| 28 | include $(LOCAL_PATH)/NativeLib.mk |
| 29 | |
| 30 | ###################################### |
| 31 | LOCAL_PATH := $(LATINIME_DICTTOOL_AOSP_LOCAL_PATH) |
Jean Chalard | ddcb484 | 2012-05-28 17:30:18 +0900 | [diff] [blame] | 32 | include $(CLEAR_VARS) |
| 33 | |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 34 | LATINIME_LOCAL_DIR := ../.. |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 35 | LATINIME_BASE_SRC_DIR := $(LATINIME_LOCAL_DIR)/java/src/com/android/inputmethod |
| 36 | LATINIME_BASE_OVERRIDABLE_SRC_DIR := \ |
| 37 | $(LATINIME_LOCAL_DIR)/java-overridable/src/com/android/inputmethod |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 38 | MAKEDICT_CORE_SRC_DIR := $(LATINIME_BASE_SRC_DIR)/latin/makedict |
| 39 | LATINIME_TESTS_SRC_DIR := $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin |
Jean Chalard | a245d15 | 2013-12-12 15:08:10 +0900 | [diff] [blame] | 40 | |
| 41 | # Dependencies for Dicttool. Most of these files are needed by BinaryDictionary.java. Note that |
| 42 | # a significant part of the dependencies are mocked in the compat/ directory, with empty or |
| 43 | # nearly-empty implementations, for parts that we don't use in Dicttool. |
Ken Wakasa | 96092eb | 2014-03-27 19:11:12 +0900 | [diff] [blame] | 44 | LATINIME_SRC_FILES_FOR_DICTTOOL := \ |
Jean Chalard | 7ede642 | 2014-03-14 22:50:20 +0900 | [diff] [blame] | 45 | event/Combiner.java \ |
Jean Chalard | f8accd8 | 2014-03-13 17:37:16 +0900 | [diff] [blame] | 46 | event/Event.java \ |
| 47 | latin/BinaryDictionary.java \ |
| 48 | latin/DicTraverseSession.java \ |
| 49 | latin/Dictionary.java \ |
| 50 | latin/InputPointers.java \ |
| 51 | latin/LastComposedWord.java \ |
Keisuke Kuroyanagi | bb0eca5 | 2014-09-29 10:52:18 +0900 | [diff] [blame] | 52 | latin/NgramContext.java \ |
Jean Chalard | f8accd8 | 2014-03-13 17:37:16 +0900 | [diff] [blame] | 53 | latin/SuggestedWords.java \ |
| 54 | latin/WordComposer.java \ |
| 55 | latin/settings/NativeSuggestOptions.java \ |
Keisuke Kuroyanagi | b8a9479 | 2014-07-08 16:36:06 +0900 | [diff] [blame] | 56 | latin/settings/SettingsValuesForSuggestion.java \ |
Jean Chalard | f8accd8 | 2014-03-13 17:37:16 +0900 | [diff] [blame] | 57 | latin/utils/BinaryDictionaryUtils.java \ |
Jean Chalard | f8accd8 | 2014-03-13 17:37:16 +0900 | [diff] [blame] | 58 | latin/utils/CombinedFormatUtils.java \ |
| 59 | latin/utils/CoordinateUtils.java \ |
| 60 | latin/utils/FileUtils.java \ |
| 61 | latin/utils/JniUtils.java \ |
| 62 | latin/utils/LocaleUtils.java \ |
| 63 | latin/utils/ResizableIntArray.java \ |
| 64 | latin/utils/StringUtils.java |
Keisuke Kuroyanagi | 93cda5b | 2014-03-27 15:30:32 +0900 | [diff] [blame] | 65 | |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 66 | LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL := \ |
| 67 | latin/define/DebugFlags.java |
| 68 | |
Ken Wakasa | 96092eb | 2014-03-27 19:11:12 +0900 | [diff] [blame] | 69 | LATINIME_TEST_SRC_FILES_FOR_DICTTOOL := \ |
Keisuke Kuroyanagi | 93cda5b | 2014-03-27 15:30:32 +0900 | [diff] [blame] | 70 | utils/ByteArrayDictBuffer.java |
| 71 | |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 72 | USED_TARGETED_SRC_FILES := \ |
| 73 | $(addprefix $(LATINIME_BASE_SRC_DIR)/, $(LATINIME_SRC_FILES_FOR_DICTTOOL)) \ |
| 74 | $(addprefix $(LATINIME_BASE_OVERRIDABLE_SRC_DIR)/, \ |
| 75 | $(LATINIME_OVERRIDABLE_SRC_FILES_FOR_DICTTOOL)) \ |
| 76 | $(addprefix $(LATINIME_TESTS_SRC_DIR)/, $(LATINIME_TEST_SRC_FILES_FOR_DICTTOOL)) |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 77 | |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 78 | DICTTOOL_ONDEVICE_TESTS_DIR := \ |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 79 | $(LATINIME_LOCAL_DIR)/tests/src/com/android/inputmethod/latin/makedict/ |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 80 | DICTTOOL_COMPAT_TESTS_DIR := compat |
Jean Chalard | 54e84a0 | 2012-08-03 17:05:41 +0900 | [diff] [blame] | 81 | |
Ken Wakasa | fb74ab1 | 2014-08-16 02:34:53 +0900 | [diff] [blame] | 82 | LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SRC_DIR)) |
Ken Wakasa | 02996dc | 2012-11-29 19:09:01 +0900 | [diff] [blame] | 83 | LOCAL_TOOL_SRC_FILES := $(call all-java-files-under, src) |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 84 | |
Jean Chalard | 54e84a0 | 2012-08-03 17:05:41 +0900 | [diff] [blame] | 85 | LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \ |
| 86 | $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \ |
Ken Wakasa | b11fc7d | 2014-10-22 21:29:46 +0900 | [diff] [blame] | 87 | $(USED_TARGETED_SRC_FILES) \ |
| 88 | $(call all-java-files-under, \ |
| 89 | tests $(DICTTOOL_COMPAT_TESTS_DIR) $(DICTTOOL_ONDEVICE_TESTS_DIR)) |
Ken Wakasa | 60af4f0 | 2012-09-10 12:56:10 +0900 | [diff] [blame] | 90 | |
Jean Chalard | d055cca | 2012-08-27 14:51:57 +0900 | [diff] [blame] | 91 | LOCAL_JAVA_LIBRARIES := junit |
Ken Wakasa | 54a1b8e | 2014-10-22 18:24:44 +0900 | [diff] [blame] | 92 | LOCAL_STATIC_JAVA_LIBRARIES := jsr305lib latinime-common-host |
Ying Wang | fb57fe2 | 2014-06-09 12:16:30 -0700 | [diff] [blame] | 93 | LOCAL_REQUIRED_MODULES := $(LATINIME_HOST_NATIVE_LIBNAME) |
Jean Chalard | ddcb484 | 2012-05-28 17:30:18 +0900 | [diff] [blame] | 94 | LOCAL_JAR_MANIFEST := etc/manifest.txt |
Jean Chalard | 4c573f3 | 2012-08-08 17:15:58 +0900 | [diff] [blame] | 95 | LOCAL_MODULE := dicttool_aosp |
Jean Chalard | ddcb484 | 2012-05-28 17:30:18 +0900 | [diff] [blame] | 96 | |
| 97 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 98 | include $(LOCAL_PATH)/etc/Android.mk |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 99 | |
Ken Wakasa | 344742b | 2014-03-07 12:37:40 +0900 | [diff] [blame] | 100 | endif # Darwin - TODO: Remove this |
| 101 | |
Jean Chalard | e7870a2 | 2013-08-12 12:44:04 +0900 | [diff] [blame] | 102 | # Clear our private variables |
| 103 | LATINIME_DICTTOOL_AOSP_LOCAL_PATH := |
| 104 | LATINIME_LOCAL_DIR := |
Ken Wakasa | 344742b | 2014-03-07 12:37:40 +0900 | [diff] [blame] | 105 | LATINIME_HOST_OSNAME := |
Ying Wang | ece7240 | 2014-07-29 10:46:38 -0700 | [diff] [blame] | 106 | |
| 107 | endif |