1 # vim:set ts=8 sw=8 sts=8 noet:
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is the Mozilla Browser code.
17 # The Initial Developer of the Original Code is
18 # Benjamin Smedberg <bsmedberg@covad.net>
19 # Portions created by the Initial Developer are Copyright (C) 2004
20 # the Initial Developer. All Rights Reserved.
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
39 topsrcdir
= @top_srcdir@
42 relativesrcdir
= browser
/locales
44 include $(DEPTH
)/config
/autoconf.mk
46 include $(topsrcdir
)/config
/config.mk
48 vpath
%.xml @
srcdir@
/en-US
/searchplugins
49 vpath
%.xml
$(LOCALE_SRCDIR
)/searchplugins
51 run_for_effects
:= $(shell if
! test -d
$(DIST
); then
$(NSINSTALL
) -D
$(DIST
); fi
; if
! test -d
$(DIST
)/branding
; then
$(NSINSTALL
) -D
$(DIST
)/branding
; fi
)
52 _ABS_DIST
:= $(shell cd
$(DIST
) && pwd
)
54 ifdef MOZ_BRANDING_DIRECTORY
56 $(DEPTH
)/$(MOZ_BRANDING_DIRECTORY
)/Makefile \
57 $(DEPTH
)/$(MOZ_BRANDING_DIRECTORY
)/locales
/Makefile \
61 # This makefile uses variable overrides from the libs-% target to
62 # build non-default locales to non-default dist/ locations. Be aware!
64 AB
= $(firstword $(subst -, ,$(AB_CD
)))
66 APP_VERSION
:= $(shell cat
$(srcdir)/..
/config
/version.txt
)
69 core_abspath
= $(if
$(findstring :,$(1)),$(1),$(if
$(filter /%,$(1)),$(1),$(PWD
)/$(1)))
73 -DMOZ_LANGPACK_EID
=langpack-
$(AB_CD
)@firefox.mozilla.org \
74 -DMOZ_APP_VERSION
=$(MOZ_APP_VERSION
) \
75 -DLOCALE_SRCDIR
=$(call core_abspath
,$(LOCALE_SRCDIR
)) \
76 -DPKG_BASENAME
=$(PKG_BASENAME
) \
79 ifndef MOZ_BRANDING_DIRECTORY
80 DEFINES
+= -DMOZ_USE_GENERIC_BRANDING
83 ifeq (,$(filter-out pref
,$(MOZ_EXTENSIONS
)))
84 DEFINES
+= -DEXTENSION_PREF
87 PREF_JS_EXPORTS
= $(LOCALE_SRCDIR
)/firefox-l10n.js
89 include $(topsrcdir
)/config
/rules.mk
92 @if
test -f
"$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
93 $(PERL
) $(topsrcdir
)/config
/preprocessor.pl
$(PREF_PPFLAGS
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) \
94 $(LOCALE_SRCDIR
)/existing-profile-defaults.js
> $(FINAL_TARGET
)/defaults
/existing-profile-defaults.js
; \
97 @if
test -f
"$(LOCALE_SRCDIR)/existing-profile-defaults.js"; then \
98 $(PERL
) $(topsrcdir
)/config
/preprocessor.pl
$(PREF_PPFLAGS
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) \
99 $(LOCALE_SRCDIR
)/existing-profile-defaults.js
> $(DESTDIR
)$(mozappdir
)/defaults
/existing-profile-defaults.js
; \
102 ifeq ($(OS_ARCH
),OS2
)
117 ifeq ($(OS_ARCH
),WINNT
)
118 PROFILE_FILES
+= win
/mimeTypes.rdf
120 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
121 PROFILE_FILES
+= mac
/mimeTypes.rdf
123 PROFILE_FILES
+= unix
/mimeTypes.rdf
127 PROFILE_CHROME
= userChrome-example.css userContent-example.css
129 libs
:: $(addprefix $(LOCALE_SRCDIR
)/,$(README_FILES
))
130 ifeq ($(OS_ARCH
),WINNT
)
133 $(PERL
) -pe
's/(?<!\r)\n/\r\n/g;' < $$file > $(FINAL_TARGET
)/`basename $$file`; \
136 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)
139 libs
:: $(addprefix $(LOCALE_SRCDIR
)/profile
/,$(PROFILE_FILES
))
140 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/defaults
/profile
142 libs
:: $(addprefix $(LOCALE_SRCDIR
)/profile
/chrome
/,$(PROFILE_CHROME
))
143 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/defaults
/profile
/chrome
145 install:: $(addprefix $(LOCALE_SRCDIR
)/profile
/,$(PROFILE_FILES
))
146 $(SYSINSTALL
) $(IFLAGS1
) $^
$(DESTDIR
)$(mozappdir
)/defaults
/profile
148 install:: $(addprefix $(LOCALE_SRCDIR
)/profile
/chrome
/,$(PROFILE_CHROME
))
149 $(SYSINSTALL
) $(IFLAGS1
) $^
$(DESTDIR
)$(mozappdir
)/defaults
/profile
/chrome
151 SEARCH_PLUGINS
= $(shell cat
$(LOCALE_SRCDIR
)/searchplugins
/list.txt
)
153 libs
:: $(addsuffix .xml
,$(SEARCH_PLUGINS
))
154 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/searchplugins
156 install:: $(addsuffix .xml
,$(SEARCH_PLUGINS
))
157 $(SYSINSTALL
) $(IFLAGS1
) $^
$(DESTDIR
)$(mozappdir
)/searchplugins
159 MICROSUMMARY_GENERATORS
= $(shell cat
$(LOCALE_SRCDIR
)/microsummary-generators
/list.txt
)
160 MICROSUMMARY_GENERATOR_PREFIX
= $(addprefix $(LOCALE_SRCDIR
)/microsummary-generators
/,$(MICROSUMMARY_GENERATORS
))
163 ifneq (,$(strip $(MICROSUMMARY_GENERATORS
)))
164 $(addsuffix .xml
,$(MICROSUMMARY_GENERATOR_PREFIX
))
165 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/microsummary-generators
169 ifneq (,$(strip $(MICROSUMMARY_GENERATORS
)))
170 $(addsuffix .xml
,$(MICROSUMMARY_GENERATOR_PREFIX
))
171 $(SYSINSTALL
) $(IFLAGS1
) $^
$(DESTDIR
)$(mozappdir
)/microsummary-generators
175 @
$(MAKE
) -C ..
/..
/toolkit
/locales libs-
$*
176 @
$(MAKE
) -C ..
/..
/extensions
/reporter
/locales libs AB_CD
=$* XPI_NAME
=locale-
$*
177 @
$(MAKE
) -C ..
/..
/extensions
/spellcheck
/locales AB_CD
=$* XPI_NAME
=locale-
$*
178 @
$(MAKE
) libs AB_CD
=$* XPI_NAME
=locale-
$* PREF_DIR
=defaults
/pref
179 ifdef MOZ_BRANDING_DIRECTORY
180 @
$(MAKE
) -C
$(DEPTH
)/$(MOZ_BRANDING_DIRECTORY
)/locales AB_CD
=$* XPI_NAME
=locale-
$*
183 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
184 MOZ_PKG_MAC_DSSTORE
=$(_ABS_DIST
)/branding
/dsstore
185 MOZ_PKG_MAC_BACKGROUND
=$(_ABS_DIST
)/branding
/background.png
186 MOZ_PKG_MAC_ICON
=$(_ABS_DIST
)/branding
/disk.icns
187 MOZ_PKG_MAC_RSRC
=$(_ABS_DIST
)/branding
/license.r
188 MOZ_PKG_MAC_EXTRA
=--symlink
"/Applications:/ "
192 include $(topsrcdir
)/toolkit
/mozapps
/installer
/packager.mk
193 include $(call EXPAND_LOCALE_SRCDIR
,toolkit
/locales
)/installer
/windows
/charset.mk
195 repackage-win32-installer
: WIN32_INSTALLER_OUT
=$(_ABS_DIST
)/install/sea
/$(PKG_BASENAME
).installer.exe
196 repackage-win32-installer
: $(WIN32_INSTALLER_IN
) $(SUBMAKEFILES
)
197 ifneq (en-US
,$(AB_CD
))
198 @echo
"Verifying $(AB_CD) installer variable usage"
199 @
$(PERL
) $(topsrcdir
)/toolkit
/mozapps
/installer
/windows
/nsis
/check-locales.pl
$(LOCALE_SRCDIR
)/installer
201 @echo
"Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
202 ifdef MOZ_BRANDING_DIRECTORY
203 $(MAKE
) -C
$(DEPTH
)/$(MOZ_BRANDING_DIRECTORY
) export
205 $(MAKE
) -C ..
/installer
/windows
export
207 if
test ! -d
$(dir $(WIN32_INSTALLER_OUT
)); then \
208 $(NSINSTALL
) -D
$(dir $(WIN32_INSTALLER_OUT
)); \
212 $(CYGWIN_WRAPPER
) 7z x
-ol10n-stage
$(WIN32_INSTALLER_IN
)
213 $(RM
) -r l10n-stage
/localized
214 $(RM
) l10n-stage
/setup.exe
215 $(RM
) -rf
$(DIST
)/xpi-stage
/locale-
$(AB_CD
)
216 $(MAKE
) libs-
$(AB_CD
)
217 mv
$(DIST
)/xpi-stage
/locale-
$(AB_CD
) l10n-stage
/localized
218 $(MAKE
) -C ..
/installer
/windows CONFIG_DIR
=l10ngen l10ngen
/setup.exe l10ngen
/7zSD.sfx
219 cp ..
/installer
/windows
/l10ngen
/setup.exe l10n-stage
220 $(NSINSTALL
) -D l10n-stage
/localized
/uninstall
221 cp ..
/installer
/windows
/l10ngen
/helper.exe l10n-stage
/localized
/uninstall
224 $(CYGWIN_WRAPPER
) 7z a
-r
-t7z ..
/app
.7z
-mx
-m0
=BCJ2
-m1
=LZMA
:d24
-m2
=LZMA
:d19
-m3
=LZMA
:d19
-mb0
:1 -mb0s1
:2 -mb0s2
:3
225 cat ..
/installer
/windows
/l10ngen
/7zSD.sfx \
226 $(topsrcdir
)/browser
/installer
/windows
/app.tag \
227 app
.7z
> $(WIN32_INSTALLER_OUT
)
228 chmod
0755 $(WIN32_INSTALLER_OUT
)
230 repackage-win32-installer-
%: WIN32_INSTALLER_IN
=$(_ABS_DIST
)/install/sea
/$(PKG_BASENAME
).installer.exe
231 repackage-win32-installer-
%: $(WIN32_INSTALLER_IN
)
232 @
$(MAKE
) repackage-win32-installer AB_CD
=$* WIN32_INSTALLER_IN
=$(WIN32_INSTALLER_IN
)
234 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
235 STAGEDIST
= $(_ABS_DIST
)/l10n-stage
/$(MOZ_PKG_APPNAME
)/$(_APPNAME
)/Contents
/MacOS
237 STAGEDIST
= $(_ABS_DIST
)/l10n-stage
/$(MOZ_PKG_APPNAME
)
240 repackage-zip
: ZIP_OUT
=$(_ABS_DIST
)/$(PACKAGE
)
241 repackage-zip
: UNPACKAGE
=$(ZIP_IN
)
242 repackage-zip
: $(ZIP_IN
)
243 $(RM
) -r
$(DIST
)/l10n-stage
244 mkdir
$(DIST
)/l10n-stage
245 cd
$(DIST
)/l10n-stage
&& \
247 $(RM
) $(STAGEDIST
)/chrome
/en-US.jar \
248 $(STAGEDIST
)/chrome
/en-US.manifest \
249 $(STAGEDIST
)/defaults
/pref
/firefox-l10n.js
250 $(RM
) -r
$(STAGEDIST
)/microsummary-generators \
251 $(STAGEDIST
)/searchplugins \
252 $(STAGEDIST
)/dictionaries \
253 $(STAGEDIST
)/defaults
/profile \
254 $(STAGEDIST
)/chrome
/en-US
255 $(RM
) -rf
$(DIST
)/xpi-stage
/locale-
$(AB_CD
)
256 $(MAKE
) libs-
$(AB_CD
)
257 ifeq (WINNT
,$(OS_ARCH
))
258 $(RM
) -r
$(STAGEDIST
)/uninstall
259 $(NSINSTALL
) -D
$(STAGEDIST
)/uninstall
260 cp ..
/installer
/windows
/l10ngen
/helper.exe
$(STAGEDIST
)/uninstall
262 $(RM
) -r
$(DIST
)/xpi-stage
/locale-
$(AB_CD
)/chrome
/$(AB_CD
)
263 cd
$(DIST
)/xpi-stage
/locale-
$(AB_CD
) && \
264 tar $(TAR_CREATE_FLAGS
) - * |
( cd
$(STAGEDIST
) && tar -xf
- )
266 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
267 mv
$(_ABS_DIST
)/l10n-stage
/$(MOZ_PKG_APPNAME
)/$(_APPNAME
)/Contents
/Resources
/en.lproj
$(_ABS_DIST
)/l10n-stage
/$(MOZ_PKG_APPNAME
)/$(_APPNAME
)/Contents
/Resources
/$(AB
).lproj
270 cd
$(DIST
)/l10n-stage
; \
272 mv
-f
$(DIST
)/l10n-stage
/$(PACKAGE
) $(DIST
)
274 repackage-zip-
%: ZIP_IN
=$(_ABS_DIST
)/$(PACKAGE
)
275 repackage-zip-
%: $(ZIP_IN
)
276 @
$(MAKE
) repackage-zip AB_CD
=$* ZIP_IN
=$(ZIP_IN
)
278 langpack-
%: LANGPACK_FILE
=$(_ABS_DIST
)/install/firefox-
$(MOZ_APP_VERSION
).
$(AB_CD
).langpack.xpi
280 langpack-
%: XPI_NAME
=locale-
$*
282 @echo
"Making langpack $(LANGPACK_FILE)"
283 $(NSINSTALL
) -D
$(DIST
)/install
284 @
$(RM
) -rf
$(DIST
)/xpi-stage
/locale-
$(AB_CD
)
285 @
$(MAKE
) libs-
$(AB_CD
) USE_EXTENSION_MANIFEST
=1
286 $(PERL
) $(topsrcdir
)/config
/preprocessor.pl
$(DEFINES
) $(ACDEFINES
) -I
$(call EXPAND_LOCALE_SRCDIR
,toolkit
/locales
)/defines.inc
-I
$(LOCALE_SRCDIR
)/defines.inc
$(srcdir)/generic
/install.rdf
> $(FINAL_TARGET
)/install.rdf
287 cd
$(DIST
)/xpi-stage
/locale-
$(AB_CD
) && \
288 $(ZIP
) -r9D
$(LANGPACK_FILE
) install.rdf chrome chrome.manifest
290 # This is a generic target that will make a langpack, repack ZIP (+tarball)
291 # builds, and repack an installer if applicable. It is called from the
292 # tinderbox scripts. Alter it with caution.
294 # Note: the last target called here should be repackage-zip-$* as the l10n build
295 # systems rely on dist/l10n-stage/<product> to be in place in order to package
296 # the complete MAR files.
299 $(NSINSTALL
) -D
$(DIST
)/install
301 ifeq (WINNT
,$(OS_ARCH
))
302 @
$(MAKE
) repackage-win32-installer-
$*
304 @
$(MAKE
) repackage-zip-
$*
307 libs
:: $(addprefix $(LOCALE_SRCDIR
)/,updater
/updater.ini
)
308 ifeq ($(OS_ARCH
),WINNT
)
309 cat
$< $(srcdir)/..
/installer
/windows
/nsis
/updater_append.ini | \
310 iconv
-f UTF-8
-t
$(WIN_INSTALLER_CHARSET
) > $(FINAL_TARGET
)/updater.ini
312 ifneq (,$(filter mac cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
313 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/updater.app
/Contents
/MacOS
315 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)
320 ifdef MOZ_CRASHREPORTER
321 libs
:: $(addprefix $(LOCALE_SRCDIR
)/,crashreporter
/crashreporter-override.ini
)
322 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)