blob: 7e7c73e42d2657c3e90b5aa0fc6314a7a714560c [file] [log] [blame]
Roozbeh Pournader01be41a2015-04-06 20:07:40 -07001# 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
Roozbeh Pournader7104a912015-05-01 10:46:58 -070015HYPHENS_DIR := $(call my-dir)
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070016
Roozbeh Pournader7104a912015-05-01 10:46:58 -070017pattern_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
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070026
27pattern_src_files := \
28 $(foreach locale, $(pattern_locales), \
Roozbeh Pournader7104a912015-05-01 10:46:58 -070029 $(addprefix $(dir $(locale)), \
30 $(addprefix hyph-, $(addprefix $(notdir $(locale)), \
31 .chr.txt .hyp.txt .lic.txt .pat.txt))))
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070032pattern_locales :=
33
Roozbeh Pournader7104a912015-05-01 10:46:58 -070034# We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES,
35# to copy over the NOTICE file.
36
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070037#############################################################################
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))\
Roozbeh Pournader7104a912015-05-01 10:46:58 -070043$(eval LOCAL_PATH := $(abspath $(addprefix $(HYPHENS_DIR)/, $(dir $(1)))))\
44$(eval LOCAL_MODULE := $(notdir $(1)))\
45$(eval LOCAL_SRC_FILES := $(notdir $(1)))\
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070046$(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 :=
Roozbeh Pournader7104a912015-05-01 10:46:58 -070055HYPHENS_DIR :=