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 | |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 15 | LOCAL_PATH := $(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 \ |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 24 | nn/nn |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 25 | |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 26 | # TODO: we have data for sa/sa, but it requires special case handling for case |
| 27 | # folding and normalization, so don't build it until that's fixed. |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 28 | |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 29 | BUILD_HYB := $(LOCAL_PATH)/build-hyb.mk |
Roozbeh Pournader | 7104a91 | 2015-05-01 10:46:58 -0700 | [diff] [blame] | 30 | |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 31 | ############################################################################# |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 32 | # $(1): The subdirectory where the source files live. |
| 33 | $ $(2): The file name fragment. |
| 34 | # It is used to find source files, and also generate the resulting binary. |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 35 | ############################################################################# |
| 36 | define build-one-pattern-module |
| 37 | $(eval include $(CLEAR_VARS))\ |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 38 | $(eval LOCAL_MODULE := $(addprefix hyph-, $(2)))\ |
| 39 | $(eval LOCAL_SRC_FILES := $(addprefix $(1)/hyph-, $(addprefix $(2), .pat.txt .chr.txt .hyp.txt)))\ |
| 40 | $(eval include $(BUILD_HYB))\ |
| 41 | $(eval include $(CLEAR_VARS))\ |
| 42 | $(eval LOCAL_MODULE := $(addprefix $(addprefix hyph-, $(2)), .lic.txt))\ |
| 43 | $(eval LOCAL_SRC_FILES := $(addprefix $(1)/hyph-, $(addprefix $(2), .lic.txt)))\ |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 44 | $(eval LOCAL_MODULE_CLASS := ETC)\ |
| 45 | $(eval LOCAL_MODULE_TAGS := optional)\ |
| 46 | $(eval LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/hyphen-data)\ |
| 47 | $(eval include $(BUILD_PREBUILT)) |
| 48 | endef |
| 49 | |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 50 | $(foreach l, $(pattern_locales), $(call build-one-pattern-module, $(dir $(l)), $(notdir $l))) |
Roozbeh Pournader | 01be41a | 2015-04-06 20:07:40 -0700 | [diff] [blame] | 51 | build-one-pattern-module := |
Raph Levien | c15709c | 2015-09-03 16:18:30 -0700 | [diff] [blame] | 52 | pattern_locales := |