mobile/locales/Makefile.in

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 # -*- makefile -*-
michael@0 2 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 5
michael@0 6 #####################################################################################
michael@0 7 # Dependency build overhead:
michael@0 8 # o always create/update/hard link targets boomkarks.json & searchplugins
michael@0 9 # o latest symlink will be correct for the current locale / local build.
michael@0 10 # o logic is essentially FORCE for language packs w/o all the build overhead
michael@0 11 # o phase 2: replace hard links with a user function able to derive path
michael@0 12 # based on current locale.
michael@0 13 #####################################################################################
michael@0 14
michael@0 15 include $(topsrcdir)/config/config.mk
michael@0 16
michael@0 17 USE_AUTOTARGETS_MK=1
michael@0 18 include $(topsrcdir)/config/makefiles/makeutils.mk
michael@0 19
michael@0 20 # Separate items of contention
michael@0 21 tgt-gendir = .deps/generated_$(AB_CD)
michael@0 22
michael@0 23 GENERATED_DIRS += .deps
michael@0 24
michael@0 25 ifdef LOCALE_MERGEDIR
michael@0 26 vpath book%.inc $(LOCALE_MERGEDIR)/mobile/profile
michael@0 27 endif
michael@0 28 vpath book%.inc $(LOCALE_SRCDIR)/profile
michael@0 29 ifdef LOCALE_MERGEDIR
michael@0 30 vpath book%.inc @srcdir@/en-US/profile
michael@0 31 endif
michael@0 32
michael@0 33 $(call errorIfEmpty,MOZ_BRANDING_DIRECTORY)
michael@0 34 SUBMAKEFILES += \
michael@0 35 $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
michael@0 36 $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
michael@0 37 $(NULL)
michael@0 38
michael@0 39 DEFINES += \
michael@0 40 -DAB_CD=$(AB_CD) \
michael@0 41 $(NULL)
michael@0 42
michael@0 43
michael@0 44 ###########################################################################
michael@0 45 # Default target, preserve existing functionality for:
michael@0 46 # gmake -C $obj/mobile/locales
michael@0 47 ###########################################################################
michael@0 48 search-jar-default: search-jar
michael@0 49
michael@0 50
michael@0 51 ###########################################################################
michael@0 52 bookmarks = bookmarks.json
michael@0 53 bookmarks-ts = $(tgt-gendir)/$(bookmarks)
michael@0 54 src-bookmarks = $(srcdir)/generic/profile/$(bookmarks).in
michael@0 55
michael@0 56 GARBAGE += $(bookmarks) $(bookmarks-ts)
michael@0 57 # ---------------------------------------------------------------------------
michael@0 58 # Note: Always symlink bookmarks.json to pickup the current build for a
michael@0 59 # locale. Phase 2 edits should remove the common/symlink file and
michael@0 60 # provide a user function able to derive the path.
michael@0 61 ###########################################################################
michael@0 62
michael@0 63 ## Searchlist plugin config
michael@0 64 plugin-file-array = \
michael@0 65 $(wildcard $(LOCALE_SRCDIR)/searchplugins/list.txt) \
michael@0 66 $(srcdir)/en-US/searchplugins/list.txt \
michael@0 67 $(NULL)
michael@0 68
michael@0 69 ###########################################################################
michael@0 70 plugin_file = $(firstword $(plugin-file-array))
michael@0 71 plugin-file-ts = $(tgt-gendir)/$(subst $(topsrcdir)/,$(NULL),$(plugin_file)).ts
michael@0 72
michael@0 73 GARBAGE += $(plugin-file-ts)
michael@0 74 # ---------------------------------------------------------------------------
michael@0 75 # plugin-file-ts track searchlist file used ($path/list.txt)
michael@0 76 # and time when the file was last modified.
michael@0 77 ###########################################################################
michael@0 78 plugin-file-ts-preqs = \
michael@0 79 $(call mkdir_deps,$(dir $(plugin-file-ts))) \
michael@0 80 $(plugin_file) \
michael@0 81 $(NULL)
michael@0 82
michael@0 83 ###########################################################################
michael@0 84 # Detect locale changes. Force stale deps when searchlist file
michael@0 85 # or content has changed.
michael@0 86 $(plugin-file-ts): $(plugin-file-ts-preqs)
michael@0 87 @touch $@
michael@0 88
michael@0 89
michael@0 90 ###########################################################################
michael@0 91 search-jar-common = tmp-search.jar.mn
michael@0 92 search-jar = $(tgt-gendir)/$(search-jar-common)
michael@0 93 search-jar-ts = $(search-jar).ts
michael@0 94
michael@0 95 GARBAGE += $(search-jar) $(search-jar-ts) $(search-jar-common)
michael@0 96 # ---------------------------------------------------------------------------
michael@0 97 # search-jar contains a list of providers for the search plugin
michael@0 98 ###########################################################################
michael@0 99 SEARCH_PLUGINS = $(shell cat $(plugin_file))
michael@0 100 $(call errorIfEmpty,SEARCH_PLUGINS)
michael@0 101
michael@0 102 search-jar-preqs = \
michael@0 103 $(plugin-file-ts) \
michael@0 104 $(if $(IS_LANGUAGE_REPACK),FORCE) \
michael@0 105 $(NULL)
michael@0 106
michael@0 107 .PHONY: search-jar
michael@0 108 search-jar: $(search-jar)
michael@0 109 $(search-jar): $(search-jar-preqs)
michael@0 110 @echo '\nGenerating: search-jar'
michael@0 111 printf '$(AB_CD).jar:' > $@
michael@0 112 ln -fn $@ .
michael@0 113 printf '$(foreach plugin,$(SEARCH_PLUGINS),$(subst __PLUGIN_SUBST__,$(plugin), \n locale/$(AB_CD)/browser/searchplugins/__PLUGIN_SUBST__.xml (__PLUGIN_SUBST__.xml)))' >> $@
michael@0 114 @echo >> $@
michael@0 115
michael@0 116 ###################
michael@0 117 search-dir-deps = \
michael@0 118 $(plugin-file) \
michael@0 119 $(dir-chrome) \
michael@0 120 $(NULL)
michael@0 121
michael@0 122 search-preqs =\
michael@0 123 $(call mkdir_deps,$(dir $(search-jar-ts))) \
michael@0 124 $(call mkdir_deps,$(FINAL_TARGET)/chrome) \
michael@0 125 $(search-jar) \
michael@0 126 $(search-dir-deps) \
michael@0 127 $(if $(IS_LANGUAGE_REPACK),FORCE) \
michael@0 128 $(GLOBAL_DEPS) \
michael@0 129 $(NULL)
michael@0 130
michael@0 131 .PHONY: searchplugins
michael@0 132 searchplugins: $(search-preqs)
michael@0 133 $(call py_action,jar_maker,\
michael@0 134 $(QUIET) -j $(FINAL_TARGET)/chrome \
michael@0 135 -s $(topsrcdir)/$(relativesrcdir)/en-US/searchplugins \
michael@0 136 -s $(LOCALE_SRCDIR)/searchplugins \
michael@0 137 $(MAKE_JARS_FLAGS) $(search-jar))
michael@0 138 $(TOUCH) $@
michael@0 139
michael@0 140 include $(topsrcdir)/config/rules.mk
michael@0 141
michael@0 142
michael@0 143 #############
michael@0 144 libs-preqs =\
michael@0 145 $(call mkdir-deps,$(DIST)/install) \
michael@0 146 $(NULL)
michael@0 147
michael@0 148 libs-%: $(libs-preqs)
michael@0 149 $(display-deps)
michael@0 150 @$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
michael@0 151 @$(MAKE) -C $(DEPTH)/intl/locales AB_CD=$* XPI_NAME=locale-$*
michael@0 152 @$(MAKE) -B $(bookmarks) AB_CD=$*
michael@0 153 @$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
michael@0 154 @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
michael@0 155 @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
michael@0 156
michael@0 157 # Tailored target to just add the chrome processing for multi-locale builds
michael@0 158 chrome-%:
michael@0 159 $(display-deps)
michael@0 160 @$(MAKE) -B $(bookmarks) AB_CD=$*
michael@0 161 @$(MAKE) -B searchplugins AB_CD=$*
michael@0 162 @$(MAKE) chrome AB_CD=$*
michael@0 163 @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
michael@0 164
michael@0 165 NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
michael@0 166
michael@0 167
michael@0 168 # emulate vpath to gather deps with a path
michael@0 169 has-mergedir = $(if $(strip $(LOCALE_MERGEDIR)),1)
michael@0 170 bookmarks-inc-array = \
michael@0 171 $(wildcard \
michael@0 172 $(if $(has_mergedir),$(LOCALE_MERGEDIR)/mobile/profile/bookmarks.inc) \
michael@0 173 $(LOCALE_SRCDIR)/profile/bookmarks.inc \
michael@0 174 $(if $(has-mergedir),$(srcdir)/en-US/profile/bookmarks.inc) \
michael@0 175 )
michael@0 176 bookmarks-inc = $(firstword $(bookmarks-inc-array))
michael@0 177
michael@0 178 bookmarks-preqs = \
michael@0 179 $(bookmarks-inc) \
michael@0 180 $(src-bookmarks) \
michael@0 181 generic/profile/$(bookmarks).in \
michael@0 182 $(if $(IS_LANGUAGE_REPACK),FORCE) \
michael@0 183 $(GLOBAL_DEPS) \
michael@0 184 $(NULL)
michael@0 185
michael@0 186 $(bookmarks-ts): $(bookmarks-preqs)
michael@0 187 $(display_deps)
michael@0 188 $(call py_action,preprocessor, \
michael@0 189 -I $< \
michael@0 190 -DAB_CD=$(NO_JA_JP_MAC_AB_CD) \
michael@0 191 $(src-bookmarks) \
michael@0 192 -o $@)
michael@0 193
michael@0 194 .PHONY: bookmarks $(bookmarks)
michael@0 195 bookmarks: $(bookmarks)
michael@0 196 $(bookmarks): $(bookmarks-ts)
michael@0 197 @echo '\nGenerating: $@'
michael@0 198 ln -fn $< .
michael@0 199
michael@0 200
michael@0 201 export:: searchplugins bookmarks

mercurial