blob: 18ff1336ff25045c8c2b2fd89c1b5f90751124fc [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
Raph Levienc15709c2015-09-03 16:18:30 -070015LOCAL_PATH := $(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 \
Raph Levienc15709c2015-09-03 16:18:30 -070024 nn/nn
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070025
Raph Levienc15709c2015-09-03 16:18:30 -070026# 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 Pournader01be41a2015-04-06 20:07:40 -070028
Raph Levienc15709c2015-09-03 16:18:30 -070029BUILD_HYB := $(LOCAL_PATH)/build-hyb.mk
Roozbeh Pournader7104a912015-05-01 10:46:58 -070030
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070031#############################################################################
Raph Levienc15709c2015-09-03 16:18:30 -070032# $(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 Pournader01be41a2015-04-06 20:07:40 -070035#############################################################################
36define build-one-pattern-module
37$(eval include $(CLEAR_VARS))\
Raph Levienc15709c2015-09-03 16:18:30 -070038$(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 Pournader01be41a2015-04-06 20:07:40 -070044$(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))
48endef
49
Raph Levienc15709c2015-09-03 16:18:30 -070050$(foreach l, $(pattern_locales), $(call build-one-pattern-module, $(dir $(l)), $(notdir $l)))
Roozbeh Pournader01be41a2015-04-06 20:07:40 -070051build-one-pattern-module :=
Raph Levienc15709c2015-09-03 16:18:30 -070052pattern_locales :=