Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 1 | # Copyright (C) 2017 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 | |
Alex Salcianu | 8914de9 | 2017-03-20 11:40:48 -0400 | [diff] [blame] | 15 | # Useful environment variables that can be set on the mmma command line, as |
| 16 | # <key>=<value> pairs: |
| 17 | # |
| 18 | # LIBTEXTCLASSIFIER_STRIP_OPTS: (optional) value for LOCAL_STRIP_MODULE (for all |
| 19 | # modules we build). NOT for prod builds. Can be set to keep_symbols for |
| 20 | # debug / treemap purposes. |
| 21 | |
| 22 | |
| 23 | LOCAL_PATH := $(call my-dir) |
| 24 | |
| 25 | # Custom C/C++ compilation flags: |
| 26 | MY_LIBTEXTCLASSIFIER_CFLAGS := \ |
| 27 | -Wno-unused-parameter \ |
| 28 | -Wno-sign-compare \ |
| 29 | -Wno-missing-field-initializers \ |
| 30 | -Wno-ignored-qualifiers \ |
Alex Salcianu | a43c726 | 2017-03-21 10:41:18 -0400 | [diff] [blame] | 31 | -Wno-undefined-var-template \ |
| 32 | -fvisibility=hidden |
Alex Salcianu | 8914de9 | 2017-03-20 11:40:48 -0400 | [diff] [blame] | 33 | |
Matt Sharifi | 44742a4 | 2017-04-24 17:09:49 +0200 | [diff] [blame^] | 34 | # Only enable debug logging in userdebug/eng builds. |
| 35 | ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) |
| 36 | MY_LIBTEXTCLASSIFIER_CFLAGS += -DTC_DEBUG_LOGGING=1 |
| 37 | endif |
| 38 | |
Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 39 | # ------------------------ |
| 40 | # libtextclassifier_protos |
| 41 | # ------------------------ |
| 42 | |
Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 43 | include $(CLEAR_VARS) |
| 44 | |
| 45 | LOCAL_MODULE := libtextclassifier_protos |
| 46 | |
Alex Salcianu | 8914de9 | 2017-03-20 11:40:48 -0400 | [diff] [blame] | 47 | LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS) |
| 48 | |
Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 49 | LOCAL_SRC_FILES := $(call all-proto-files-under, .) |
| 50 | LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite |
| 51 | |
| 52 | include $(BUILD_STATIC_LIBRARY) |
| 53 | |
| 54 | # ----------------- |
| 55 | # libtextclassifier |
| 56 | # ----------------- |
| 57 | |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 58 | include $(CLEAR_VARS) |
| 59 | LOCAL_MODULE := libtextclassifier |
| 60 | |
| 61 | proto_sources_dir := $(generated_sources_dir) |
| 62 | |
| 63 | LOCAL_CPP_EXTENSION := .cc |
Alex Salcianu | 8914de9 | 2017-03-20 11:40:48 -0400 | [diff] [blame] | 64 | LOCAL_CFLAGS += $(MY_LIBTEXTCLASSIFIER_CFLAGS) |
| 65 | LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS) |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 66 | |
Dan Willemsen | e595407 | 2017-03-29 21:54:57 -0700 | [diff] [blame] | 67 | LOCAL_SRC_FILES := $(filter-out tests/%,$(call all-subdir-cpp-files)) |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 68 | LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier |
Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 69 | |
Alex Salcianu | 29fc69f | 2017-03-22 18:27:33 -0400 | [diff] [blame] | 70 | LOCAL_STATIC_LIBRARIES += libtextclassifier_protos |
Lukas Zilka | d3bc59a | 2017-04-03 17:32:27 +0200 | [diff] [blame] | 71 | LOCAL_STATIC_LIBRARIES += libprotobuf-cpp-lite |
Alex Salcianu | 29fc69f | 2017-03-22 18:27:33 -0400 | [diff] [blame] | 72 | LOCAL_SHARED_LIBRARIES += liblog |
Lukas Zilka | d3bc59a | 2017-04-03 17:32:27 +0200 | [diff] [blame] | 73 | LOCAL_SHARED_LIBRARIES += libicuuc libicui18n |
Abodunrinwa Toki | 61f99dd | 2017-03-14 18:16:15 +0000 | [diff] [blame] | 74 | LOCAL_REQUIRED_MODULES := textclassifier.langid.model |
Abodunrinwa Toki | 72282c6 | 2017-03-15 19:30:31 +0000 | [diff] [blame] | 75 | LOCAL_REQUIRED_MODULES += textclassifier.smartselection.en.model |
Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 76 | |
Dan Willemsen | e595407 | 2017-03-29 21:54:57 -0700 | [diff] [blame] | 77 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/jni.lds |
| 78 | LOCAL_LDFLAGS += -Wl,-version-script=$(LOCAL_PATH)/jni.lds |
Alex Salcianu | 5fc7e54 | 2017-03-24 16:54:05 -0400 | [diff] [blame] | 79 | |
Matt Sharifi | bda09f1 | 2017-03-10 12:29:15 +0100 | [diff] [blame] | 80 | include $(BUILD_SHARED_LIBRARY) |
Abodunrinwa Toki | 61f99dd | 2017-03-14 18:16:15 +0000 | [diff] [blame] | 81 | |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 82 | # ----------------------- |
| 83 | # libtextclassifier_tests |
| 84 | # ----------------------- |
| 85 | |
| 86 | include $(CLEAR_VARS) |
| 87 | |
| 88 | LOCAL_MODULE := libtextclassifier_tests |
| 89 | LOCAL_MODULE_TAGS := tests |
| 90 | |
| 91 | LOCAL_CPP_EXTENSION := .cc |
Alex Salcianu | 8914de9 | 2017-03-20 11:40:48 -0400 | [diff] [blame] | 92 | LOCAL_CFLAGS += $(MY_LIBTEXTCLASSIFIER_CFLAGS) |
| 93 | LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS) |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 94 | |
| 95 | LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, tests/testdata) |
| 96 | |
Matt Sharifi | be876dc | 2017-03-17 17:02:43 +0100 | [diff] [blame] | 97 | LOCAL_CPPFLAGS_32 += -DTEST_DATA_DIR="\"/data/nativetest/libtextclassifier_tests/tests/testdata/\"" |
| 98 | LOCAL_CPPFLAGS_64 += -DTEST_DATA_DIR="\"/data/nativetest64/libtextclassifier_tests/tests/testdata/\"" |
| 99 | |
Dan Willemsen | e595407 | 2017-03-29 21:54:57 -0700 | [diff] [blame] | 100 | LOCAL_SRC_FILES := $(call all-subdir-cpp-files) |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 101 | LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier |
| 102 | |
Alex Salcianu | 29fc69f | 2017-03-22 18:27:33 -0400 | [diff] [blame] | 103 | LOCAL_STATIC_LIBRARIES += libtextclassifier_protos libgmock |
| 104 | LOCAL_SHARED_LIBRARIES += libprotobuf-cpp-lite |
| 105 | LOCAL_SHARED_LIBRARIES += liblog |
Lukas Zilka | d3bc59a | 2017-04-03 17:32:27 +0200 | [diff] [blame] | 106 | LOCAL_SHARED_LIBRARIES += libicuuc libicui18n |
Matt Sharifi | d40f976 | 2017-03-14 21:24:23 +0100 | [diff] [blame] | 107 | |
| 108 | include $(BUILD_NATIVE_TEST) |
| 109 | |
Abodunrinwa Toki | 61f99dd | 2017-03-14 18:16:15 +0000 | [diff] [blame] | 110 | # ------------ |
| 111 | # LangId model |
| 112 | # ------------ |
| 113 | |
| 114 | include $(CLEAR_VARS) |
| 115 | LOCAL_MODULE := textclassifier.langid.model |
| 116 | LOCAL_MODULE_CLASS := ETC |
Abodunrinwa Toki | 61f99dd | 2017-03-14 18:16:15 +0000 | [diff] [blame] | 117 | LOCAL_MODULE_OWNER := google |
| 118 | LOCAL_SRC_FILES := ./models/textclassifier.langid.model |
| 119 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 120 | include $(BUILD_PREBUILT) |
| 121 | |
| 122 | # ---------------------- |
| 123 | # Smart Selection models |
| 124 | # ---------------------- |
| 125 | |
| 126 | include $(CLEAR_VARS) |
Abodunrinwa Toki | e7c5886 | 2017-04-05 13:29:25 +0100 | [diff] [blame] | 127 | LOCAL_MODULE := textclassifier.smartselection.ar.model |
| 128 | LOCAL_MODULE_CLASS := ETC |
| 129 | LOCAL_MODULE_OWNER := google |
| 130 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ar.model |
| 131 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 132 | include $(BUILD_PREBUILT) |
| 133 | |
| 134 | include $(CLEAR_VARS) |
| 135 | LOCAL_MODULE := textclassifier.smartselection.de.model |
| 136 | LOCAL_MODULE_CLASS := ETC |
| 137 | LOCAL_MODULE_OWNER := google |
| 138 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.de.model |
| 139 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 140 | include $(BUILD_PREBUILT) |
| 141 | |
| 142 | include $(CLEAR_VARS) |
Abodunrinwa Toki | 61f99dd | 2017-03-14 18:16:15 +0000 | [diff] [blame] | 143 | LOCAL_MODULE := textclassifier.smartselection.en.model |
| 144 | LOCAL_MODULE_CLASS := ETC |
Abodunrinwa Toki | e7c5886 | 2017-04-05 13:29:25 +0100 | [diff] [blame] | 145 | LOCAL_MODULE_OWNER := google |
Abodunrinwa Toki | 61f99dd | 2017-03-14 18:16:15 +0000 | [diff] [blame] | 146 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.en.model |
| 147 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 148 | include $(BUILD_PREBUILT) |
Abodunrinwa Toki | e7c5886 | 2017-04-05 13:29:25 +0100 | [diff] [blame] | 149 | |
| 150 | include $(CLEAR_VARS) |
| 151 | LOCAL_MODULE := textclassifier.smartselection.es.model |
| 152 | LOCAL_MODULE_CLASS := ETC |
| 153 | LOCAL_MODULE_OWNER := google |
| 154 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.es.model |
| 155 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 156 | include $(BUILD_PREBUILT) |
| 157 | |
| 158 | include $(CLEAR_VARS) |
| 159 | LOCAL_MODULE := textclassifier.smartselection.fr.model |
| 160 | LOCAL_MODULE_CLASS := ETC |
| 161 | LOCAL_MODULE_OWNER := google |
| 162 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.fr.model |
| 163 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 164 | include $(BUILD_PREBUILT) |
| 165 | |
| 166 | include $(CLEAR_VARS) |
| 167 | LOCAL_MODULE := textclassifier.smartselection.it.model |
| 168 | LOCAL_MODULE_CLASS := ETC |
| 169 | LOCAL_MODULE_OWNER := google |
| 170 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.it.model |
| 171 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 172 | include $(BUILD_PREBUILT) |
| 173 | |
| 174 | include $(CLEAR_VARS) |
| 175 | LOCAL_MODULE := textclassifier.smartselection.ja.model |
| 176 | LOCAL_MODULE_CLASS := ETC |
| 177 | LOCAL_MODULE_OWNER := google |
| 178 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ja.model |
| 179 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 180 | include $(BUILD_PREBUILT) |
| 181 | |
| 182 | include $(CLEAR_VARS) |
| 183 | LOCAL_MODULE := textclassifier.smartselection.ko.model |
| 184 | LOCAL_MODULE_CLASS := ETC |
| 185 | LOCAL_MODULE_OWNER := google |
| 186 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ko.model |
| 187 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 188 | include $(BUILD_PREBUILT) |
| 189 | |
| 190 | include $(CLEAR_VARS) |
| 191 | LOCAL_MODULE := textclassifier.smartselection.nl.model |
| 192 | LOCAL_MODULE_CLASS := ETC |
| 193 | LOCAL_MODULE_OWNER := google |
| 194 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.nl.model |
| 195 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 196 | include $(BUILD_PREBUILT) |
| 197 | |
| 198 | include $(CLEAR_VARS) |
| 199 | LOCAL_MODULE := textclassifier.smartselection.pl.model |
| 200 | LOCAL_MODULE_CLASS := ETC |
| 201 | LOCAL_MODULE_OWNER := google |
| 202 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.pl.model |
| 203 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 204 | include $(BUILD_PREBUILT) |
| 205 | |
| 206 | include $(CLEAR_VARS) |
| 207 | LOCAL_MODULE := textclassifier.smartselection.pt-PT.model |
| 208 | LOCAL_MODULE_CLASS := ETC |
| 209 | LOCAL_MODULE_OWNER := google |
| 210 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.pt-PT.model |
| 211 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 212 | include $(BUILD_PREBUILT) |
| 213 | |
| 214 | include $(CLEAR_VARS) |
| 215 | LOCAL_MODULE := textclassifier.smartselection.ru.model |
| 216 | LOCAL_MODULE_CLASS := ETC |
| 217 | LOCAL_MODULE_OWNER := google |
| 218 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ru.model |
| 219 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 220 | include $(BUILD_PREBUILT) |
| 221 | |
| 222 | include $(CLEAR_VARS) |
| 223 | LOCAL_MODULE := textclassifier.smartselection.th.model |
| 224 | LOCAL_MODULE_CLASS := ETC |
| 225 | LOCAL_MODULE_OWNER := google |
| 226 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.th.model |
| 227 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 228 | include $(BUILD_PREBUILT) |
| 229 | |
| 230 | include $(CLEAR_VARS) |
| 231 | LOCAL_MODULE := textclassifier.smartselection.tr.model |
| 232 | LOCAL_MODULE_CLASS := ETC |
| 233 | LOCAL_MODULE_OWNER := google |
| 234 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.tr.model |
| 235 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 236 | include $(BUILD_PREBUILT) |
| 237 | |
| 238 | include $(CLEAR_VARS) |
| 239 | LOCAL_MODULE := textclassifier.smartselection.zh-Hant.model |
| 240 | LOCAL_MODULE_CLASS := ETC |
| 241 | LOCAL_MODULE_OWNER := google |
| 242 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.zh-Hant.model |
| 243 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 244 | include $(BUILD_PREBUILT) |
| 245 | |
| 246 | include $(CLEAR_VARS) |
| 247 | LOCAL_MODULE := textclassifier.smartselection.zh.model |
| 248 | LOCAL_MODULE_CLASS := ETC |
| 249 | LOCAL_MODULE_OWNER := google |
| 250 | LOCAL_SRC_FILES := ./models/textclassifier.smartselection.zh.model |
| 251 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier |
| 252 | include $(BUILD_PREBUILT) |
| 253 | |
| 254 | # ----------------------- |
| 255 | # Smart Selection bundles |
| 256 | # ----------------------- |
| 257 | |
| 258 | include $(CLEAR_VARS) |
| 259 | LOCAL_MODULE := textclassifier.smartselection.bundle1 |
| 260 | LOCAL_REQUIRED_MODULES := textclassifier.smartselection.en.model |
| 261 | LOCAL_REQUIRED_MODULES += textclassifier.smartselection.es.model |
| 262 | LOCAL_REQUIRED_MODULES += textclassifier.smartselection.de.model |
| 263 | LOCAL_REQUIRED_MODULES += textclassifier.smartselection.fr.model |
| 264 | include $(BUILD_STATIC_LIBRARY) |