blob: f1c36245944e12a43e07af7b4e6ed90b2f3a76e1 [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 Sharifibda09f12017-03-10 12:29:15 +010034# ------------------------
35# libtextclassifier_protos
36# ------------------------
37
Matt Sharifibda09f12017-03-10 12:29:15 +010038include $(CLEAR_VARS)
39
40LOCAL_MODULE := libtextclassifier_protos
41
Alex Salcianu8914de92017-03-20 11:40:48 -040042LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS)
43
Matt Sharifibda09f12017-03-10 12:29:15 +010044LOCAL_SRC_FILES := $(call all-proto-files-under, .)
45LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
46
47include $(BUILD_STATIC_LIBRARY)
48
49# -----------------
50# libtextclassifier
51# -----------------
52
Matt Sharifid40f9762017-03-14 21:24:23 +010053include $(CLEAR_VARS)
54LOCAL_MODULE := libtextclassifier
55
56proto_sources_dir := $(generated_sources_dir)
57
58LOCAL_CPP_EXTENSION := .cc
Alex Salcianu8914de92017-03-20 11:40:48 -040059LOCAL_CFLAGS += $(MY_LIBTEXTCLASSIFIER_CFLAGS)
60LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS)
Matt Sharifid40f9762017-03-14 21:24:23 +010061
Dan Willemsene5954072017-03-29 21:54:57 -070062LOCAL_SRC_FILES := $(filter-out tests/%,$(call all-subdir-cpp-files))
Matt Sharifid40f9762017-03-14 21:24:23 +010063LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
Matt Sharifibda09f12017-03-10 12:29:15 +010064
Alex Salcianu29fc69f2017-03-22 18:27:33 -040065LOCAL_STATIC_LIBRARIES += libtextclassifier_protos
Lukas Zilkad3bc59a2017-04-03 17:32:27 +020066LOCAL_STATIC_LIBRARIES += libprotobuf-cpp-lite
Alex Salcianu29fc69f2017-03-22 18:27:33 -040067LOCAL_SHARED_LIBRARIES += liblog
Lukas Zilkad3bc59a2017-04-03 17:32:27 +020068LOCAL_SHARED_LIBRARIES += libicuuc libicui18n
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000069LOCAL_REQUIRED_MODULES := textclassifier.langid.model
Abodunrinwa Toki72282c62017-03-15 19:30:31 +000070LOCAL_REQUIRED_MODULES += textclassifier.smartselection.en.model
Matt Sharifibda09f12017-03-10 12:29:15 +010071
Dan Willemsene5954072017-03-29 21:54:57 -070072LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/jni.lds
73LOCAL_LDFLAGS += -Wl,-version-script=$(LOCAL_PATH)/jni.lds
Alex Salcianu5fc7e542017-03-24 16:54:05 -040074
Matt Sharifibda09f12017-03-10 12:29:15 +010075include $(BUILD_SHARED_LIBRARY)
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000076
Matt Sharifid40f9762017-03-14 21:24:23 +010077# -----------------------
78# libtextclassifier_tests
79# -----------------------
80
81include $(CLEAR_VARS)
82
83LOCAL_MODULE := libtextclassifier_tests
84LOCAL_MODULE_TAGS := tests
85
86LOCAL_CPP_EXTENSION := .cc
Alex Salcianu8914de92017-03-20 11:40:48 -040087LOCAL_CFLAGS += $(MY_LIBTEXTCLASSIFIER_CFLAGS)
88LOCAL_STRIP_MODULE := $(LIBTEXTCLASSIFIER_STRIP_OPTS)
Matt Sharifid40f9762017-03-14 21:24:23 +010089
90LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, tests/testdata)
91
Matt Sharifibe876dc2017-03-17 17:02:43 +010092LOCAL_CPPFLAGS_32 += -DTEST_DATA_DIR="\"/data/nativetest/libtextclassifier_tests/tests/testdata/\""
93LOCAL_CPPFLAGS_64 += -DTEST_DATA_DIR="\"/data/nativetest64/libtextclassifier_tests/tests/testdata/\""
94
Dan Willemsene5954072017-03-29 21:54:57 -070095LOCAL_SRC_FILES := $(call all-subdir-cpp-files)
Matt Sharifid40f9762017-03-14 21:24:23 +010096LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
97
Alex Salcianu29fc69f2017-03-22 18:27:33 -040098LOCAL_STATIC_LIBRARIES += libtextclassifier_protos libgmock
99LOCAL_SHARED_LIBRARIES += libprotobuf-cpp-lite
100LOCAL_SHARED_LIBRARIES += liblog
Lukas Zilkad3bc59a2017-04-03 17:32:27 +0200101LOCAL_SHARED_LIBRARIES += libicuuc libicui18n
Matt Sharifid40f9762017-03-14 21:24:23 +0100102
103include $(BUILD_NATIVE_TEST)
104
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000105# ------------
106# LangId model
107# ------------
108
109include $(CLEAR_VARS)
110LOCAL_MODULE := textclassifier.langid.model
111LOCAL_MODULE_CLASS := ETC
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000112LOCAL_MODULE_OWNER := google
113LOCAL_SRC_FILES := ./models/textclassifier.langid.model
114LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
115include $(BUILD_PREBUILT)
116
117# ----------------------
118# Smart Selection models
119# ----------------------
120
121include $(CLEAR_VARS)
Abodunrinwa Tokie7c58862017-04-05 13:29:25 +0100122LOCAL_MODULE := textclassifier.smartselection.ar.model
123LOCAL_MODULE_CLASS := ETC
124LOCAL_MODULE_OWNER := google
125LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ar.model
126LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
127include $(BUILD_PREBUILT)
128
129include $(CLEAR_VARS)
130LOCAL_MODULE := textclassifier.smartselection.de.model
131LOCAL_MODULE_CLASS := ETC
132LOCAL_MODULE_OWNER := google
133LOCAL_SRC_FILES := ./models/textclassifier.smartselection.de.model
134LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
135include $(BUILD_PREBUILT)
136
137include $(CLEAR_VARS)
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000138LOCAL_MODULE := textclassifier.smartselection.en.model
139LOCAL_MODULE_CLASS := ETC
Abodunrinwa Tokie7c58862017-04-05 13:29:25 +0100140LOCAL_MODULE_OWNER := google
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +0000141LOCAL_SRC_FILES := ./models/textclassifier.smartselection.en.model
142LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
143include $(BUILD_PREBUILT)
Abodunrinwa Tokie7c58862017-04-05 13:29:25 +0100144
145include $(CLEAR_VARS)
146LOCAL_MODULE := textclassifier.smartselection.es.model
147LOCAL_MODULE_CLASS := ETC
148LOCAL_MODULE_OWNER := google
149LOCAL_SRC_FILES := ./models/textclassifier.smartselection.es.model
150LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
151include $(BUILD_PREBUILT)
152
153include $(CLEAR_VARS)
154LOCAL_MODULE := textclassifier.smartselection.fr.model
155LOCAL_MODULE_CLASS := ETC
156LOCAL_MODULE_OWNER := google
157LOCAL_SRC_FILES := ./models/textclassifier.smartselection.fr.model
158LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
159include $(BUILD_PREBUILT)
160
161include $(CLEAR_VARS)
162LOCAL_MODULE := textclassifier.smartselection.it.model
163LOCAL_MODULE_CLASS := ETC
164LOCAL_MODULE_OWNER := google
165LOCAL_SRC_FILES := ./models/textclassifier.smartselection.it.model
166LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
167include $(BUILD_PREBUILT)
168
169include $(CLEAR_VARS)
170LOCAL_MODULE := textclassifier.smartselection.ja.model
171LOCAL_MODULE_CLASS := ETC
172LOCAL_MODULE_OWNER := google
173LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ja.model
174LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
175include $(BUILD_PREBUILT)
176
177include $(CLEAR_VARS)
178LOCAL_MODULE := textclassifier.smartselection.ko.model
179LOCAL_MODULE_CLASS := ETC
180LOCAL_MODULE_OWNER := google
181LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ko.model
182LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
183include $(BUILD_PREBUILT)
184
185include $(CLEAR_VARS)
186LOCAL_MODULE := textclassifier.smartselection.nl.model
187LOCAL_MODULE_CLASS := ETC
188LOCAL_MODULE_OWNER := google
189LOCAL_SRC_FILES := ./models/textclassifier.smartselection.nl.model
190LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
191include $(BUILD_PREBUILT)
192
193include $(CLEAR_VARS)
194LOCAL_MODULE := textclassifier.smartselection.pl.model
195LOCAL_MODULE_CLASS := ETC
196LOCAL_MODULE_OWNER := google
197LOCAL_SRC_FILES := ./models/textclassifier.smartselection.pl.model
198LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
199include $(BUILD_PREBUILT)
200
201include $(CLEAR_VARS)
202LOCAL_MODULE := textclassifier.smartselection.pt-PT.model
203LOCAL_MODULE_CLASS := ETC
204LOCAL_MODULE_OWNER := google
205LOCAL_SRC_FILES := ./models/textclassifier.smartselection.pt-PT.model
206LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
207include $(BUILD_PREBUILT)
208
209include $(CLEAR_VARS)
210LOCAL_MODULE := textclassifier.smartselection.ru.model
211LOCAL_MODULE_CLASS := ETC
212LOCAL_MODULE_OWNER := google
213LOCAL_SRC_FILES := ./models/textclassifier.smartselection.ru.model
214LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
215include $(BUILD_PREBUILT)
216
217include $(CLEAR_VARS)
218LOCAL_MODULE := textclassifier.smartselection.th.model
219LOCAL_MODULE_CLASS := ETC
220LOCAL_MODULE_OWNER := google
221LOCAL_SRC_FILES := ./models/textclassifier.smartselection.th.model
222LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
223include $(BUILD_PREBUILT)
224
225include $(CLEAR_VARS)
226LOCAL_MODULE := textclassifier.smartselection.tr.model
227LOCAL_MODULE_CLASS := ETC
228LOCAL_MODULE_OWNER := google
229LOCAL_SRC_FILES := ./models/textclassifier.smartselection.tr.model
230LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
231include $(BUILD_PREBUILT)
232
233include $(CLEAR_VARS)
234LOCAL_MODULE := textclassifier.smartselection.zh-Hant.model
235LOCAL_MODULE_CLASS := ETC
236LOCAL_MODULE_OWNER := google
237LOCAL_SRC_FILES := ./models/textclassifier.smartselection.zh-Hant.model
238LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
239include $(BUILD_PREBUILT)
240
241include $(CLEAR_VARS)
242LOCAL_MODULE := textclassifier.smartselection.zh.model
243LOCAL_MODULE_CLASS := ETC
244LOCAL_MODULE_OWNER := google
245LOCAL_SRC_FILES := ./models/textclassifier.smartselection.zh.model
246LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
247include $(BUILD_PREBUILT)
248
249# -----------------------
250# Smart Selection bundles
251# -----------------------
252
253include $(CLEAR_VARS)
254LOCAL_MODULE := textclassifier.smartselection.bundle1
255LOCAL_REQUIRED_MODULES := textclassifier.smartselection.en.model
256LOCAL_REQUIRED_MODULES += textclassifier.smartselection.es.model
257LOCAL_REQUIRED_MODULES += textclassifier.smartselection.de.model
258LOCAL_REQUIRED_MODULES += textclassifier.smartselection.fr.model
259include $(BUILD_STATIC_LIBRARY)