2012-05-31 15:00:27 +04:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
2008-06-02 03:44:22 +04:00
2012-12-14 04:33:20 +04:00
DEPTH = @DEPTH@
2008-06-02 03:44:22 +04:00
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
i n c l u d e $( DEPTH ) / c o n f i g / a u t o c o n f . m k
2009-08-31 18:43:39 +04:00
AB_CD = $( MOZ_UI_LOCALE)
2008-06-02 03:44:22 +04:00
2008-08-19 06:09:18 +04:00
GRE_MILESTONE = $( shell $( PYTHON) $( MOZILLA_SRCDIR) /config/printconfigsetting.py $( LIBXUL_DIST) /bin/platform.ini Build Milestone)
GRE_BUILDID = $( shell $( PYTHON) $( MOZILLA_SRCDIR) /config/printconfigsetting.py $( LIBXUL_DIST) /bin/platform.ini Build BuildID)
2008-06-02 03:44:22 +04:00
2014-01-09 06:02:13 +04:00
LICENSE_TXT_FILE = $( topsrcdir) /im/LICENSE.txt
2008-06-02 03:44:22 +04:00
2011-06-01 14:40:48 +04:00
MOZ_SOURCE_STAMP = $( firstword $( shell hg -R $( topsrcdir) parent --template= "{node|short}\n" 2>/dev/null) )
2010-07-29 04:24:56 +04:00
i f d e f M O Z _ S O U R C E _ S T A M P
DEFINES += -DMOZ_SOURCE_STAMP= " $( MOZ_SOURCE_STAMP) "
2009-06-16 03:29:55 +04:00
e n d i f
SOURCE_REPO := $( shell hg -R $( topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/" )
i f d e f S O U R C E _ R E P O
DEFINES += -DMOZ_SOURCE_REPO= " $( SOURCE_REPO) "
e n d i f
2010-07-29 04:24:56 +04:00
i f d e f M O Z I L L A _ O F F I C I A L
2014-02-19 05:25:25 +04:00
DEFINES += -DMOZILLA_OFFICIAL
2010-07-29 04:24:56 +04:00
e n d i f
2008-06-02 03:44:22 +04:00
PREF_JS_EXPORTS = \
$( srcdir) /profile/all-instantbird.js \
$( srcdir) /profile/channel-prefs.js \
$( NULL)
2014-02-19 05:25:25 +04:00
DEFINES += \
-DAB_CD= $( AB_CD) \
-DAPP_VERSION= " $( MOZ_APP_VERSION) " \
-DINSTANTBIRD_ICO= \" $( DIST) /branding/instantbird.ico\" \
-DGRE_MILESTONE= $( GRE_MILESTONE) \
-DGRE_BUILDID= $( GRE_BUILDID) \
$( NULL)
i f d e f L I B X U L _ S D K
i n c l u d e $( topsrcdir ) / c o n f i g / r u l e s . m k
2008-08-29 01:43:09 +04:00
e l s e
2014-02-19 05:25:25 +04:00
# Build a binary bootstrapping with XRE_main
2008-06-02 03:44:22 +04:00
DIST_FILES = application.ini
2014-02-19 05:25:25 +04:00
DEFINES += -DXPCOM_GLUE
STL_FLAGS =
2008-06-02 03:44:22 +04:00
LIBS += \
2014-02-19 05:25:25 +04:00
$( XPCOM_STANDALONE_GLUE_LDOPTS) \
2011-07-03 19:28:45 +04:00
$( NULL)
2014-02-19 05:25:25 +04:00
i f d e f M O Z _ L I N K E R
LIBS += $( MOZ_ZLIB_LIBS)
2010-07-29 04:24:56 +04:00
e n d i f
2008-06-02 03:44:22 +04:00
i f n d e f M O Z _ W I N C O N S O L E
i f d e f M O Z _ D E B U G
MOZ_WINCONSOLE = 1
e l s e
MOZ_WINCONSOLE = 0
e n d i f
e n d i f
2010-07-29 04:24:56 +04:00
# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
2008-06-02 03:44:22 +04:00
NSDISTMODE = copy
i n c l u d e $( topsrcdir ) / c o n f i g / c o n f i g . m k
i f d e f _ M S C _ V E R
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
e n d i f
i f e q ( $( OS_ARCH ) , W I N N T )
2014-01-23 05:48:24 +04:00
# png to ico converter. The function takes 5 arguments, in order: source png
# file, left, top, size, output ico file.
png2ico = $( PYTHON) $( srcdir) /png2ico.py $( 1) $( 2) $( 3) $( 4) $( 5)
2011-08-10 17:32:14 +04:00
# Extract the icons we care about embedding into the EXE
2014-01-23 05:48:24 +04:00
available-16.ico : $( topsrcdir ) /chat /themes /available -16.png $( srcdir ) /png 2ico .py
2011-08-10 17:32:14 +04:00
$( call png2ico,$( topsrcdir) /chat/themes/available-16.png,0,0,16,available-16.ico)
2014-01-23 05:48:24 +04:00
away-16.ico : $( topsrcdir ) /chat /themes /away -16.png $( srcdir ) /png 2ico .py
2011-08-10 17:32:14 +04:00
$( call png2ico,$( topsrcdir) /chat/themes/away-16.png,0,0,16,away-16.ico)
2014-01-23 05:48:24 +04:00
offline-16.ico : $( topsrcdir ) /chat /themes /offline -16.png $( srcdir ) /png 2ico .py
2011-08-10 17:32:14 +04:00
$( call png2ico,$( topsrcdir) /chat/themes/offline-16.png,0,0,16,offline-16.ico)
2014-01-23 05:48:24 +04:00
embedded-icons :: available -16.ico away -16.ico offline -16.ico
2011-08-10 17:32:14 +04:00
GARBAGE += available-16.ico away-16.ico offline-16.ico
2008-06-02 03:44:22 +04:00
RCINCLUDE = splash.rc
2014-02-19 05:25:25 +04:00
# Rebuild instantbird.exe if the manifest changes - it's included by splash.rc.
# (this dependency should really be just for instantbird.exe, not other targets)
EXTRA_DEPS += $( PROGRAM) .manifest
2008-06-02 03:44:22 +04:00
i f n d e f G N U _ C C
RCFLAGS += -DMOZ_INSTANTBIRD -I$( srcdir)
e l s e
RCFLAGS += -DMOZ_INSTANTBIRD --include-dir $( srcdir)
e n d i f
e n d i f
i n c l u d e $( topsrcdir ) / c o n f i g / r u l e s . m k
i f e q ( $( OS_ARCH ) , W I N N T )
2011-08-10 17:32:14 +04:00
$(RESFILE) : embedded -icons
2008-06-02 03:44:22 +04:00
#
# Control the default heap size.
# This is the heap returned by GetProcessHeap().
# As we use the CRT heap, the default size is too large and wastes VM.
#
# The default heap size is 1MB on Win32.
# The heap will grow if need be.
#
# Set it to 256k. See bug 127069.
#
i f n d e f G N U _ C C
LDFLAGS += /HEAP:0x40000
2014-02-19 05:25:25 +04:00
i f e q ( $( OS_TEST ) , x 8 6 _ 6 4 )
# set stack to 2MB on x64 build. See bug 582910
LDFLAGS += -STACK:2097152
e n d i f
2008-06-02 03:44:22 +04:00
e n d i f
e n d i f
2014-02-25 17:31:41 +04:00
i f n e q ( $( OS_ARCH ) , W I N N T )
2014-01-10 07:13:15 +04:00
libs ::
cp -p $( MOZ_APP_NAME) $( BIN_SUFFIX) $( DIST) /bin/$( MOZ_APP_NAME) -bin$( BIN_SUFFIX)
GARBAGE += $( addprefix $( DIST) /bin/defaults/pref/, all.js all-instantbird.js channel-prefs.js chat-prefs.js)
2014-02-25 17:31:41 +04:00
e n d i f # ! WinNT
2014-01-10 07:13:15 +04:00
2014-02-19 05:25:25 +04:00
e n d i f # LIBXUL_SDK
2008-09-04 05:38:13 +04:00
i f n e q ( , $( filter windows gtk gtk 2,$ ( MOZ_WIDGET_TOOLKIT ) ) )
i f n e q ( , $( filter windows ,$ ( MOZ_WIDGET_TOOLKIT ) ) )
2008-06-02 03:44:22 +04:00
ICON_SUFFIX = .ico
e l s e
2008-09-04 05:23:48 +04:00
ICON_SUFFIX = .png
2008-06-02 03:44:22 +04:00
e n d i f
i f e q ( $( MOZ_WIDGET_TOOLKIT ) , g t k 2 )
ICON_DIR = gtk
e l s e
ICON_DIR = $( MOZ_WIDGET_TOOLKIT)
e n d i f
DESKTOP_ICONS = \
2009-08-31 18:43:39 +04:00
$( NULL)
2008-10-05 04:08:00 +04:00
BRANDED_ICONS = \
2008-09-04 05:23:48 +04:00
blistWindow \
convWindow \
default \
2008-10-05 04:08:00 +04:00
$( NULL)
2008-06-02 03:44:22 +04:00
i f e q ( $( ICON_DIR ) , g t k )
DESKTOP_ICONS_SMALL = $( patsubst %,%16,$( DESKTOP_ICONS) )
2008-09-04 05:23:48 +04:00
DESKTOP_ICONS_LARGE = $( patsubst %,%48,$( DESKTOP_ICONS) )
2008-10-05 04:08:00 +04:00
BRANDED_ICONS_SMALL = $( patsubst %,%16,$( BRANDED_ICONS) )
BRANDED_ICONS_LARGE = $( patsubst %,%48,$( BRANDED_ICONS) )
2008-06-02 03:44:22 +04:00
e n d i f
2008-09-04 05:23:48 +04:00
DESKTOP_ICON_FILES = $( addsuffix $( ICON_SUFFIX) , $( DESKTOP_ICONS) $( DESKTOP_ICONS_SMALL) $( DESKTOP_ICONS_LARGE) )
2008-10-05 04:08:00 +04:00
BRANDED_ICON_FILES = $( addsuffix $( ICON_SUFFIX) , $( BRANDED_ICONS) $( BRANDED_ICONS_SMALL) $( BRANDED_ICONS_LARGE) )
2008-06-02 03:44:22 +04:00
2008-10-05 04:08:00 +04:00
#libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
# $(INSTALL) $^ $(DIST)/bin/chrome/icons/default
libs :: $( addprefix $ ( DIST ) /branding /,$ ( BRANDED_ICON_FILES ) )
2008-06-02 03:44:22 +04:00
$( INSTALL) $^ $( DIST) /bin/chrome/icons/default
e n d i f
i f e q ( $( MOZ_WIDGET_TOOLKIT ) , g t k 2 )
libs ::
2008-09-04 05:23:48 +04:00
$( INSTALL) $( DIST) /branding/default16.png $( DIST) /bin/chrome/icons/default
2008-06-02 03:44:22 +04:00
e n d i f
2013-04-15 06:28:28 +04:00
i f n e q ( , $( filter -out WINNT Darwin ,$ ( OS_ARCH ) ) )
2008-08-29 01:43:09 +04:00
i f d e f L I B X U L _ S D K
libs ::
cp $( LIBXUL_DIST) /bin/xulrunner-stub$( BIN_SUFFIX) $( DIST) /bin/$( STUBNAME)
e n d i f
2010-07-29 04:24:56 +04:00
GARBAGE += $( MOZ_APP_NAME)
2008-06-02 03:44:22 +04:00
GARBAGE += $( addprefix $( DIST) /bin/defaults/pref/, all.js all-instantbird.js channel-prefs.js)
e n d i f
i f n e q ( , $( filter gtk gtk 2,$ ( MOZ_WIDGET_TOOLKIT ) ) )
ICON_FILES = \
2008-09-04 05:23:48 +04:00
$( DIST) /branding/default16.png \
$( DIST) /branding/mozicon128.png \
2008-06-02 03:44:22 +04:00
$( DIST) /branding/mozicon50.xpm \
$( DIST) /branding/mozicon16.xpm \
$( NULL)
libs ::
$( INSTALL) $( ICON_FILES) $( DIST) /bin/icons
e n d i f
2009-07-25 16:02:23 +04:00
i f d e f M O Z _ S P L A S H S C R E E N
i f e q ( $( MOZ_WIDGET_TOOLKIT ) , w i n d o w s )
libs ::
if test -f $( DIST) /branding/splash.bmp; then \
$( INSTALL) $( IFLAGS1) $( DIST) /branding/splash.bmp $( DIST) /bin; \
fi
e n d i f
e n d i f
2012-08-02 03:41:00 +04:00
libs :: $( LICENSE_TXT_FILE )
2009-12-06 04:51:58 +03:00
i f e q ( $( OS_ARCH ) , W I N N T )
$( EXIT_ON_ERROR) \
for file in $^; do \
$( PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $$ file > $( FINAL_TARGET) /` basename $$ file` ; \
done
e l s e
$( SYSINSTALL) $( IFLAGS1) $^ $( FINAL_TARGET)
e n d i f
module.ver : module .ver .in $( DEPTH ) /config /autoconf .mk
sed 's/@' 'MODULE_PRODUCTVERSION@/' ` echo $( INSTANTBIRD_VERSION) | sed 's/[a-z].*//; s/\./,/g; s/^\([0-9]*,[0-9]*\)$$/\1,0/; s/^\([0-9]*,[0-9]*,[0-9]*\)$$/\1,0/' ` '/;s/@' 'MODULE_PRODUCTVERSION_STRING@/$(INSTANTBIRD_VERSION)/' $< > $@
_RC_STRING += -SRCDIR .
module.rc : module .ver
GARBAGE += module.ver
libs :: $( srcdir ) /profile /prefs .js
2010-07-29 04:24:56 +04:00
$( INSTALL) $( IFLAGS1) $^ $( DIST) /bin/defaults/profile
2009-12-06 04:51:58 +03:00
2014-02-19 05:25:25 +04:00
i f d e f E N A B L E _ T E S T S
2013-09-27 04:40:24 +04:00
# XXX This is a hack to ensure that we get the right xpcshell.ini for our tests.
# mozilla-central does this in testing/xpcshell-tests which means that it is very
# hard for anyone to specify anything else.
libs ::
2014-01-09 06:02:13 +04:00
$( INSTALL) $( topsrcdir) /im/test/xpcshell.ini $( MOZDEPTH) /_tests/xpcshell
cp $( topsrcdir) /im/test/xpcshell.ini $( MOZDEPTH) /_tests/xpcshell/all-test-dirs.list
2014-02-19 05:25:25 +04:00
e n d i f
2013-09-27 04:40:24 +04:00
2010-07-29 04:24:56 +04:00
i f e q ( c o c o a , $( MOZ_WIDGET_TOOLKIT ) )
2008-06-02 03:44:22 +04:00
2012-03-20 03:35:31 +04:00
MAC_APP_NAME = $( MOZ_APP_DISPLAYNAME)
2010-07-29 04:24:56 +04:00
2008-06-02 03:44:22 +04:00
i f d e f M O Z _ D E B U G
2012-03-20 03:35:31 +04:00
MAC_APP_NAME := $( MAC_APP_NAME) Debug
2008-06-02 03:44:22 +04:00
e n d i f
2014-02-19 05:25:25 +04:00
AB_CD = $( MOZ_UI_LOCALE)
AB := $( firstword $( subst -, ,$( AB_CD) ) )
clean clobber repackage ::
$( RM) -r $( DIST) /$( MOZ_MACBUNDLE_NAME)
i f d e f L I B X U L _ S D K
APPFILES = Resources
e l s e
APPFILES = MacOS
e n d i f
tools repackage :: $( PROGRAM )
$( MKDIR) -p $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/MacOS
rsync -a --exclude "*.in" $( srcdir) /macbuild/Contents $( DIST) /$( MOZ_MACBUNDLE_NAME) --exclude English.lproj
$( MKDIR) -p $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/Resources/$( AB) .lproj
rsync -a --exclude "*.in" $( srcdir) /macbuild/Contents/Resources/English.lproj/ $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/Resources/$( AB) .lproj
2012-03-20 03:35:31 +04:00
sed -e " s/%APP_VERSION%/ $( MOZ_APP_VERSION) / " -e " s/%MAC_APP_NAME%/ $( MAC_APP_NAME) / " $( srcdir) /macbuild/Contents/Info.plist.in > $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/Info.plist
sed -e " s/%MAC_APP_NAME%/ $( MAC_APP_NAME) / " $( srcdir) /macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/Resources/$( AB) .lproj/InfoPlist.strings
2014-02-19 05:25:25 +04:00
rsync -a $( DIST) /bin/ $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/$( APPFILES)
i f d e f L I B X U L _ S D K
cp $( LIBXUL_DIST) /bin/$( XR_STUB_NAME) $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/MacOS/instantbird
e l s e
$( RM) $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/MacOS/$( PROGRAM)
2012-03-20 03:35:31 +04:00
rsync -aL $( PROGRAM) $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/MacOS
2014-02-19 05:25:25 +04:00
e n d i f
2012-03-20 03:35:31 +04:00
cp -RL $( DIST) /branding/instantbird.icns $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/Resources/instantbird.icns
printf APPLMOZM > $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/PkgInfo
2014-02-19 05:25:25 +04:00
e l s e
i f d e f L I B X U L _ S D K
libs ::
cp $( LIBXUL_DIST) /bin/$( XULRUNNER_STUB_NAME) $( BIN_SUFFIX) $( DIST) /bin/instantbird$( BIN_SUFFIX)
2008-06-02 03:44:22 +04:00
e n d i f
2014-02-19 05:25:25 +04:00
e n d i f
i f d e f L I B X U L _ S D K
i f n d e f S K I P _ C O P Y _ X U L R U N N E R
libs ::
i f e q ( c o c o a , $( MOZ_WIDGET_TOOLKIT ) )
rsync -a --copy-unsafe-links $( LIBXUL_DIST) /XUL.framework $( DIST) /$( MOZ_MACBUNDLE_NAME) /Contents/Frameworks
e l s e
$( NSINSTALL) -D $( DIST) /bin/xulrunner
( cd $( LIBXUL_SDK) /bin && tar $( TAR_CREATE_FLAGS) - .) | ( cd $( DIST) /bin/xulrunner && tar -xf -)
e n d i f # cocoa
e n d i f # SKIP_COPY_XULRUNNER
e n d i f # LIBXUL_SDK
2010-07-29 04:24:56 +04:00
# Note that anything you do to dist/ down here isn't going to make it into the
# Mac build, since it's already been copied over to the .app, above.