Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 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 | |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame^] | 15 | HYPHENS_DIR := $(call my-dir) |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 16 | |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame^] | 17 | pattern_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 Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 26 | |
| 27 | pattern_src_files := \ |
| 28 | $(foreach locale, $(pattern_locales), \ |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame^] | 29 | $(addprefix $(dir $(locale)), \ |
| 30 | $(addprefix hyph-, $(addprefix $(notdir $(locale)), \ |
| 31 | .chr.txt .hyp.txt .lic.txt .pat.txt)))) |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 32 | pattern_locales := |
| 33 | |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame^] | 34 | # We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FILES, |
| 35 | # to copy over the NOTICE file. |
| 36 | |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 37 | ############################################################################# |
| 38 | # $(1): The source file name in LOCAL_PATH. |
| 39 | # It also serves as the module name and the dest file name. |
| 40 | ############################################################################# |
| 41 | define build-one-pattern-module |
| 42 | $(eval include $(CLEAR_VARS))\ |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame^] | 43 | $(eval LOCAL_PATH := $(abspath $(addprefix $(HYPHENS_DIR)/, $(dir $(1)))))\ |
| 44 | $(eval LOCAL_MODULE := $(notdir $(1)))\ |
| 45 | $(eval LOCAL_SRC_FILES := $(notdir $(1)))\ |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 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)) |
| 50 | endef |
| 51 | |
| 52 | $(foreach f, $(pattern_src_files), $(call build-one-pattern-module, $(f))) |
| 53 | build-one-pattern-module := |
| 54 | pattern_src_files := |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame^] | 55 | HYPHENS_DIR := |