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
15HYPHENS_DIR := $(call my-dir)
16
17pattern_locales := \
18    en-US/en-us \
19    Ethi/und-ethi \
20    eu/eu \
21    hu/hu \
22    hy/hy \
23    nb/nb \
24    nn/nn \
25    sa/sa
26
27pattern_src_files := \
28    $(foreach locale, $(pattern_locales), \
29        $(addprefix $(dir $(locale)), \
30            $(addprefix hyph-, $(addprefix $(notdir $(locale)), \
31                .chr.txt .hyp.txt .lic.txt .pat.txt))))
32pattern_locales :=
33
34# We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES,
35# to copy over the NOTICE file.
36
37#############################################################################
38# $(1): The source file name in LOCAL_PATH.
39#       It also serves as the module name and the dest file name.
40#############################################################################
41define build-one-pattern-module
42$(eval include $(CLEAR_VARS))\
43$(eval LOCAL_PATH := $(abspath $(addprefix $(HYPHENS_DIR)/, $(dir $(1)))))\
44$(eval LOCAL_MODULE := $(notdir $(1)))\
45$(eval LOCAL_SRC_FILES := $(notdir $(1)))\
46$(eval LOCAL_MODULE_CLASS := ETC)\
47$(eval LOCAL_MODULE_TAGS := optional)\
48$(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/hyphen-data)\
49$(eval include $(BUILD_PREBUILT))
50endef
51
52$(foreach f, $(pattern_src_files), $(call build-one-pattern-module, $(f)))
53build-one-pattern-module :=
54pattern_src_files :=
55HYPHENS_DIR :=
56