1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
14 # The Original Code is mozilla.org code.
16 # The Initial Developer of the Original Code is
17 # Netscape Communications.
18 # Portions created by the Initial Developer are Copyright (C) 2001
19 # the Initial Developer. All Rights Reserved.
22 # Brian Ryner <bryner@brianryner.com>
23 # Jonathan Wilson <jonwil@tpgi.com.au>
24 # Dan Mosedale <dmose@mozilla.org>
25 # Benjamin Smedberg <benjamin@smedbergs.us>
27 # Alternatively, the contents of this file may be used under the terms of
28 # either the GNU General Public License Version 2 or later (the "GPL"), or
29 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 # in which case the provisions of the GPL or the LGPL are applicable instead
31 # of those above. If you wish to allow use of your version of this file only
32 # under the terms of either the GPL or the LGPL, and not to allow others to
33 # use your version of this file under the terms of the MPL, indicate your
34 # decision by deleting the provisions above and replace them with the notice
35 # and other provisions required by the GPL or the LGPL. If you do not delete
36 # the provisions above, a recipient may use your version of this file under
37 # the terms of any one of the MPL, the GPL or the LGPL.
39 # ***** END LICENSE BLOCK *****
42 topsrcdir
= @top_srcdir@
46 include $(DEPTH
)/config
/autoconf.mk
48 DIRS
= profile
/extensions
50 PREF_JS_EXPORTS
= $(srcdir)/profile
/firefox.js \
51 $(srcdir)/profile
/channel-prefs.js \
55 # hardcode en-US for the moment
58 DEFINES
+= -DAB_CD
=$(AB_CD
)
60 APP_VERSION
= $(shell cat
$(srcdir)/..
/config
/version.txt
)
61 DEFINES
+= -DAPP_VERSION
="$(APP_VERSION)"
63 DIST_FILES
= application.ini
65 GRE_MILESTONE
= $(shell $(PYTHON
) $(topsrcdir
)/config
/printconfigsetting.py
$(LIBXUL_DIST
)/bin
/platform.ini Build Milestone
)
66 GRE_BUILDID
= $(shell $(PYTHON
) $(topsrcdir
)/config
/printconfigsetting.py
$(LIBXUL_DIST
)/bin
/platform.ini Build BuildID
)
68 DEFINES
+= -DGRE_MILESTONE
=$(GRE_MILESTONE
) -DGRE_BUILDID
=$(GRE_BUILDID
)
70 MOZ_SOURCE_STAMP ?
= $(shell hg
-R
$(topsrcdir
) parent
--template
="{node|short}\n" 2>/dev
/null
)
71 ifdef MOZ_SOURCE_STAMP
72 DEFINES
+= -DMOZ_SOURCE_STAMP
="$(MOZ_SOURCE_STAMP)"
75 SOURCE_REPO
:= $(shell hg
-R
$(topsrcdir
) showconfig paths.default
2>/dev
/null | sed
-e
"s/^ssh:/http:/")
77 DEFINES
+= -DMOZ_SOURCE_REPO
="$(SOURCE_REPO)"
80 LIBS
+= $(JEMALLOC_LIBS
)
83 include $(topsrcdir
)/config
/rules.mk
85 # Build a binary bootstrapping with XRE_main
87 ifneq (,$(filter OS2 WINCE WINNT
,$(OS_ARCH
)))
88 PROGRAM
= $(MOZ_APP_NAME
)$(BIN_SUFFIX
)
90 PROGRAM
= $(MOZ_APP_NAME
)-bin
$(BIN_SUFFIX
)
93 CPPSRCS
= nsBrowserApp.
cpp
95 LOCAL_INCLUDES
+= -I
$(topsrcdir
)/toolkit
/xre
97 ifdef BUILD_STATIC_LIBS
99 STATIC_COMPONENTS_LINKER_PATH
= -LIBPATH
:$(DEPTH
)/staticlib
101 STATIC_COMPONENTS_LINKER_PATH
= -L
$(DEPTH
)/staticlib
103 LIBS
+= $(DEPTH
)/toolkit
/xre
/$(LIB_PREFIX
)xulapp_s.
$(LIB_SUFFIX
)
105 ifeq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
106 LIBS
+= $(DIST
)/bin
/XUL
108 EXTRA_DSO_LIBS
+= xul
112 ifeq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
113 TK_LIBS
:= $(TK_LIBS
)
116 ifdef MOZ_ENABLE_LIBXUL
117 APP_XPCOM_LIBS
= $(XPCOM_GLUE_LDOPTS
)
119 MOZILLA_INTERNAL_API
= 1
120 APP_XPCOM_LIBS
= $(XPCOM_LIBS
)
124 $(STATIC_COMPONENTS_LINKER_PATH
) \
132 # Add explicit X11 dependency when building against X11 toolkits
133 ifneq (,$(filter gtk2
,$(MOZ_WIDGET_TOOLKIT
)))
134 LIBS
+= $(XLDFLAGS
) $(XLIBS
) $(ZLIB_LIBS
)
141 ifndef MOZ_WINCONSOLE
149 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
150 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
153 include $(topsrcdir
)/config
/config.mk
156 # Always enter a Windows program through wmain, whether or not we're
157 # a console application.
159 WIN32_EXE_LDFLAGS
+= -ENTRY
:mainWCRTStartup
161 WIN32_EXE_LDFLAGS
+= -ENTRY
:wmainCRTStartup
166 EXTRA_DSO_LDOPTS
+= $(call EXPAND_LIBNAME
,corelibc
)
169 ifdef BUILD_STATIC_LIBS
170 include $(topsrcdir
)/config
/static-config.mk
173 $(STATIC_EXTRA_DEPS
) \
175 DEFINES
+= $(STATIC_DEFINES
)
176 CPPSRCS
+= $(STATIC_CPPSRCS
)
177 EXTRA_DSO_LIBS
+= $(STATIC_EXTRA_DSO_LIBS
)
178 EXTRA_LIBS
+= $(STATIC_EXTRA_LIBS
)
181 ifeq ($(OS_ARCH
),WINNT
)
182 OS_LIBS
+= $(call EXPAND_LIBNAME
,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool
)
183 OS_LIBS
+= $(call EXPAND_LIBNAME
,usp10 msimg32
)
186 ifneq (,$(filter WINNT WINCE
,$(OS_ARCH
)))
187 RCINCLUDE
= splash.rc
189 RCFLAGS
+= -DMOZ_PHOENIX
-I
$(srcdir)
191 RCFLAGS
+= -DMOZ_PHOENIX
--include-dir
$(srcdir)
193 ifdef BUILD_STATIC_LIBS
194 RCFLAGS
+= -DMOZ_STATIC_BUILD
201 ifeq ($(OS_ARCH
),BeOS
)
202 BEOS_PROGRAM_RESOURCE
= $(srcdir)/apprunner-beos.rsrc
203 ifdef BUILD_STATIC_LIBS
204 OS_LIBS
+= -ltracker
-lgame
208 ifeq ($(OS_ARCH
),OS2
)
209 RESFILE
=splashos2.res
210 RCFLAGS
+= -DMOZ_PHOENIX
211 ifdef BUILD_STATIC_LIBS
212 RCFLAGS
+= -DMOZ_STATIC_BUILD
-i
$(DIST
)/include
217 RCFLAGS
+= -DFIREFOX_ICO
=\"$(DIST
)/branding
/firefox-os2.ico
\" -DDOCUMENT_ICO
=\"$(DIST
)/branding
/document-os2.ico
\"
220 include $(topsrcdir
)/config
/rules.mk
222 ifdef BUILD_STATIC_LIBS
223 include $(topsrcdir
)/config
/static-rules.mk
225 DEFINES
+= -DIMPL_XREAPI
228 ifeq ($(MOZ_WIDGET_TOOLKIT
),photon
)
232 ifeq ($(OS_ARCH
),WINNT
)
234 # Control the default heap size.
235 # This is the heap returned by GetProcessHeap().
236 # As we use the CRT heap, the default size is too large and wastes VM.
238 # The default heap size is 1MB on Win32.
239 # The heap will grow if need be.
241 # Set it to 256k. See bug 127069.
244 LDFLAGS
+= /HEAP
:0x40000
245 ifeq ($(OS_TEST
),x86_64
)
246 # set stack to 2MB on x64 build. See bug 582910
247 LDFLAGS
+= -STACK
:2097152
252 $(PROGRAM
): $(DEPTH
)/toolkit
/xre
/$(LIB_PREFIX
)xulapp_s.
$(LIB_SUFFIX
)
254 ifneq (,$(filter-out OS2 WINNT WINCE
,$(OS_ARCH
)))
256 $(MOZ_APP_NAME
):: $(topsrcdir
)/build
/unix
/mozilla.in
$(GLOBAL_DEPS
)
257 cat
$< | sed
-e
"s|%MOZAPPDIR%|$(installdir)|" \
258 -e
"s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
261 libs
:: $(MOZ_APP_NAME
)
262 $(INSTALL
) $< $(DIST
)/bin
264 install:: $(MOZ_APP_NAME
)
265 $(SYSINSTALL
) $< $(DESTDIR
)$(bindir)
267 GARBAGE
+= $(MOZ_APP_NAME
)
268 GARBAGE
+= $(addprefix $(DIST
)/bin
/defaults
/pref
/, firefox.js
)
274 DEFINES
+= -DFIREFOX_ICO
=\"$(DIST
)/branding
/firefox.ico
\" -DDOCUMENT_ICO
=\"$(DIST
)/branding
/document.ico
\"
276 ifdef MOZILLA_OFFICIAL
277 DEFINES
+= -DMOZILLA_OFFICIAL
280 ifeq ($(MOZ_WIDGET_TOOLKIT
),gtk2
)
282 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/mozicon128.png
$(DIST
)/bin
/icons
283 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/document.png
$(DIST
)/bin
/icons
284 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/default16.png
$(DIST
)/bin
/chrome
/icons
/default
285 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/default32.png
$(DIST
)/bin
/chrome
/icons
/default
286 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/default48.png
$(DIST
)/bin
/chrome
/icons
/default
289 ifdef MOZ_SPLASHSCREEN
290 ifeq ($(MOZ_WIDGET_TOOLKIT
),windows
)
292 $(INSTALL
) $(IFLAGS1
) $(DIST
)/branding
/splash.bmp
$(DIST
)/bin
299 cp
-f
$(DIST
)/bin
/faststartstub.exe
$(DIST
)/bin
/$(MOZ_APP_NAME
)faststart.exe
303 libs
:: $(srcdir)/profile
/prefs.js
304 $(INSTALL
) $(IFLAGS1
) $^
$(DIST
)/bin
/defaults
/profile
306 libs
:: $(srcdir)/blocklist.xml
307 $(INSTALL
) $(IFLAGS1
) $^
$(DIST
)/bin
309 ifeq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
311 APP_NAME
= $(MOZ_APP_DISPLAYNAME
)
314 APP_NAME
:= $(APP_NAME
)Debug
317 LOWER_APP_NAME
= $(shell echo
$(APP_NAME
) | tr
'[A-Z]' '[a-z]')
319 AB_CD
= $(MOZ_UI_LOCALE
)
321 AB
:= $(firstword $(subst -, ,$(AB_CD
)))
323 clean clobber repackage
::
324 rm -rf
$(DIST
)/$(APP_NAME
).app
332 libs repackage
:: $(PROGRAM
) application.ini
333 mkdir
-p
$(DIST
)/$(APP_NAME
).app
/Contents
/MacOS
334 rsync
-a
--exclude CVS
--exclude
"*.in" $(srcdir)/macbuild
/Contents
$(DIST
)/$(APP_NAME
).app
--exclude English.lproj
335 mkdir
-p
$(DIST
)/$(APP_NAME
).app
/Contents
/Resources
/$(AB
).lproj
336 rsync
-a
--exclude CVS
--exclude
"*.in" $(srcdir)/macbuild
/Contents
/Resources
/English.lproj
/ $(DIST
)/$(APP_NAME
).app
/Contents
/Resources
/$(AB
).lproj
337 sed
-e
"s/%APP_VERSION%/$(APP_VERSION)/" -e
"s/%APP_NAME%/$(APP_NAME)/" -e
"s/%LOWER_APP_NAME%/$(LOWER_APP_NAME)/" $(srcdir)/macbuild
/Contents
/Info.plist.in
> $(DIST
)/$(APP_NAME
).app
/Contents
/Info.plist
338 sed
-e
"s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild
/Contents
/Resources
/English.lproj
/InfoPlist.strings.in | iconv
-f UTF-8
-t UTF-16
> $(DIST
)/$(APP_NAME
).app
/Contents
/Resources
/$(AB
).lproj
/InfoPlist.strings
339 rsync
-a
$(DIST
)/bin
/ $(DIST
)/$(APP_NAME
).app
/Contents
/$(APPFILES
)
340 $(RM
) $(DIST
)/$(APP_NAME
).app
/Contents
/$(APPFILES
)/mangle
$(DIST
)/$(APP_NAME
).app
/Contents
/$(APPFILES
)/shlibsign
342 cp
$(LIBXUL_DIST
)/bin
/$(XR_STUB_NAME
) $(DIST
)/$(APP_NAME
).app
/Contents
/MacOS
/firefox-bin
344 rm -f
$(DIST
)/$(APP_NAME
).app
/Contents
/MacOS
/$(PROGRAM
)
345 rsync
-aL
$(PROGRAM
) $(DIST
)/$(APP_NAME
).app
/Contents
/MacOS
347 -cp
-L
$(DIST
)/bin
/mangle
$(DIST
)/bin
/shlibsign
$(DIST
)/$(APP_NAME
).app
/Contents
/$(APPFILES
)
348 cp
-RL
$(DIST
)/branding
/firefox.icns
$(DIST
)/$(APP_NAME
).app
/Contents
/Resources
/firefox.icns
349 cp
-RL
$(DIST
)/branding
/document.icns
$(DIST
)/$(APP_NAME
).app
/Contents
/Resources
/document.icns
350 printf APPLMOZB
> $(DIST
)/$(APP_NAME
).app
/Contents
/PkgInfo
351 # remove CVS dirs from packaged app
352 find
$(DIST
)/$(APP_NAME
).app
-type d
-name
"CVS" -prune
-exec
rm -rf
{} \
;
357 cp
$(LIBXUL_DIST
)/bin
/$(XULRUNNER_STUB_NAME
)$(BIN_SUFFIX
) $(DIST
)/bin
/firefox
$(BIN_SUFFIX
)
362 ifndef SKIP_COPY_XULRUNNER
364 ifeq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
365 rsync
-a
--copy-unsafe-links
$(LIBXUL_DIST
)/XUL.framework
$(DIST
)/$(APP_NAME
).app
/Contents
/Frameworks
367 $(NSINSTALL
) -D
$(DIST
)/bin
/xulrunner
368 (cd
$(LIBXUL_SDK
)/bin
&& tar $(TAR_CREATE_FLAGS
) - .
) |
(cd
$(DIST
)/bin
/xulrunner
&& tar -xf
-)
370 endif # SKIP_COPY_XULRUNNER