Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | include $(topsrcdir)/config/config.mk |
michael@0 | 6 | |
michael@0 | 7 | # special case some locale codes, he and id |
michael@0 | 8 | # http://code.google.com/p/android/issues/detail?id=3639 |
michael@0 | 9 | AB_rCD = $(if $(filter he, $(AB_CD)),iw,$(if $(filter id, $(AB_CD)),in,$(subst -,-r,$(AB_CD)))) |
michael@0 | 10 | |
michael@0 | 11 | SYNCSTRINGSPATH = $(abspath $(call MERGE_FILE,sync_strings.dtd)) |
michael@0 | 12 | STRINGSPATH = $(abspath $(call MERGE_FILE,android_strings.dtd)) |
michael@0 | 13 | ifeq (,$(XPI_NAME)) |
michael@0 | 14 | BRANDPATH = $(abspath $(DEPTH)/dist/bin/chrome/$(AB_CD)/locale/branding/brand.dtd) |
michael@0 | 15 | else |
michael@0 | 16 | BRANDPATH = $(abspath $(DIST)/xpi-stage/$(XPI_NAME)/chrome/$(AB_CD)/locale/branding/brand.dtd) |
michael@0 | 17 | endif |
michael@0 | 18 | $(warnIfEmpty,AB_CD) # todo: $(errorIfEmpty ) |
michael@0 | 19 | |
michael@0 | 20 | DEFINES += -DAB_CD=$(AB_CD) |
michael@0 | 21 | |
michael@0 | 22 | dir-res-values := ../res/values |
michael@0 | 23 | strings-xml := $(dir-res-values)/strings.xml |
michael@0 | 24 | strings-xml-in := $(srcdir)/../strings.xml.in |
michael@0 | 25 | |
michael@0 | 26 | GARBAGE += $(strings-xml) |
michael@0 | 27 | |
michael@0 | 28 | libs realchrome:: $(strings-xml) |
michael@0 | 29 | |
michael@0 | 30 | chrome-%:: AB_CD=$* |
michael@0 | 31 | chrome-%:: |
michael@0 | 32 | @$(MAKE) $(dir-res-values)-$(AB_rCD)/strings.xml AB_CD=$* |
michael@0 | 33 | |
michael@0 | 34 | # setup the path to bookmarks.inc. copied and tweaked version of MERGE_FILE from config/config.mk |
michael@0 | 35 | MOBILE_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/mobile/locales/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/mobile) |
michael@0 | 36 | |
michael@0 | 37 | ifdef LOCALE_MERGEDIR |
michael@0 | 38 | BOOKMARKSPATH = $(firstword \ |
michael@0 | 39 | $(wildcard $(LOCALE_MERGEDIR)/mobile/profile/bookmarks.inc ) \ |
michael@0 | 40 | $(wildcard $(MOBILE_LOCALE_SRCDIR)/profile/bookmarks.inc ) \ |
michael@0 | 41 | $(topsrcdir)/mobile/locales/en-US/profile/bookmarks.inc ) |
michael@0 | 42 | else |
michael@0 | 43 | BOOKMARKSPATH = $(abspath $(MOBILE_LOCALE_SRCDIR)/profile/bookmarks.inc) |
michael@0 | 44 | endif |
michael@0 | 45 | |
michael@0 | 46 | # Determine the ../res/values[-*]/ path |
michael@0 | 47 | strings-xml-bypath = $(filter %/strings.xml,$(MAKECMDGOALS)) |
michael@0 | 48 | ifeq (,$(strip $(strings-xml-bypath))) |
michael@0 | 49 | strings-xml-bypath = $(strings-xml) |
michael@0 | 50 | endif |
michael@0 | 51 | dir-strings-xml = $(patsubst %/,%,$(dir $(strings-xml-bypath))) |
michael@0 | 52 | |
michael@0 | 53 | strings-xml-preqs =\ |
michael@0 | 54 | $(strings-xml-in) \ |
michael@0 | 55 | $(BRANDPATH) \ |
michael@0 | 56 | $(STRINGSPATH) \ |
michael@0 | 57 | $(SYNCSTRINGSPATH) \ |
michael@0 | 58 | $(BOOKMARKSPATH) \ |
michael@0 | 59 | $(if $(IS_LANGUAGE_REPACK),FORCE) \ |
michael@0 | 60 | $(NULL) |
michael@0 | 61 | |
michael@0 | 62 | $(if $(MOZ_ANDROID_SHARED_ACCOUNT_TYPE),,$(error Missing MOZ_ANDROID_SHARED_ACCOUNT_TYPE)) |
michael@0 | 63 | $(if $(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE),,$(error Missing MOZ_ANDROID_SHARED_FXACCOUNT_TYPE)) |
michael@0 | 64 | |
michael@0 | 65 | $(dir-strings-xml)/strings.xml: $(strings-xml-preqs) |
michael@0 | 66 | $(call py_action,preprocessor, \ |
michael@0 | 67 | $(DEFINES) \ |
michael@0 | 68 | -DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \ |
michael@0 | 69 | -DBOOKMARKSPATH='$(BOOKMARKSPATH)' \ |
michael@0 | 70 | -DBRANDPATH='$(BRANDPATH)' \ |
michael@0 | 71 | -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE=$(MOZ_ANDROID_SHARED_ACCOUNT_TYPE) \ |
michael@0 | 72 | -DMOZ_ANDROID_SHARED_FXACCOUNT_TYPE=$(MOZ_ANDROID_SHARED_FXACCOUNT_TYPE) \ |
michael@0 | 73 | -DMOZ_APP_DISPLAYNAME='@MOZ_APP_DISPLAYNAME@' \ |
michael@0 | 74 | -DSTRINGSPATH='$(STRINGSPATH)' \ |
michael@0 | 75 | -DSYNCSTRINGSPATH='$(SYNCSTRINGSPATH)' \ |
michael@0 | 76 | $< \ |
michael@0 | 77 | -o $@) |