1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/locales/Makefile.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,201 @@ 1.4 +# -*- makefile -*- 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +##################################################################################### 1.10 +# Dependency build overhead: 1.11 +# o always create/update/hard link targets boomkarks.json & searchplugins 1.12 +# o latest symlink will be correct for the current locale / local build. 1.13 +# o logic is essentially FORCE for language packs w/o all the build overhead 1.14 +# o phase 2: replace hard links with a user function able to derive path 1.15 +# based on current locale. 1.16 +##################################################################################### 1.17 + 1.18 +include $(topsrcdir)/config/config.mk 1.19 + 1.20 +USE_AUTOTARGETS_MK=1 1.21 +include $(topsrcdir)/config/makefiles/makeutils.mk 1.22 + 1.23 +# Separate items of contention 1.24 +tgt-gendir = .deps/generated_$(AB_CD) 1.25 + 1.26 +GENERATED_DIRS += .deps 1.27 + 1.28 +ifdef LOCALE_MERGEDIR 1.29 +vpath book%.inc $(LOCALE_MERGEDIR)/mobile/profile 1.30 +endif 1.31 +vpath book%.inc $(LOCALE_SRCDIR)/profile 1.32 +ifdef LOCALE_MERGEDIR 1.33 +vpath book%.inc @srcdir@/en-US/profile 1.34 +endif 1.35 + 1.36 +$(call errorIfEmpty,MOZ_BRANDING_DIRECTORY) 1.37 +SUBMAKEFILES += \ 1.38 + $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \ 1.39 + $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \ 1.40 + $(NULL) 1.41 + 1.42 +DEFINES += \ 1.43 + -DAB_CD=$(AB_CD) \ 1.44 + $(NULL) 1.45 + 1.46 + 1.47 +########################################################################### 1.48 +# Default target, preserve existing functionality for: 1.49 +# gmake -C $obj/mobile/locales 1.50 +########################################################################### 1.51 +search-jar-default: search-jar 1.52 + 1.53 + 1.54 +########################################################################### 1.55 +bookmarks = bookmarks.json 1.56 +bookmarks-ts = $(tgt-gendir)/$(bookmarks) 1.57 +src-bookmarks = $(srcdir)/generic/profile/$(bookmarks).in 1.58 + 1.59 +GARBAGE += $(bookmarks) $(bookmarks-ts) 1.60 +# --------------------------------------------------------------------------- 1.61 +# Note: Always symlink bookmarks.json to pickup the current build for a 1.62 +# locale. Phase 2 edits should remove the common/symlink file and 1.63 +# provide a user function able to derive the path. 1.64 +########################################################################### 1.65 + 1.66 +## Searchlist plugin config 1.67 +plugin-file-array = \ 1.68 + $(wildcard $(LOCALE_SRCDIR)/searchplugins/list.txt) \ 1.69 + $(srcdir)/en-US/searchplugins/list.txt \ 1.70 + $(NULL) 1.71 + 1.72 +########################################################################### 1.73 +plugin_file = $(firstword $(plugin-file-array)) 1.74 +plugin-file-ts = $(tgt-gendir)/$(subst $(topsrcdir)/,$(NULL),$(plugin_file)).ts 1.75 + 1.76 +GARBAGE += $(plugin-file-ts) 1.77 +# --------------------------------------------------------------------------- 1.78 +# plugin-file-ts track searchlist file used ($path/list.txt) 1.79 +# and time when the file was last modified. 1.80 +########################################################################### 1.81 +plugin-file-ts-preqs = \ 1.82 + $(call mkdir_deps,$(dir $(plugin-file-ts))) \ 1.83 + $(plugin_file) \ 1.84 + $(NULL) 1.85 + 1.86 +########################################################################### 1.87 +# Detect locale changes. Force stale deps when searchlist file 1.88 +# or content has changed. 1.89 +$(plugin-file-ts): $(plugin-file-ts-preqs) 1.90 + @touch $@ 1.91 + 1.92 + 1.93 +########################################################################### 1.94 +search-jar-common = tmp-search.jar.mn 1.95 +search-jar = $(tgt-gendir)/$(search-jar-common) 1.96 +search-jar-ts = $(search-jar).ts 1.97 + 1.98 +GARBAGE += $(search-jar) $(search-jar-ts) $(search-jar-common) 1.99 +# --------------------------------------------------------------------------- 1.100 +# search-jar contains a list of providers for the search plugin 1.101 +########################################################################### 1.102 +SEARCH_PLUGINS = $(shell cat $(plugin_file)) 1.103 +$(call errorIfEmpty,SEARCH_PLUGINS) 1.104 + 1.105 +search-jar-preqs = \ 1.106 + $(plugin-file-ts) \ 1.107 + $(if $(IS_LANGUAGE_REPACK),FORCE) \ 1.108 + $(NULL) 1.109 + 1.110 +.PHONY: search-jar 1.111 +search-jar: $(search-jar) 1.112 +$(search-jar): $(search-jar-preqs) 1.113 + @echo '\nGenerating: search-jar' 1.114 + printf '$(AB_CD).jar:' > $@ 1.115 + ln -fn $@ . 1.116 + printf '$(foreach plugin,$(SEARCH_PLUGINS),$(subst __PLUGIN_SUBST__,$(plugin), \n locale/$(AB_CD)/browser/searchplugins/__PLUGIN_SUBST__.xml (__PLUGIN_SUBST__.xml)))' >> $@ 1.117 + @echo >> $@ 1.118 + 1.119 +################### 1.120 +search-dir-deps = \ 1.121 + $(plugin-file) \ 1.122 + $(dir-chrome) \ 1.123 + $(NULL) 1.124 + 1.125 +search-preqs =\ 1.126 + $(call mkdir_deps,$(dir $(search-jar-ts))) \ 1.127 + $(call mkdir_deps,$(FINAL_TARGET)/chrome) \ 1.128 + $(search-jar) \ 1.129 + $(search-dir-deps) \ 1.130 + $(if $(IS_LANGUAGE_REPACK),FORCE) \ 1.131 + $(GLOBAL_DEPS) \ 1.132 + $(NULL) 1.133 + 1.134 +.PHONY: searchplugins 1.135 +searchplugins: $(search-preqs) 1.136 + $(call py_action,jar_maker,\ 1.137 + $(QUIET) -j $(FINAL_TARGET)/chrome \ 1.138 + -s $(topsrcdir)/$(relativesrcdir)/en-US/searchplugins \ 1.139 + -s $(LOCALE_SRCDIR)/searchplugins \ 1.140 + $(MAKE_JARS_FLAGS) $(search-jar)) 1.141 + $(TOUCH) $@ 1.142 + 1.143 +include $(topsrcdir)/config/rules.mk 1.144 + 1.145 + 1.146 +############# 1.147 +libs-preqs =\ 1.148 + $(call mkdir-deps,$(DIST)/install) \ 1.149 + $(NULL) 1.150 + 1.151 +libs-%: $(libs-preqs) 1.152 + $(display-deps) 1.153 + @$(MAKE) -C $(DEPTH)/toolkit/locales libs-$* 1.154 + @$(MAKE) -C $(DEPTH)/intl/locales AB_CD=$* XPI_NAME=locale-$* 1.155 + @$(MAKE) -B $(bookmarks) AB_CD=$* 1.156 + @$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$* 1.157 + @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref 1.158 + @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* 1.159 + 1.160 +# Tailored target to just add the chrome processing for multi-locale builds 1.161 +chrome-%: 1.162 + $(display-deps) 1.163 + @$(MAKE) -B $(bookmarks) AB_CD=$* 1.164 + @$(MAKE) -B searchplugins AB_CD=$* 1.165 + @$(MAKE) chrome AB_CD=$* 1.166 + @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$* 1.167 + 1.168 +NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD)) 1.169 + 1.170 + 1.171 +# emulate vpath to gather deps with a path 1.172 +has-mergedir = $(if $(strip $(LOCALE_MERGEDIR)),1) 1.173 +bookmarks-inc-array = \ 1.174 + $(wildcard \ 1.175 + $(if $(has_mergedir),$(LOCALE_MERGEDIR)/mobile/profile/bookmarks.inc) \ 1.176 + $(LOCALE_SRCDIR)/profile/bookmarks.inc \ 1.177 + $(if $(has-mergedir),$(srcdir)/en-US/profile/bookmarks.inc) \ 1.178 + ) 1.179 +bookmarks-inc = $(firstword $(bookmarks-inc-array)) 1.180 + 1.181 +bookmarks-preqs = \ 1.182 + $(bookmarks-inc) \ 1.183 + $(src-bookmarks) \ 1.184 + generic/profile/$(bookmarks).in \ 1.185 + $(if $(IS_LANGUAGE_REPACK),FORCE) \ 1.186 + $(GLOBAL_DEPS) \ 1.187 + $(NULL) 1.188 + 1.189 +$(bookmarks-ts): $(bookmarks-preqs) 1.190 + $(display_deps) 1.191 + $(call py_action,preprocessor, \ 1.192 + -I $< \ 1.193 + -DAB_CD=$(NO_JA_JP_MAC_AB_CD) \ 1.194 + $(src-bookmarks) \ 1.195 + -o $@) 1.196 + 1.197 +.PHONY: bookmarks $(bookmarks) 1.198 +bookmarks: $(bookmarks) 1.199 +$(bookmarks): $(bookmarks-ts) 1.200 + @echo '\nGenerating: $@' 1.201 + ln -fn $< . 1.202 + 1.203 + 1.204 +export:: searchplugins bookmarks