Bug 863263 part A - Modify some code in nsReadableUtils to support fallible and infal...
[gecko.git] / browser / locales / Makefile.in
blob0643d7025fbe82207f5c34509c6c2be9bd65dfb1
1 # vim:set ts=8 sw=8 sts=8 noet:
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 DEPTH = @DEPTH@
7 topsrcdir = @top_srcdir@
8 srcdir = @srcdir@
9 VPATH = @srcdir@
10 relativesrcdir = @relativesrcdir@
12 include $(DEPTH)/config/autoconf.mk
14 include $(topsrcdir)/config/config.mk
16 vpath %.xml @srcdir@/en-US/searchplugins
17 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
19 ifdef LOCALE_MERGEDIR
20 vpath crashreporter%.ini $(LOCALE_MERGEDIR)/browser/crashreporter
21 endif
22 vpath crashreporter%.ini $(LOCALE_SRCDIR)/crashreporter
23 ifdef LOCALE_MERGEDIR
24 vpath crashreporter%.ini @srcdir@/en-US/crashreporter
25 endif
26 ifdef LOCALE_MERGEDIR
27 vpath book%.inc $(LOCALE_MERGEDIR)/browser/profile
28 endif
29 vpath book%.inc $(LOCALE_SRCDIR)/profile
30 ifdef LOCALE_MERGEDIR
31 vpath book%.inc @srcdir@/en-US/profile
32 endif
35 SUBMAKEFILES += \
36 $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
37 $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
38 $(NULL)
40 # This makefile uses variable overrides from the libs-% target to
41 # build non-default locales to non-default dist/ locations. Be aware!
43 PWD := $(CURDIR)
45 # These are defaulted to be compatible with the files the wget-en-US target
46 # pulls. You may override them if you provide your own files. You _must_
47 # override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
48 # work in that case.
49 ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
50 WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
51 RETRIEVE_WINDOWS_INSTALLER = 1
53 MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org
55 PREF_JS_EXPORTS = $(call MERGE_FILE,firefox-l10n.js)
57 ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
58 MOZ_PKG_MAC_DSSTORE=$(_ABS_DIST)/branding/dsstore
59 MOZ_PKG_MAC_BACKGROUND=$(_ABS_DIST)/branding/background.png
60 MOZ_PKG_MAC_ICON=$(_ABS_DIST)/branding/disk.icns
61 MOZ_PKG_MAC_EXTRA=--symlink "/Applications:/ "
62 endif
64 ifeq (WINNT,$(OS_ARCH))
65 UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(STAGEDIST)/uninstall; \
66 $(NSINSTALL) -D $(STAGEDIST)/uninstall; \
67 cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall; \
68 $(RM) $(_ABS_DIST)/l10n-stage/setup.exe; \
69 cp ../installer/windows/l10ngen/setup.exe $(_ABS_DIST)/l10n-stage; \
70 $(NULL)
72 STUB_HOOK = $(NSINSTALL) -D "$(_ABS_DIST)/$(PKG_INST_PATH)"; \
73 $(RM) "$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"; \
74 cp ../installer/windows/l10ngen/stub.exe "$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"; \
75 chmod 0755 "$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"; \
76 $(NULL)
77 endif
79 SEARCHPLUGINS_NAMES = $(shell cat $(call MERGE_FILE,/searchplugins/list.txt))
80 SEARCHPLUGINS_PATH := $(FINAL_TARGET)/searchplugins
81 SEARCHPLUGINS := $(addsuffix .xml,$(SEARCHPLUGINS_NAMES))
82 PP_TARGETS += SEARCHPLUGINS
84 # Required for l10n.mk - defines a list of app sub dirs that should
85 # be included in langpack xpis.
86 ifdef MOZ_METRO
87 # metro build, include both app folders
88 DIST_SUBDIRS = browser metro
89 else
90 DIST_SUBDIRS = $(DIST_SUBDIR)
91 endif
93 GENERATED_DIRS_libs = $(DIST)/bin
95 include $(topsrcdir)/config/rules.mk
97 include $(topsrcdir)/toolkit/locales/l10n.mk
99 $(STAGEDIST): $(DIST)/branding
101 $(DIST)/branding:
102 $(NSINSTALL) -D $@
104 libs::
105 @if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
106 $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
107 $(LOCALE_SRCDIR)/existing-profile-defaults.js > $(FINAL_TARGET)/defaults/existing-profile-defaults.js; \
109 install::
110 @if test -f "$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
111 $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
112 $(LOCALE_SRCDIR)/existing-profile-defaults.js > $(DESTDIR)$(mozappdir)/defaults/existing-profile-defaults.js; \
115 PROFILE_FILES = \
116 localstore.rdf \
117 mimeTypes.rdf \
118 $(NULL)
120 PROFILE_CHROME = userChrome-example.css userContent-example.css
122 NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
124 %/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
125 $(SYSINSTALL) -D $(dir $@)
126 $(PYTHON) $(topsrcdir)/config/Preprocessor.py \
127 -I $< \
128 -DAB_CD=$(NO_JA_JP_MAC_AB_CD) \
129 $(srcdir)/generic/profile/bookmarks.html.in \
130 > $@
132 libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
134 libs:: $(addprefix generic/profile/,$(PROFILE_FILES))
135 $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
137 libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
138 $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
140 install:: $(DESTDIR)$(mozappdir)/defaults/profile/bookmarks.html ;
142 install:: $(addprefix generic/profile/,$(PROFILE_FILES))
143 $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile
145 install:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
146 $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile/chrome
148 # metro build calls back here for search engine plugins
149 searchplugins: $(addprefix $(FINAL_TARGET)/searchplugins/,$(SEARCHPLUGINS))
150 .PHONY: searchplugins
152 libs-%:
153 $(NSINSTALL) -D $(DIST)/install
154 @$(MAKE) -C ../../toolkit/locales libs-$*
155 @$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
156 @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
157 @$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
158 @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
159 ifdef MOZ_METRO
160 @$(MAKE) -C ../metro/locales AB_CD=$* XPI_NAME=locale-$*
161 endif
162 @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
164 repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
165 repackage-win32-installer: $(call ESCAPE_WILDCARD,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
166 @echo "Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
167 $(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
168 $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
169 $(MAKE) repackage-zip \
170 AB_CD=$(AB_CD) \
171 MOZ_PKG_FORMAT=SFX7Z \
172 ZIP_IN="$(WIN32_INSTALLER_IN)" \
173 ZIP_OUT="$(WIN32_INSTALLER_OUT)" \
174 SFX_HEADER="$(PWD)/../installer/windows/l10ngen/7zSD.sfx \
175 $(topsrcdir)/browser/installer/windows/app.tag"
177 ifeq (WINNT,$(OS_ARCH))
178 repackage-win32-installer-%: $(STAGEDIST)
179 @$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN="$(WIN32_INSTALLER_IN)"
181 repackage-zip-%: repackage-win32-installer-%
182 else
183 repackage-win32-installer-%: ;
184 endif
187 clobber-zip:
188 $(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
189 $(STAGEDIST)/chrome/$(AB_CD).manifest \
190 $(STAGEDIST)/webapprt/chrome/$(AB_CD).jar \
191 $(STAGEDIST)/webapprt/chrome/$(AB_CD).manifest \
192 $(STAGEDIST)/$(PREF_DIR)/firefox-l10n.js
193 $(RM) -rf $(STAGEDIST)/searchplugins \
194 $(STAGEDIST)/dictionaries \
195 $(STAGEDIST)/hyphenation \
196 $(STAGEDIST)/defaults/profile \
197 $(STAGEDIST)/chrome/$(AB_CD) \
198 $(STAGEDIST)/webapprt/chrome/$(AB_CD)
201 langpack: langpack-$(AB_CD)
203 # This is a generic target that will make a langpack, repack ZIP (+tarball)
204 # builds, and repack an installer if applicable. It is called from the
205 # tinderbox scripts. Alter it with caution.
207 installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
208 @echo "repackaging done"
210 ifdef MOZ_UPDATER
211 # Note that we want updater.ini to be in the top directory, not the browser/
212 # subdirectory, because that's where the updater is installed and runs.
213 libs:: $(call MERGE_FILE,updater/updater.ini)
214 ifeq ($(OS_ARCH),WINNT)
215 cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
216 sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
217 sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
218 $(DIST)/bin/updater.ini
219 else
220 cat $< | \
221 sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
222 sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
223 $(DIST)/bin/updater.ini
224 endif
225 endif
227 ifdef MOZ_CRASHREPORTER
228 libs:: crashreporter-override.ini
229 $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
230 endif
232 ident:
233 @printf "fx_revision "
234 @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
235 $(STAGEDIST)/application.ini App SourceStamp
236 @printf "buildid "
237 @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
238 $(STAGEDIST)/application.ini App BuildID
240 merge-%:
241 ifdef LOCALE_MERGEDIR
242 $(RM) -rf $(LOCALE_MERGEDIR)
243 MACOSX_DEPLOYMENT_TARGET= compare-locales -m $(LOCALE_MERGEDIR) $(srcdir)/l10n.ini $(L10NBASEDIR) $*
244 endif
245 @echo
247 # test target, depends on make package
248 # try to repack x-test, with just toolkit/defines.inc being there
249 l10n-check:: INNER_UNMAKE_PACKAGE=true
250 l10n-check::
251 $(RM) -rf x-test
252 $(NSINSTALL) -D x-test/toolkit
253 echo "#define MOZ_LANG_TITLE Just testing" > x-test/toolkit/defines.inc
254 $(MAKE) installers-x-test L10NBASEDIR="$(PWD)" LOCALE_MERGEDIR="$(PWD)/mergedir"
255 $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/unpack.py $(DIST)/l10n-stage/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)
256 cd $(DIST)/l10n-stage && test $$(cat $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/update.locale) = x-test