1999-12-15 12:40:24 +03:00
#
2012-05-21 15:12:37 +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/.
1998-08-21 07:34:44 +04:00
2009-03-11 23:32:10 +03: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
2013-10-17 02:55:14 +04:00
make_min_ver := 3.81
i f n e q ( $( make_min_ver ) , $( firstword $ ( sort $ ( make_min_ver ) $ ( MAKE_VERSION ) ) ) )
$( error GNU Make $ ( make_min_ver ) or higher is required )
2009-03-11 23:32:10 +03:00
e n d i f
e n d i f
2013-05-17 21:54:53 +04:00
export TOPLEVEL_BUILD := 1
2008-12-19 17:50:24 +03:00
default ::
2005-11-08 20:53:54 +03:00
2009-07-13 15:48:46 +04: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 20:53:40 +04:00
i n c l u d e $( topsrcdir ) / $( MOZ_BUILD_APP ) / b u i l d . m k
2009-07-13 15:48:46 +04:00
e n d i f
2006-03-09 08:47:25 +03:00
2002-10-25 09:59:52 +04:00
2008-12-19 17:50:24 +03:00
i n c l u d e $( topsrcdir ) / c o n f i g / c o n f i g . m k
2013-09-25 02:05:43 +04:00
GARBAGE_DIRS += dist _javagen _profile staticlib
2012-08-29 10:55:58 +04:00
DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
Bug 627277 - Remove (broken) BeOS support. r=biesi,dwitte,gavin,joe,jorendorff,josh,khuey,mfinkle,neil,Pike,roc,shaver,smontagu,taras
2011-02-19 22:10:24 +03:00
config/autoconf.mk \
2013-08-22 10:55:59 +04:00
mozilla-config.h \
2008-01-29 01:05:47 +03:00
netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
2013-09-05 04:01:44 +04:00
.mozconfig.mk
1998-10-28 06:40:33 +03:00
2013-04-12 18:03:06 +04:00
i f n d e f M O Z _ P R O F I L E _ U S E
2013-05-21 10:26:20 +04:00
# We need to explicitly put backend.RecursiveMakeBackend.built here
# otherwise the rule in rules.mk doesn't run early enough.
2013-10-02 03:53:23 +04:00
libs binaries export tools :: CLOBBER $( topsrcdir ) /configure config .status backend .RecursiveMakeBackend .built
2013-10-01 03:25:38 +04:00
i f n d e f L I B X U L _ S D K
2013-10-02 03:53:23 +04:00
libs binaries export tools :: js -config -status
2013-10-01 03:25:38 +04:00
e n d i f
2013-04-12 18:03:06 +04:00
e n d i f
2008-12-19 17:50:24 +03:00
2013-03-29 21:34:58 +04:00
CLOBBER : $( topsrcdir ) /CLOBBER
@echo "STOP! The CLOBBER file has changed."
@echo "Please run the build through a sanctioned build wrapper, such as"
@echo "'mach build' or client.mk."
@exit 1
2010-01-23 03:39:13 +03: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
2013-10-01 03:25:38 +04:00
i f n d e f L I B X U L _ S D K
2013-09-17 04:49:44 +04:00
.PHONY : js -config -status
js-config-status :
$( call SUBMAKE,backend.RecursiveMakeBackend.built,js/src,1)
2013-10-01 03:25:38 +04:00
e n d i f
2013-09-17 04:49:44 +04:00
install_manifests := bin idl include public private sdk
install_manifest_depends = \
CLOBBER \
$( topsrcdir) /configure \
config.status \
backend.RecursiveMakeBackend.built \
$( NULL)
2013-10-01 03:25:38 +04:00
i f n d e f L I B X U L _ S D K
install_manifest_depends += js-config-status
e n d i f
2013-09-17 04:49:44 +04:00
.PHONY : install -manifests
install-manifests : $( addprefix install -dist -,$ ( install_manifests ) )
.PHONY : $( addprefix install -dist -,$ ( install_manifests ) )
$(addprefix install-dist-,$(install_manifests)) : install -dist -%: $( install_manifest_depends )
2013-10-01 03:25:38 +04:00
$( call py_action,process_install_manifest,$( if $( NO_REMOVE) ,--no-remove ) $( DIST) /$* _build_manifests/install/dist_$* $( if $( LIBXUL_SDK) ,,js/src/_build_manifests/install/dist_$* ) )
2013-09-17 04:49:44 +04:00
.PHONY : install -tests
install-manifests : install -tests
install-tests : $( install_manifest_depends )
$( call py_action,process_install_manifest,$( if $( NO_REMOVE) ,--no-remove ) _tests _build_manifests/install/tests js/src/_build_manifests/install/tests)
2013-09-25 02:05:43 +04:00
# _tests should be purged during cleaning. However, we don't want it purged
# during PGO builds because it contains some auto-generated files.
i f n e q ( $( filter -out maybe_clobber_profiledbuild ,$ ( MAKECMDGOALS ) ) , )
GARBAGE_DIRS += _tests
e n d i f
2013-09-17 04:49:44 +04:00
# Windows PGO builds don't perform a clean before the 2nd pass. So, we want
# to preserve content for the 2nd pass on Windows. Everywhere else, we always
# process the install manifests as part of export.
i f d e f M O Z _ P R O F I L E _ U S E
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
i f n e q ( $( OS_ARCH ) _ $( GNU_CC ) , W I N N T _ )
export :: install -manifests
2013-10-02 03:53:23 +04:00
binaries ::
@$( MAKE) install-manifests NO_REMOVE = 1
2013-09-17 04:49:44 +04:00
e n d i f
e n d i f
e l s e # !MOZ_PROFILE_USE (normal build)
export :: install -manifests
2013-10-02 03:53:23 +04:00
binaries ::
@$( MAKE) install-manifests NO_REMOVE = 1
2013-09-17 04:49:44 +04:00
e n d i f
# For historical reasons that are unknown, $(DIST)/sdk is always blown away
# with no regard for PGO passes. This decision could probably be revisited.
export :: install -dist -sdk
2002-04-26 00:40:00 +04:00
2008-12-19 17:50:24 +03: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
2013-09-05 10:07:57 +04:00
default all ::
2013-09-20 05:44:11 +04:00
$( call BUILDSTATUS,TIERS export $( if $( MOZ_PSEUDO_DERECURSE) ,compile ) libs tools)
2013-08-21 00:03:39 +04:00
2013-09-06 04:17:59 +04:00
i n c l u d e $( topsrcdir ) / c o n f i g / r u l e s . m k
2013-08-21 00:03:39 +04:00
2000-12-13 00:28:24 +03:00
distclean ::
2013-08-22 10:55:59 +04:00
$( RM) $( DIST_GARBAGE)
2002-03-01 04:01:42 +03:00
2007-05-02 22:45:36 +04:00
i f e q ( $( OS_ARCH ) , W I N N T )
# we want to copy PDB files on Windows
2011-01-25 23:14:30 +03:00
MAKE_SYM_STORE_ARGS := -c --vcs-info
2008-02-27 03:54:47 +03: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
2010-09-23 20:53:52 +04:00
DUMP_SYMS_BIN ?= $( topsrcdir) /toolkit/crashreporter/tools/win32/dump_syms_vc$( _MSC_VER) .exe
2007-06-27 14:25:14 +04:00
# PDB files don't get moved to dist, so we need to scan the whole objdir
MAKE_SYM_STORE_PATH := .
2007-05-02 22:45:36 +04: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-27 02:06:01 +04:00
MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
2007-06-27 14:25:14 +04:00
MAKE_SYM_STORE_PATH := $( DIST) /universal
2007-05-02 22:45:36 +04:00
e l s e
2009-03-11 18:56:57 +03:00
MAKE_SYM_STORE_ARGS := -c -a $( OS_TEST) --vcs-info
2007-06-27 14:25:14 +04:00
MAKE_SYM_STORE_PATH := $( DIST) /bin
2007-05-02 22:45:36 +04:00
e n d i f
2007-08-19 22:06:53 +04:00
DUMP_SYMS_BIN ?= $( DIST) /host/bin/dump_syms
2007-05-02 22:45:36 +04:00
e n d i f
2008-03-20 04:13:36 +03:00
i f e q ( , $( filter -out Linux SunOS ,$ ( OS_ARCH ) ) )
2009-03-11 18:56:57 +03:00
MAKE_SYM_STORE_ARGS := -c --vcs-info
2007-08-19 22:06:53 +04:00
DUMP_SYMS_BIN ?= $( DIST) /host/bin/dump_syms
2007-06-27 14:25:14 +04:00
MAKE_SYM_STORE_PATH := $( DIST) /bin
2007-05-23 00:20:55 +04:00
e n d i f
2002-03-01 04:01:42 +03:00
2009-02-17 10:46:32 +03:00
SYM_STORE_SOURCE_DIRS := $( topsrcdir)
2009-02-17 17:18:50 +03: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 05:57:56 +04: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
2011-05-20 00:29:50 +04:00
SYMBOL_INDEX_NAME = \
2012-05-14 20:04:37 +04:00
$( MOZ_APP_NAME) -$( MOZ_APP_VERSION) -$( OS_TARGET) -$( BUILDID) -$( CPU_ARCH) $( EXTRA_BUILDID) -symbols.txt
2007-09-10 21:36:17 +04:00
2007-01-12 02:42:21 +03:00
buildsymbols :
2007-08-08 19:19:57 +04: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 18:55:27 +04:00
echo building symbol store
2011-04-03 11:16:49 +04:00
$( RM) -r $( DIST) /crashreporter-symbols
$( RM) " $( DIST) / $( SYMBOL_ARCHIVE_BASENAME) .zip "
2009-03-10 20:36:14 +03:00
$( NSINSTALL) -D $( DIST) /crashreporter-symbols
2011-10-06 11:08:14 +04:00
OBJCOPY = " $( OBJCOPY) " \
2009-02-17 10:46:32 +03: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 20:36:14 +03:00
$( DIST) /crashreporter-symbols \
2012-08-31 23:52:43 +04:00
$( MAKE_SYM_STORE_PATH) | grep -iv test > \
2009-03-10 20:36:14 +03:00
$( DIST) /crashreporter-symbols/$( SYMBOL_INDEX_NAME)
2007-01-12 02:42:21 +03:00
echo packing symbols
2009-11-04 17:59:47 +03:00
$( NSINSTALL) -D $( DIST) /$( PKG_PATH)
2009-03-10 20:36:14 +03:00
cd $( DIST) /crashreporter-symbols && \
2012-08-31 23:52:43 +04:00
zip -r9D " ../ $( PKG_PATH) $( SYMBOL_FULL_ARCHIVE_BASENAME) .zip " . -x "*test*" -x "*Test*"
2010-04-24 00:00:06 +04:00
cd $( DIST) /crashreporter-symbols && \
2010-12-06 18:16:30 +03:00
grep "sym" $( SYMBOL_INDEX_NAME) > $( SYMBOL_INDEX_NAME) .tmp && \
mv $( SYMBOL_INDEX_NAME) .tmp $( SYMBOL_INDEX_NAME)
cd $( DIST) /crashreporter-symbols && \
2012-08-31 23:52:43 +04:00
zip -r9D " ../ $( PKG_PATH) $( SYMBOL_ARCHIVE_BASENAME) .zip " . -i "*.sym" -i "*.txt" -x "*test*" -x "*Test*"
2007-08-08 19:19:57 +04:00
e n d i f # MOZ_CRASHREPORTER
2007-01-12 02:42:21 +03:00
2006-12-06 04:16:05 +03:00
uploadsymbols :
2007-08-08 19:19:57 +04:00
i f d e f M O Z _ C R A S H R E P O R T E R
2011-05-20 00:29:50 +04:00
$( SHELL) $( topsrcdir) /toolkit/crashreporter/tools/upload_symbols.sh $( SYMBOL_INDEX_NAME) " $( DIST) / $( PKG_PATH) $( SYMBOL_FULL_ARCHIVE_BASENAME) .zip "
2006-12-06 04:16:05 +03:00
e n d i f
2013-09-20 05:44:11 +04:00
# MOZ_SOURCE_STAMP is defined in package-name.mk with a deferred assignment.
# exporting it makes make run its $(shell) command for each invoked submake,
# so transform it to an immediate assignment.
MOZ_SOURCE_STAMP := $( MOZ_SOURCE_STAMP)
2009-12-20 17:25:48 +03:00
export MOZ_SOURCE_STAMP
2011-08-31 18:49:42 +04: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 _ )
# 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
maybe_clobber_profiledbuild : clean
e l s e
maybe_clobber_profiledbuild :
e n d i f
e l s e
maybe_clobber_profiledbuild :
2011-11-05 01:26:53 +04:00
$( RM) $( DIST) /bin/*.pgc
find $( DIST) /$( MOZ_APP_NAME) -name "*.pgc" -exec mv { } $( DIST) /bin \;
2011-08-31 18:49:42 +04:00
e n d i f
.PHONY : maybe_clobber_profiledbuild
2010-10-13 16:43:03 +04: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
2012-07-09 17:47:26 +04:00
2013-10-01 03:25:38 +04:00
i f n d e f L I B X U L _ S D K
2012-07-09 17:47:26 +04:00
js/src/Makefile : subsrcdir := js /src
2013-03-04 23:11:55 +04:00
i f d e f E N A B L E _ T E S T S
# Incorporate static tier directories into tests. This should be incorporated
# into moz.build files someday.
check ::
$( call SUBMAKE,$@ ,js/src)
e n d i f
2013-09-20 08:30:17 +04:00
i f d e f M O Z _ P S E U D O _ D E R E C U R S E
# Interdependencies for parallel export.
2013-09-27 03:05:10 +04:00
js/xpconnect/src/export : dom /bindings /export
accessible/src/xpcom/export : xpcom /xpidl /export
2013-09-20 08:30:17 +04:00
js/src/export : mfbt /export
2013-10-12 03:29:46 +04:00
i f d e f E N A B L E _ C L A N G _ P L U G I N
js/src/export config/export : build /clang -plugin /export
e n d i f
2013-09-20 08:30:17 +04:00
e n d i f
2013-10-01 03:25:38 +04:00
e n d i f