blob: 12e7b5cb9330c7a26a33b0110c9671c38575edd6 [file] [log] [blame]
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -07001# Copyright (C) 2008 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
15#
16# Rules for building the xlb files for export for translation.
17#
18
19# Gather all of the resource files for the default locale -- that is,
20# all resources in directories called values or values-something, where
21# one of the - separated segments is not two characters long -- those are the
22# language directories, and we don't want those.
23all_resource_files := $(foreach pkg, \
24 $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
25 $(PACKAGES.$(pkg).RESOURCE_FILES))
26values_resource_files := $(shell echo $(all_resource_files) | \
27 tr -s / | \
28 tr " " "\n" | \
29 grep -E "\/values[^/]*/(strings.xml|arrays.xml)$$" | \
30 grep -v -E -e "-[a-zA-Z]{2}[/\-]")
31
32xlb_target := $(PRODUCT_OUT)/strings.xlb
33
34$(xlb_target): $(values_resource_files) | $(LOCALIZE)
35 @echo XLB: $@
36 $(hide) mkdir -p $(dir $@)
37 $(hide) rm -f $@
38 $(hide) $(LOCALIZE) xlb $@ $^
39
40# Add a phony target so typing make xlb is convenient
41.PHONY: xlb
42xlb: $(xlb_target)
43
44# We want this on the build-server builds, but no reason to inflict it on
45# everyone
The Android Open Source Projectdcc08f02008-12-17 18:03:49 -080046$(call dist-for-goals, droid, $(xlb_target))
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -070047