1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/locales/Makefile.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,77 @@ 1.4 +# This Source Code Form is subject to the terms of the Mozilla Public 1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +include $(topsrcdir)/config/config.mk 1.9 + 1.10 +# special case some locale codes, he and id 1.11 +# http://code.google.com/p/android/issues/detail?id=3639 1.12 +AB_rCD = $(if $(filter he, $(AB_CD)),iw,$(if $(filter id, $(AB_CD)),in,$(subst -,-r,$(AB_CD)))) 1.13 + 1.14 +SYNCSTRINGSPATH = $(abspath $(call MERGE_FILE,sync_strings.dtd)) 1.15 +STRINGSPATH = $(abspath $(call MERGE_FILE,android_strings.dtd)) 1.16 +ifeq (,$(XPI_NAME)) 1.17 +BRANDPATH = $(abspath $(DEPTH)/dist/bin/chrome/$(AB_CD)/locale/branding/brand.dtd) 1.18 +else 1.19 +BRANDPATH = $(abspath $(DIST)/xpi-stage/$(XPI_NAME)/chrome/$(AB_CD)/locale/branding/brand.dtd) 1.20 +endif 1.21 +$(warnIfEmpty,AB_CD) # todo: $(errorIfEmpty ) 1.22 + 1.23 +DEFINES += -DAB_CD=$(AB_CD) 1.24 + 1.25 +dir-res-values := ../res/values 1.26 +strings-xml := $(dir-res-values)/strings.xml 1.27 +strings-xml-in := $(srcdir)/../strings.xml.in 1.28 + 1.29 +GARBAGE += $(strings-xml) 1.30 + 1.31 +libs realchrome:: $(strings-xml) 1.32 + 1.33 +chrome-%:: AB_CD=$* 1.34 +chrome-%:: 1.35 + @$(MAKE) $(dir-res-values)-$(AB_rCD)/strings.xml AB_CD=$* 1.36 + 1.37 +# setup the path to bookmarks.inc. copied and tweaked version of MERGE_FILE from config/config.mk 1.38 +MOBILE_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/mobile/locales/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/mobile) 1.39 + 1.40 +ifdef LOCALE_MERGEDIR 1.41 +BOOKMARKSPATH = $(firstword \ 1.42 + $(wildcard $(LOCALE_MERGEDIR)/mobile/profile/bookmarks.inc ) \ 1.43 + $(wildcard $(MOBILE_LOCALE_SRCDIR)/profile/bookmarks.inc ) \ 1.44 + $(topsrcdir)/mobile/locales/en-US/profile/bookmarks.inc ) 1.45 +else 1.46 +BOOKMARKSPATH = $(abspath $(MOBILE_LOCALE_SRCDIR)/profile/bookmarks.inc) 1.47 +endif 1.48 + 1.49 +# Determine the ../res/values[-*]/ path 1.50 +strings-xml-bypath = $(filter %/strings.xml,$(MAKECMDGOALS)) 1.51 +ifeq (,$(strip $(strings-xml-bypath))) 1.52 + strings-xml-bypath = $(strings-xml) 1.53 +endif 1.54 +dir-strings-xml = $(patsubst %/,%,$(dir $(strings-xml-bypath))) 1.55 + 1.56 +strings-xml-preqs =\ 1.57 + $(strings-xml-in) \ 1.58 + $(BRANDPATH) \ 1.59 + $(STRINGSPATH) \ 1.60 + $(SYNCSTRINGSPATH) \ 1.61 + $(BOOKMARKSPATH) \ 1.62 + $(if $(IS_LANGUAGE_REPACK),FORCE) \ 1.63 + $(NULL) 1.64 + 1.65 +$(if $(MOZ_ANDROID_SHARED_ACCOUNT_TYPE),,$(error Missing MOZ_ANDROID_SHARED_ACCOUNT_TYPE)) 1.66 +$(if $(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE),,$(error Missing MOZ_ANDROID_SHARED_FXACCOUNT_TYPE)) 1.67 + 1.68 +$(dir-strings-xml)/strings.xml: $(strings-xml-preqs) 1.69 + $(call py_action,preprocessor, \ 1.70 + $(DEFINES) \ 1.71 + -DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \ 1.72 + -DBOOKMARKSPATH='$(BOOKMARKSPATH)' \ 1.73 + -DBRANDPATH='$(BRANDPATH)' \ 1.74 + -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE=$(MOZ_ANDROID_SHARED_ACCOUNT_TYPE) \ 1.75 + -DMOZ_ANDROID_SHARED_FXACCOUNT_TYPE=$(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE) \ 1.76 + -DMOZ_APP_DISPLAYNAME='@MOZ_APP_DISPLAYNAME@' \ 1.77 + -DSTRINGSPATH='$(STRINGSPATH)' \ 1.78 + -DSYNCSTRINGSPATH='$(SYNCSTRINGSPATH)' \ 1.79 + $< \ 1.80 + -o $@)