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/.
7 topsrcdir
= @top_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
20 vpath crashreporter
%.ini
$(LOCALE_MERGEDIR
)/browser
/crashreporter
22 vpath crashreporter
%.ini
$(LOCALE_SRCDIR
)/crashreporter
24 vpath crashreporter
%.ini @
srcdir@
/en-US
/crashreporter
27 vpath book
%.inc
$(LOCALE_MERGEDIR
)/browser
/profile
29 vpath book
%.inc
$(LOCALE_SRCDIR
)/profile
31 vpath book
%.inc @
srcdir@
/en-US
/profile
36 $(DEPTH
)/$(MOZ_BRANDING_DIRECTORY
)/Makefile \
37 $(DEPTH
)/$(MOZ_BRANDING_DIRECTORY
)/locales
/Makefile \
40 # This makefile uses variable overrides from the libs-% target to
41 # build non-default locales to non-default dist/ locations. Be aware!
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
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:/ "
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
; \
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"; \
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.
87 # metro build, include both app folders
88 DIST_SUBDIRS
= browser metro
90 DIST_SUBDIRS
= $(DIST_SUBDIR
)
93 GENERATED_DIRS_libs
= $(DIST
)/bin
95 include $(topsrcdir
)/config
/rules.mk
97 include $(topsrcdir
)/toolkit
/locales
/l10n.mk
99 $(STAGEDIST
): $(DIST
)/branding
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
; \
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
; \
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 \
128 -DAB_CD
=$(NO_JA_JP_MAC_AB_CD
) \
129 $(srcdir)/generic
/profile
/bookmarks.html.in \
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
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
)
160 @
$(MAKE
) -C ..
/metro
/locales AB_CD
=$* XPI_NAME
=locale-
$*
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 \
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-
%
183 repackage-win32-installer-
%: ;
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"
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
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
227 ifdef MOZ_CRASHREPORTER
228 libs
:: crashreporter-override.ini
229 $(SYSINSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)
233 @printf
"fx_revision "
234 @
$(PYTHON
) $(topsrcdir
)/config
/printconfigsetting.py \
235 $(STAGEDIST
)/application.ini App SourceStamp
237 @
$(PYTHON
) $(topsrcdir
)/config
/printconfigsetting.py \
238 $(STAGEDIST
)/application.ini App BuildID
241 ifdef LOCALE_MERGEDIR
242 $(RM
) -rf
$(LOCALE_MERGEDIR
)
243 MACOSX_DEPLOYMENT_TARGET
= compare-locales
-m
$(LOCALE_MERGEDIR
) $(srcdir)/l10n.ini
$(L10NBASEDIR
) $*
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
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