1# Copyright (C) 2015 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
15#disable build in PDK
16ifneq ($(TARGET_BUILD_PDK),true)
17
18LOCAL_PATH := $(call my-dir)
19
20pattern_locales := \
21    as/as \
22    be/be \
23    bn/bn \
24    bg/bg \
25    cu/cu \
26    cy/cy \
27    da/da \
28    de/de-1901 \
29    de/de-1996 \
30    de/de-ch-1901 \
31    en-GB/en-gb \
32    en-US/en-us \
33    es/es \
34    et/et \
35    eu/eu \
36    Ethi/und-ethi \
37    fr/fr \
38    ga/ga \
39    gu/gu \
40    hi/hi \
41    hr/hr \
42    hu/hu \
43    hy/hy \
44    kn/kn \
45    la/la \
46    ml/ml \
47    mn/mn-cyrl \
48    mr/mr \
49    nb/nb \
50    nn/nn \
51    or/or \
52    pa/pa \
53    pt/pt \
54    sl/sl \
55    ta/ta \
56    te/te \
57    tk/tk
58
59# TODO: we have data for sa/sa, but it requires special case handling for case
60# folding and normalization, so don't build it until that's fixed.
61#
62# TODO: we have data for Liturgical Latin, but there is no standard BCP 47 tag
63# for it, so we don't build it.
64
65BUILD_HYB := $(LOCAL_PATH)/build-hyb.mk
66
67#############################################################################
68# $(1): The subdirectory where the source files live.
69$ $(2): The file name fragment.
70#       It is used to find source files, and also generate the resulting binary.
71#############################################################################
72define build-one-pattern-module
73$(eval include $(CLEAR_VARS))\
74$(eval LOCAL_MODULE := $(addprefix hyph-, $(2)))\
75$(eval LOCAL_SRC_FILES := $(addprefix $(1)/hyph-, $(addprefix $(2), .pat.txt .chr.txt .hyp.txt)))\
76$(eval include $(BUILD_HYB))\
77$(eval include $(CLEAR_VARS))\
78$(eval LOCAL_MODULE := $(addprefix $(addprefix hyph-, $(2)), .lic.txt))\
79$(eval LOCAL_SRC_FILES := $(addprefix $(1)/hyph-, $(addprefix $(2), .lic.txt)))\
80$(eval LOCAL_MODULE_CLASS := ETC)\
81$(eval LOCAL_MODULE_TAGS := optional)\
82$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/hyphen-data)\
83$(eval include $(BUILD_PREBUILT))
84endef
85
86$(foreach l, $(pattern_locales), $(call build-one-pattern-module, $(dir $(l)), $(notdir $l)))
87build-one-pattern-module :=
88pattern_locales :=
89
90endif #TARGET_BUILD_PDK
91