michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: include $(topsrcdir)/config/config.mk michael@0: michael@0: # special case some locale codes, he and id michael@0: # http://code.google.com/p/android/issues/detail?id=3639 michael@0: AB_rCD = $(if $(filter he, $(AB_CD)),iw,$(if $(filter id, $(AB_CD)),in,$(subst -,-r,$(AB_CD)))) michael@0: michael@0: SYNCSTRINGSPATH = $(abspath $(call MERGE_FILE,sync_strings.dtd)) michael@0: STRINGSPATH = $(abspath $(call MERGE_FILE,android_strings.dtd)) michael@0: ifeq (,$(XPI_NAME)) michael@0: BRANDPATH = $(abspath $(DEPTH)/dist/bin/chrome/$(AB_CD)/locale/branding/brand.dtd) michael@0: else michael@0: BRANDPATH = $(abspath $(DIST)/xpi-stage/$(XPI_NAME)/chrome/$(AB_CD)/locale/branding/brand.dtd) michael@0: endif michael@0: $(warnIfEmpty,AB_CD) # todo: $(errorIfEmpty ) michael@0: michael@0: DEFINES += -DAB_CD=$(AB_CD) michael@0: michael@0: dir-res-values := ../res/values michael@0: strings-xml := $(dir-res-values)/strings.xml michael@0: strings-xml-in := $(srcdir)/../strings.xml.in michael@0: michael@0: GARBAGE += $(strings-xml) michael@0: michael@0: libs realchrome:: $(strings-xml) michael@0: michael@0: chrome-%:: AB_CD=$* michael@0: chrome-%:: michael@0: @$(MAKE) $(dir-res-values)-$(AB_rCD)/strings.xml AB_CD=$* michael@0: michael@0: # setup the path to bookmarks.inc. copied and tweaked version of MERGE_FILE from config/config.mk michael@0: MOBILE_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/mobile/locales/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/mobile) michael@0: michael@0: ifdef LOCALE_MERGEDIR michael@0: BOOKMARKSPATH = $(firstword \ michael@0: $(wildcard $(LOCALE_MERGEDIR)/mobile/profile/bookmarks.inc ) \ michael@0: $(wildcard $(MOBILE_LOCALE_SRCDIR)/profile/bookmarks.inc ) \ michael@0: $(topsrcdir)/mobile/locales/en-US/profile/bookmarks.inc ) michael@0: else michael@0: BOOKMARKSPATH = $(abspath $(MOBILE_LOCALE_SRCDIR)/profile/bookmarks.inc) michael@0: endif michael@0: michael@0: # Determine the ../res/values[-*]/ path michael@0: strings-xml-bypath = $(filter %/strings.xml,$(MAKECMDGOALS)) michael@0: ifeq (,$(strip $(strings-xml-bypath))) michael@0: strings-xml-bypath = $(strings-xml) michael@0: endif michael@0: dir-strings-xml = $(patsubst %/,%,$(dir $(strings-xml-bypath))) michael@0: michael@0: strings-xml-preqs =\ michael@0: $(strings-xml-in) \ michael@0: $(BRANDPATH) \ michael@0: $(STRINGSPATH) \ michael@0: $(SYNCSTRINGSPATH) \ michael@0: $(BOOKMARKSPATH) \ michael@0: $(if $(IS_LANGUAGE_REPACK),FORCE) \ michael@0: $(NULL) michael@0: michael@0: $(if $(MOZ_ANDROID_SHARED_ACCOUNT_TYPE),,$(error Missing MOZ_ANDROID_SHARED_ACCOUNT_TYPE)) michael@0: $(if $(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE),,$(error Missing MOZ_ANDROID_SHARED_FXACCOUNT_TYPE)) michael@0: michael@0: $(dir-strings-xml)/strings.xml: $(strings-xml-preqs) michael@0: $(call py_action,preprocessor, \ michael@0: $(DEFINES) \ michael@0: -DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \ michael@0: -DBOOKMARKSPATH='$(BOOKMARKSPATH)' \ michael@0: -DBRANDPATH='$(BRANDPATH)' \ michael@0: -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE=$(MOZ_ANDROID_SHARED_ACCOUNT_TYPE) \ michael@0: -DMOZ_ANDROID_SHARED_FXACCOUNT_TYPE=$(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE) \ michael@0: -DMOZ_APP_DISPLAYNAME='@MOZ_APP_DISPLAYNAME@' \ michael@0: -DSTRINGSPATH='$(STRINGSPATH)' \ michael@0: -DSYNCSTRINGSPATH='$(SYNCSTRINGSPATH)' \ michael@0: $< \ michael@0: -o $@)