1999-12-15 09:40:24 +00:00
#
2004-07-16 18:13:26 +00:00
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
1998-08-21 03:34:44 +00:00
#
2004-07-16 18:13:26 +00:00
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
1998-08-21 03:34:44 +00:00
#
1999-11-06 03:43:54 +00:00
# The Original Code is mozilla.org code.
#
2004-07-16 18:13:26 +00:00
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
1999-11-06 03:43:54 +00:00
#
2004-07-16 18:13:26 +00:00
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
1998-08-21 03:34:44 +00:00
#
2004-07-16 18:13:26 +00:00
# ***** END LICENSE BLOCK *****
1998-08-21 03:34:44 +00:00
DEPTH = .
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
2009-03-11 20:32:10 +00:00
i f n d e f . P Y M A K E
i f e q ( , $( MAKE_VERSION ) )
$( error GNU Make is required )
e n d i f
i f e q ( , $( filter -out 3.78 3.79,$ ( MAKE_VERSION ) ) )
$( error GNU Make 3.80 or higher is required )
e n d i f
e n d i f
1998-08-21 03:34:44 +00:00
i n c l u d e $( DEPTH ) / c o n f i g / a u t o c o n f . m k
2008-12-19 14:50:24 +00:00
default ::
2005-11-08 17:53:54 +00:00
2006-08-29 16:53:40 +00:00
TIERS += base
2000-05-03 22:49:47 +00:00
2006-08-29 16:53:40 +00:00
#
# tier "base" - basic setup
2007-09-10 17:36:17 +00:00
#
2006-08-29 16:53:40 +00:00
tier_base_dirs = \
2006-03-09 05:47:25 +00:00
config \
build \
2007-10-10 23:03:14 +00:00
probes \
2006-03-09 05:47:25 +00:00
$( NULL)
2010-03-24 10:07:45 +00:00
i f n d e f L I B X U L _ S D K
tier_base_dirs += \
memory \
$( NULL)
2010-10-15 18:28:32 +00:00
i f e q ( $( OS_TARGET ) , A n d r o i d )
tier_base_dirs += other-licenses/android
e n d i f
2010-03-24 10:07:45 +00:00
e n d i f
2009-07-13 11:48:46 +00:00
i f d e f C O M P I L E _ E N V I R O N M E N T
2006-08-29 16:53:40 +00:00
i n c l u d e $( topsrcdir ) / $( MOZ_BUILD_APP ) / b u i l d . m k
2009-07-13 11:48:46 +00:00
e n d i f
2006-03-09 05:47:25 +00:00
2002-10-25 05:59:52 +00:00
2008-12-19 14:50:24 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / c o n f i g . m k
2008-03-14 15:18:24 +00:00
GARBAGE_DIRS += dist _javagen _profile _tests staticlib
2000-03-17 00:49:15 +00:00
DIST_GARBAGE = config.cache config.log config.status config-defs.h \
2010-02-04 14:19:00 +00:00
dependencies.beos config/autoconf.mk \
2002-08-22 00:50:51 +00:00
unallmakefiles mozilla-config.h \
2008-01-28 22:05:47 +00:00
netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
2007-09-10 17:36:17 +00:00
$( topsrcdir) /.mozconfig.mk $( topsrcdir) /.mozconfig.out
1998-10-28 03:40:33 +00:00
2010-03-10 20:35:31 +00:00
i f d e f W I N C E
2010-03-10 18:36:45 +00:00
check ::
$( PYTHON) $( topsrcdir) /build/mobile/devicemanager-utils.py copy $( DIST) /bin
e n d i f
2010-10-07 16:10:54 +00:00
default alldep all :: $( topsrcdir ) /configure config .status
2008-12-19 14:50:24 +00:00
$( RM) -rf $( DIST) /sdk
$( RM) -rf $( DIST) /include
$( RM) -rf $( DIST) /private
$( RM) -rf $( DIST) /public
$( RM) -rf $( DIST) /bin/components
$( RM) -rf _tests
2010-01-23 00:39:13 +00:00
$(topsrcdir)/configure : $( topsrcdir ) /configure .in
@echo "STOP! configure.in has changed, and your configure is out of date."
@echo "Please rerun autoconf and re-configure your build directory."
@echo "To ignore this message, touch 'configure' in the source directory,"
@echo "but your build might not succeed."
@exit 1
config.status : $( topsrcdir ) /configure
@echo "STOP! configure has changed and needs to be run in this build directory."
@echo "Please rerun configure."
@echo "To ignore this message, touch 'config.status' in the build directory,"
@echo "but your build might not succeed."
@exit 1
2002-10-25 05:59:52 +00:00
# Build pseudo-external modules first when export is explicitly called
2002-01-25 22:29:51 +00:00
export ::
2004-03-23 20:58:21 +00:00
$( RM) -rf $( DIST) /sdk
2002-01-25 22:29:51 +00:00
$( MAKE) -C config export
2006-08-25 10:45:39 +00:00
$( MAKE) tier_nspr
2002-04-25 20:40:00 +00:00
2008-12-19 14:50:24 +00:00
i f d e f E N A B L E _ T E S T S
# Additional makefile targets to call automated test suites
i n c l u d e $( topsrcdir ) / t e s t i n g / t e s t s u i t e - t a r g e t s . m k
e n d i f
2000-03-14 06:16:27 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / r u l e s . m k
2000-02-23 22:47:39 +00:00
2000-12-12 21:28:24 +00:00
distclean ::
cat unallmakefiles | $( XARGS) rm -f
rm -f unallmakefiles $( DIST_GARBAGE)
2002-03-01 01:01:42 +00:00
2007-05-02 18:45:36 +00:00
i f e q ( $( OS_ARCH ) , W I N N T )
# we want to copy PDB files on Windows
MAKE_SYM_STORE_ARGS := -c
2008-02-27 00:54:47 +00:00
i f d e f P D B S T R _ P A T H
MAKE_SYM_STORE_ARGS += -i
e n d i f
2007-08-21 21:52:54 +00:00
i f e q ( , $( CYGWIN_WRAPPER ) )
# this doesn't work with Cygwin Python
MAKE_SYM_STORE_ARGS += --vcs-info
e n d i f
2007-08-19 18:06:53 +00:00
DUMP_SYMS_BIN ?= $( topsrcdir) /toolkit/crashreporter/tools/win32/dump_syms.exe
2007-06-27 10:25:14 +00:00
# PDB files don't get moved to dist, so we need to scan the whole objdir
MAKE_SYM_STORE_PATH := .
2007-05-02 18:45:36 +00:00
e n d i f
i f e q ( $( OS_ARCH ) , D a r w i n )
# need to pass arch flags for universal builds
i f d e f U N I V E R S A L _ B I N A R Y
2010-09-26 22:06:01 +00:00
MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
2007-06-27 10:25:14 +00:00
MAKE_SYM_STORE_PATH := $( DIST) /universal
2007-05-02 18:45:36 +00:00
e l s e
2009-03-11 15:56:57 +00:00
MAKE_SYM_STORE_ARGS := -c -a $( OS_TEST) --vcs-info
2007-06-27 10:25:14 +00:00
MAKE_SYM_STORE_PATH := $( DIST) /bin
2007-05-02 18:45:36 +00:00
e n d i f
2007-08-19 18:06:53 +00:00
DUMP_SYMS_BIN ?= $( DIST) /host/bin/dump_syms
2007-05-02 18:45:36 +00:00
e n d i f
2008-03-20 01:13:36 +00:00
i f e q ( , $( filter -out Linux SunOS ,$ ( OS_ARCH ) ) )
2009-03-11 15:56:57 +00:00
MAKE_SYM_STORE_ARGS := -c --vcs-info
2007-08-19 18:06:53 +00:00
DUMP_SYMS_BIN ?= $( DIST) /host/bin/dump_syms
2007-06-27 10:25:14 +00:00
MAKE_SYM_STORE_PATH := $( DIST) /bin
2007-05-22 20:20:55 +00:00
e n d i f
2002-03-01 01:01:42 +00:00
2009-02-17 07:46:32 +00:00
SYM_STORE_SOURCE_DIRS := $( topsrcdir)
2009-02-17 14:18:50 +00:00
i n c l u d e $( topsrcdir ) / t o o l k i t / m o z a p p s / i n s t a l l e r / p a c k a g e - n a m e . m k
2007-05-28 01:57:56 +00:00
i f d e f M O Z _ S Y M B O L S _ E X T R A _ B U I L D I D
EXTRA_BUILDID := -$( MOZ_SYMBOLS_EXTRA_BUILDID)
e n d i f
2010-11-01 18:47:16 +00:00
export SYMBOL_INDEX_NAME = \
2010-10-13 18:27:44 +00:00
$( MOZ_APP_NAME) -$( MOZ_APP_VERSION) -$( OS_TARGET) -$( BUILDID) $( EXTRA_BUILDID) -symbols.txt
2007-09-10 17:36:17 +00:00
2007-01-11 23:42:21 +00:00
buildsymbols :
2007-08-08 15:19:57 +00:00
i f d e f M O Z _ C R A S H R E P O R T E R
2007-03-26 14:55:27 +00:00
echo building symbol store
2009-03-10 17:36:14 +00:00
$( RM) -rf $( DIST) /crashreporter-symbols
2009-05-16 11:55:23 +00:00
$( RM) -f " $( DIST) / $( SYMBOL_ARCHIVE_BASENAME) .zip "
2009-03-10 17:36:14 +00:00
$( NSINSTALL) -D $( DIST) /crashreporter-symbols
2009-02-17 07:46:32 +00:00
$( PYTHON) $( topsrcdir) /toolkit/crashreporter/tools/symbolstore.py \
$( MAKE_SYM_STORE_ARGS) \
$( foreach dir,$( SYM_STORE_SOURCE_DIRS) ,-s $( dir) ) \
$( DUMP_SYMS_BIN) \
2009-03-10 17:36:14 +00:00
$( DIST) /crashreporter-symbols \
2009-02-17 07:46:32 +00:00
$( MAKE_SYM_STORE_PATH) > \
2009-03-10 17:36:14 +00:00
$( DIST) /crashreporter-symbols/$( SYMBOL_INDEX_NAME)
2007-01-11 23:42:21 +00:00
echo packing symbols
2009-11-04 14:59:47 +00:00
$( NSINSTALL) -D $( DIST) /$( PKG_PATH)
2009-03-10 17:36:14 +00:00
cd $( DIST) /crashreporter-symbols && \
2010-04-23 20:00:06 +00:00
zip -r9D " ../ $( PKG_PATH) $( SYMBOL_FULL_ARCHIVE_BASENAME) .zip " .
cd $( DIST) /crashreporter-symbols && \
zip -r9D " ../ $( PKG_PATH) $( SYMBOL_ARCHIVE_BASENAME) .zip " . -i "*.sym"
2010-01-14 14:52:33 +00:00
e l s e
i f d e f W I N C E
i f d e f S Y M B O L S T O R E _ P A T H
echo building symbol store with symstore.exe
$( RM) -rf $( DIST) /symbols
$( RM) -f " $( DIST) / $( SYMBOL_ARCHIVE_BASENAME) .zip "
$( NSINSTALL) -D $( DIST) /symbols
$( SYMBOLSTORE_PATH) add -r -f " $( subst /,\, $( shell pwd -W) ) \*.PDB " \
-s $( DIST) /symbols/ -t " $( MOZ_PKG_APPNAME) " -v " $( MOZ_PKG_VERSION) "
echo packing symbols
$( NSINSTALL) -D $( DIST) /$( PKG_PATH)
cd $( DIST) /symbols && \
zip -r9D " ../ $( PKG_PATH) $( SYMBOL_ARCHIVE_BASENAME) .zip " .
e n d i f # SYMBOLSTORE_PATH
e n d i f # WINCE
2007-08-08 15:19:57 +00:00
e n d i f # MOZ_CRASHREPORTER
2007-01-11 23:42:21 +00:00
2006-12-06 01:16:05 +00:00
uploadsymbols :
2007-08-08 15:19:57 +00:00
i f d e f M O Z _ C R A S H R E P O R T E R
2010-04-23 20:00:06 +00:00
$( SHELL) $( topsrcdir) /toolkit/crashreporter/tools/upload_symbols.sh " $( DIST) / $( PKG_PATH) $( SYMBOL_FULL_ARCHIVE_BASENAME) .zip "
2006-12-06 01:16:05 +00:00
e n d i f
2010-02-25 16:19:35 +00:00
# defined in package-name.mk
2009-12-20 14:25:48 +00:00
export MOZ_SOURCE_STAMP
2008-02-20 23:29:11 +00:00
#XXX: this is a hack, since we don't want to clobber for MSVC
# PGO support, but we can't do this test in client.mk
i f n e q ( $( OS_ARCH ) _ $( GNU_CC ) , W I N N T _ )
2008-03-06 11:57:21 +00:00
# No point in clobbering if PGO has been explicitly disabled.
i f n d e f N O _ P R O F I L E _ G U I D E D _ O P T I M I Z E
2009-12-03 08:20:11 +00:00
maybe_clobber_profiledbuild : clean
2008-02-20 23:29:11 +00:00
e l s e
maybe_clobber_profiledbuild :
e n d i f
2008-03-06 11:57:21 +00:00
e l s e
maybe_clobber_profiledbuild :
e n d i f
2008-02-20 23:29:11 +00:00
.PHONY : maybe_clobber_profiledbuild
2010-10-13 12:43:03 +00:00
# Look for R_386_PC32 relocations in shared libs, these
# break x86_64 builds and SELinux users.
i f e q ( $( OS_TARGET ) _ $( TARGET_XPCOM_ABI ) , L i n u x _ x 8 6 - g c c 3 )
scheck ::
@relcount= ` find $( DIST) /bin -name "*.so" | xargs objdump -R | grep R_386_PC32 | wc -l` && if test $$ relcount -gt 0; then echo "FAILED: R_386_PC32 relocations detected in a shared library. Did you use a system header without adding it to config/system-headers?" ; exit 1; else echo "PASSED" ; fi
e n d i f