blob: 13c78911a14e6d129beebef830e46c1cc35698d5 [file] [log] [blame]
Matt Sharifibda09f12017-03-10 12:29:15 +01001# 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 Salcianu8914de92017-03-20 11:40:48 -040015# 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
23LOCAL_PATH := $(call my-dir)
24
25# Custom C/C++ compilation flags:
26MY_LIBTEXTCLASSIFIER_CFLAGS := \
27 -Wno-unused-parameter \
28 -Wno-sign-compare \
29 -Wno-missing-field-initializers \
30 -Wno-ignored-qualifiers \
Alex Salcianua43c7262017-03-21 10:41:18 -040031 -Wno-undefined-var-template \
32 -fvisibility=hidden
Alex Salcianu8914de92017-03-20 11:40:48 -040033
Matt Sharifi44742a42017-04-24 17:09:49 +020034# Only enable debug logging in userdebug/eng builds.
35ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
36 MY_LIBTEXTCLASSIFIER_CFLAGS += -DTC_DEBUG_LOGGING=1
37endif
38
Matt Sharifibda09f12017-03-10 12:29:15 +010039# ------------------------
40# libtextclassifier_protos
41# ------------------------
42
Matt Sharifibda09f12017-03-10 12:29:15 +010043include $(CLEAR_VARS)
44
45LOCAL_MODULE := libtextclassifier_protos
46
Alex Salcianu8914de92017-03-20 11:40:48 -040047LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS)
48
Matt Sharifibda09f12017-03-10 12:29:15 +010049LOCAL_SRC_FILES := $(call all-proto-files-under, .)
50LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
51
52include $(BUILD_STATIC_LIBRARY)
53
54# -----------------
55# libtextclassifier
56# -----------------
57
Matt Sharifid40f9762017-03-14 21:24:23 +010058include $(CLEAR_VARS)
59LOCAL_MODULE := libtextclassifier
60
61proto_sources_dir := $(generated_sources_dir)
62
63LOCAL_CPP_EXTENSION := .cc
Alex Salcianu8914de92017-03-20 11:40:48 -040064LOCAL_CFLAGS += $(MY_LIBTEXTCLASSIFIER_CFLAGS)
65LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS)
Matt Sharifid40f9762017-03-14 21:24:23 +010066
Dan Willemsene5954072017-03-29 21:54:57 -070067LOCAL_SRC_FILES := $(filter-out tests/%,$(call all-subdir-cpp-files))
Matt Sharifid40f9762017-03-14 21:24:23 +010068LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
Matt Sharifibda09f12017-03-10 12:29:15 +010069
Alex Salcianu29fc69f2017-03-22 18:27:33 -040070LOCAL_STATIC_LIBRARIES += libtextclassifier_protos
Lukas Zilkad3bc59a2017-04-03 17:32:27 +020071LOCAL_STATIC_LIBRARIES += libprotobuf-cpp-lite
Alex Salcianu29fc69f2017-03-22 18:27:33 -040072LOCAL_SHARED_LIBRARIES += liblog
Lukas Zilkad3bc59a2017-04-03 17:32:27 +020073LOCAL_SHARED_LIBRARIES += libicuuc libicui18n
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000074LOCAL_REQUIRED_MODULES := textclassifier.langid.model
Abodunrinwa Toki72282c62017-03-15 19:30:31 +000075LOCAL_REQUIRED_MODULES += textclassifier.smartselection.en.model
Matt Sharifibda09f12017-03-10 12:29:15 +010076
Dan Willemsene5954072017-03-29 21:54:57 -070077LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/jni.lds
78LOCAL_LDFLAGS += -Wl,-version-script=$(LOCAL_PATH)/jni.lds
Alex Salcianu5fc7e542017-03-24 16:54:05 -040079
Matt Sharifibda09f12017-03-10 12:29:15 +010080include $(BUILD_SHARED_LIBRARY)
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000081
Matt Sharifid40f9762017-03-14 21:24:23 +010082# -----------------------
83# libtextclassifier_tests
84# -----------------------
85
86include $(CLEAR_VARS)
87
88LOCAL_MODULE := libtextclassifier_tests
89LOCAL_MODULE_TAGS := tests
90
91LOCAL_CPP_EXTENSION := .cc
Alex Salcianu8914de92017-03-20 11:40:48 -040092LOCAL_CFLAGS += $(MY_LIBTEXTCLASSIFIER_CFLAGS)
93LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS)
Matt Sharifid40f9762017-03-14 21:24:23 +010094
95LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, tests/testdata)
96
Matt Sharifibe876dc2017-03-17 17:02:43 +010097LOCAL_CPPFLAGS_32 += -DTEST_DATA_DIR="\"/data/nativetest/libtextclassifier_tests/tests/testdata/\""
98LOCAL_CPPFLAGS_64 += -DTEST_DATA_DIR="\"/data/nativetest64/libtextclassifier_tests/tests/testdata/\""
99
Dan Willemsene5954072017-03-29 21:54:57 -0700100LOCAL_SRC_FILES := $(call all-subdir-cpp-files)
Matt Sharifid40f9762017-03-14 21:24:23 +0100101LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
102
Alex Salcianu29fc69f2017-03-22 18:27:33 -0400103LOCAL_STATIC_LIBRARIES += libtextclassifier_protos libgmock
104LOCAL_SHARED_LIBRARIES += libprotobuf-cpp-lite
105LOCAL_SHARED_LIBRARIES += liblog
Lukas Zilkad3bc59a2017-04-03 17:32:27 +0200106LOCAL_SHARED_LIBRARIES += libicuuc libicui18n
Matt Sharifid40f9762017-03-14 21:24:23 +0100107
108include $(BUILD_NATIVE_TEST)
109
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000110# ------------
111# LangId model
112# ------------
113
114include $(CLEAR_VARS)
115LOCAL_MODULE := textclassifier.langid.model
116LOCAL_MODULE_CLASS := ETC
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000117LOCAL_MODULE_OWNER := google
118LOCAL_SRC_FILES := ./models/textclassifier.langid.model
119LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
120include $(BUILD_PREBUILT)
121
122# ----------------------
123# Smart Selection models
124# ----------------------
125
126include $(CLEAR_VARS)
Abodunrinwa Tokie7c58862017-04-05 13:29:25 +0100127LOCAL_MODULE := textclassifier.smartselection.ar.model
128LOCAL_MODULE_CLASS := ETC
129LOCAL_MODULE_OWNER := google
130LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ar.model
131LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
132include $(BUILD_PREBUILT)
133
134include $(CLEAR_VARS)
135LOCAL_MODULE := textclassifier.smartselection.de.model
136LOCAL_MODULE_CLASS := ETC
137LOCAL_MODULE_OWNER := google
138LOCAL_SRC_FILES := ./models/textclassifier.smartselection.de.model
139LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
140include $(BUILD_PREBUILT)
141
142include $(CLEAR_VARS)
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000143LOCAL_MODULE := textclassifier.smartselection.en.model
144LOCAL_MODULE_CLASS := ETC
Abodunrinwa Tokie7c58862017-04-05 13:29:25 +0100145LOCAL_MODULE_OWNER := google
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000146LOCAL_SRC_FILES := ./models/textclassifier.smartselection.en.model
147LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
148include $(BUILD_PREBUILT)
Abodunrinwa Tokie7c58862017-04-05 13:29:25 +0100149
150include $(CLEAR_VARS)
151LOCAL_MODULE := textclassifier.smartselection.es.model
152LOCAL_MODULE_CLASS := ETC
153LOCAL_MODULE_OWNER := google
154LOCAL_SRC_FILES := ./models/textclassifier.smartselection.es.model
155LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
156include $(BUILD_PREBUILT)
157
158include $(CLEAR_VARS)
159LOCAL_MODULE := textclassifier.smartselection.fr.model
160LOCAL_MODULE_CLASS := ETC
161LOCAL_MODULE_OWNER := google
162LOCAL_SRC_FILES := ./models/textclassifier.smartselection.fr.model
163LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
164include $(BUILD_PREBUILT)
165
166include $(CLEAR_VARS)
167LOCAL_MODULE := textclassifier.smartselection.it.model
168LOCAL_MODULE_CLASS := ETC
169LOCAL_MODULE_OWNER := google
170LOCAL_SRC_FILES := ./models/textclassifier.smartselection.it.model
171LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
172include $(BUILD_PREBUILT)
173
174include $(CLEAR_VARS)
175LOCAL_MODULE := textclassifier.smartselection.ja.model
176LOCAL_MODULE_CLASS := ETC
177LOCAL_MODULE_OWNER := google
178LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ja.model
179LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
180include $(BUILD_PREBUILT)
181
182include $(CLEAR_VARS)
183LOCAL_MODULE := textclassifier.smartselection.ko.model
184LOCAL_MODULE_CLASS := ETC
185LOCAL_MODULE_OWNER := google
186LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ko.model
187LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
188include $(BUILD_PREBUILT)
189
190include $(CLEAR_VARS)
191LOCAL_MODULE := textclassifier.smartselection.nl.model
192LOCAL_MODULE_CLASS := ETC
193LOCAL_MODULE_OWNER := google
194LOCAL_SRC_FILES := ./models/textclassifier.smartselection.nl.model
195LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
196include $(BUILD_PREBUILT)
197
198include $(CLEAR_VARS)
199LOCAL_MODULE := textclassifier.smartselection.pl.model
200LOCAL_MODULE_CLASS := ETC
201LOCAL_MODULE_OWNER := google
202LOCAL_SRC_FILES := ./models/textclassifier.smartselection.pl.model
203LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
204include $(BUILD_PREBUILT)
205
206include $(CLEAR_VARS)
207LOCAL_MODULE := textclassifier.smartselection.pt-PT.model
208LOCAL_MODULE_CLASS := ETC
209LOCAL_MODULE_OWNER := google
210LOCAL_SRC_FILES := ./models/textclassifier.smartselection.pt-PT.model
211LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
212include $(BUILD_PREBUILT)
213
214include $(CLEAR_VARS)
215LOCAL_MODULE := textclassifier.smartselection.ru.model
216LOCAL_MODULE_CLASS := ETC
217LOCAL_MODULE_OWNER := google
218LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ru.model
219LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
220include $(BUILD_PREBUILT)
221
222include $(CLEAR_VARS)
223LOCAL_MODULE := textclassifier.smartselection.th.model
224LOCAL_MODULE_CLASS := ETC
225LOCAL_MODULE_OWNER := google
226LOCAL_SRC_FILES := ./models/textclassifier.smartselection.th.model
227LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
228include $(BUILD_PREBUILT)
229
230include $(CLEAR_VARS)
231LOCAL_MODULE := textclassifier.smartselection.tr.model
232LOCAL_MODULE_CLASS := ETC
233LOCAL_MODULE_OWNER := google
234LOCAL_SRC_FILES := ./models/textclassifier.smartselection.tr.model
235LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
236include $(BUILD_PREBUILT)
237
238include $(CLEAR_VARS)
239LOCAL_MODULE := textclassifier.smartselection.zh-Hant.model
240LOCAL_MODULE_CLASS := ETC
241LOCAL_MODULE_OWNER := google
242LOCAL_SRC_FILES := ./models/textclassifier.smartselection.zh-Hant.model
243LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
244include $(BUILD_PREBUILT)
245
246include $(CLEAR_VARS)
247LOCAL_MODULE := textclassifier.smartselection.zh.model
248LOCAL_MODULE_CLASS := ETC
249LOCAL_MODULE_OWNER := google
250LOCAL_SRC_FILES := ./models/textclassifier.smartselection.zh.model
251LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
252include $(BUILD_PREBUILT)
253
254# -----------------------
255# Smart Selection bundles
256# -----------------------
257
258include $(CLEAR_VARS)
259LOCAL_MODULE := textclassifier.smartselection.bundle1
260LOCAL_REQUIRED_MODULES := textclassifier.smartselection.en.model
261LOCAL_REQUIRED_MODULES += textclassifier.smartselection.es.model
262LOCAL_REQUIRED_MODULES += textclassifier.smartselection.de.model
263LOCAL_REQUIRED_MODULES += textclassifier.smartselection.fr.model
264include $(BUILD_STATIC_LIBRARY)