2007-03-22 10:30:00 -07:00
|
|
|
#
|
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# The Original Code is mozilla.org code.
|
|
|
|
#
|
|
|
|
# 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):
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
|
|
|
|
DEPTH = .
|
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
2009-03-11 13:32:10 -07:00
|
|
|
ifndef .PYMAKE
|
|
|
|
ifeq (,$(MAKE_VERSION))
|
|
|
|
$(error GNU Make is required)
|
|
|
|
endif
|
|
|
|
ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION)))
|
|
|
|
$(error GNU Make 3.80 or higher is required)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
2008-12-19 06:50:24 -08:00
|
|
|
default::
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
TIERS += base
|
|
|
|
|
|
|
|
#
|
|
|
|
# tier "base" - basic setup
|
2007-09-10 10:36:17 -07:00
|
|
|
#
|
2007-03-22 10:30:00 -07:00
|
|
|
tier_base_dirs = \
|
|
|
|
config \
|
|
|
|
build \
|
2010-03-03 21:02:57 -08:00
|
|
|
memory \
|
2007-10-10 16:03:14 -07:00
|
|
|
probes \
|
2007-03-22 10:30:00 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2009-07-13 04:48:46 -07:00
|
|
|
ifdef COMPILE_ENVIRONMENT
|
2007-03-22 10:30:00 -07:00
|
|
|
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
|
2009-07-13 04:48:46 -07:00
|
|
|
endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
TIERS += testharness
|
|
|
|
|
2007-09-10 10:36:17 -07:00
|
|
|
# test harnesses
|
2007-03-22 10:30:00 -07:00
|
|
|
ifdef ENABLE_TESTS
|
2009-01-22 10:39:02 -08:00
|
|
|
tier_testharness_dirs += testing/xpcshell
|
2007-03-22 10:30:00 -07:00
|
|
|
endif
|
|
|
|
|
2008-12-19 06:50:24 -08:00
|
|
|
include $(topsrcdir)/config/config.mk
|
|
|
|
|
2008-03-14 08:18:24 -07:00
|
|
|
GARBAGE_DIRS += dist _javagen _profile _tests staticlib
|
2007-03-22 10:30:00 -07:00
|
|
|
DIST_GARBAGE = config.cache config.log config.status config-defs.h \
|
2010-02-04 06:19:00 -08:00
|
|
|
dependencies.beos config/autoconf.mk \
|
2007-03-22 10:30:00 -07:00
|
|
|
unallmakefiles mozilla-config.h \
|
2008-01-28 14:05:47 -08:00
|
|
|
netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
|
2007-09-10 10:36:17 -07:00
|
|
|
$(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-03-10 10:36:45 -08:00
|
|
|
ifdef CROSS_COMPILE
|
|
|
|
check::
|
|
|
|
$(PYTHON) $(topsrcdir)/build/mobile/devicemanager-utils.py copy $(DIST)/bin
|
|
|
|
endif
|
|
|
|
|
2010-01-22 16:39:13 -08:00
|
|
|
default alldep all:: $(topsrcdir)/configure config.status
|
2008-12-19 06:50:24 -08: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-22 16:39:13 -08: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
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
# Build pseudo-external modules first when export is explicitly called
|
|
|
|
export::
|
|
|
|
$(RM) -rf $(DIST)/sdk
|
|
|
|
$(MAKE) -C config export
|
|
|
|
$(MAKE) tier_nspr
|
|
|
|
|
2008-12-19 06:50:24 -08:00
|
|
|
ifdef ENABLE_TESTS
|
|
|
|
# Additional makefile targets to call automated test suites
|
|
|
|
include $(topsrcdir)/testing/testsuite-targets.mk
|
2009-09-29 05:31:50 -07:00
|
|
|
else
|
|
|
|
# OS X Universal builds will want to call this, so stub it out
|
|
|
|
package-tests:
|
2008-12-19 06:50:24 -08:00
|
|
|
endif
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
|
|
|
distclean::
|
|
|
|
cat unallmakefiles | $(XARGS) rm -f
|
|
|
|
rm -f unallmakefiles $(DIST_GARBAGE)
|
|
|
|
|
2007-05-02 11:45:36 -07:00
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
|
|
# we want to copy PDB files on Windows
|
|
|
|
MAKE_SYM_STORE_ARGS := -c
|
2008-02-26 16:54:47 -08:00
|
|
|
ifdef PDBSTR_PATH
|
|
|
|
MAKE_SYM_STORE_ARGS += -i
|
|
|
|
endif
|
2007-08-21 14:52:54 -07:00
|
|
|
ifeq (,$(CYGWIN_WRAPPER))
|
|
|
|
# this doesn't work with Cygwin Python
|
|
|
|
MAKE_SYM_STORE_ARGS += --vcs-info
|
|
|
|
endif
|
2007-08-19 11:06:53 -07:00
|
|
|
DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
|
2007-06-27 03:25:14 -07:00
|
|
|
# PDB files don't get moved to dist, so we need to scan the whole objdir
|
|
|
|
MAKE_SYM_STORE_PATH := .
|
2007-05-02 11:45:36 -07:00
|
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),Darwin)
|
|
|
|
# need to pass arch flags for universal builds
|
|
|
|
ifdef UNIVERSAL_BINARY
|
2009-03-11 08:56:57 -07:00
|
|
|
MAKE_SYM_STORE_ARGS := -c -a "ppc i386" --vcs-info
|
2007-06-27 03:25:14 -07:00
|
|
|
MAKE_SYM_STORE_PATH := $(DIST)/universal
|
2007-05-02 11:45:36 -07:00
|
|
|
else
|
2009-03-11 08:56:57 -07:00
|
|
|
MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
|
2007-06-27 03:25:14 -07:00
|
|
|
MAKE_SYM_STORE_PATH := $(DIST)/bin
|
2007-05-02 11:45:36 -07:00
|
|
|
endif
|
2007-08-19 11:06:53 -07:00
|
|
|
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
|
2007-05-02 11:45:36 -07:00
|
|
|
endif
|
2008-03-19 18:13:36 -07:00
|
|
|
ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
|
2009-03-11 08:56:57 -07:00
|
|
|
MAKE_SYM_STORE_ARGS := -c --vcs-info
|
2007-08-19 11:06:53 -07:00
|
|
|
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
|
2007-06-27 03:25:14 -07:00
|
|
|
MAKE_SYM_STORE_PATH := $(DIST)/bin
|
2007-05-22 13:20:55 -07:00
|
|
|
endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-02-16 23:46:32 -08:00
|
|
|
SYM_STORE_SOURCE_DIRS := $(topsrcdir)
|
|
|
|
|
2009-02-17 06:18:50 -08:00
|
|
|
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
|
|
|
|
|
2007-05-27 18:57:56 -07:00
|
|
|
ifdef MOZ_SYMBOLS_EXTRA_BUILDID
|
|
|
|
EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
|
|
|
|
endif
|
|
|
|
|
2009-02-17 06:18:50 -08:00
|
|
|
SYMBOL_INDEX_NAME = \
|
|
|
|
$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
|
2007-09-10 10:36:17 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
buildsymbols:
|
2007-08-08 08:19:57 -07:00
|
|
|
ifdef MOZ_CRASHREPORTER
|
2007-03-26 07:55:27 -07:00
|
|
|
echo building symbol store
|
2009-03-10 10:36:14 -07:00
|
|
|
$(RM) -rf $(DIST)/crashreporter-symbols
|
2009-05-16 04:55:23 -07:00
|
|
|
$(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
|
2009-03-10 10:36:14 -07:00
|
|
|
$(NSINSTALL) -D $(DIST)/crashreporter-symbols
|
2009-02-16 23:46:32 -08: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 10:36:14 -07:00
|
|
|
$(DIST)/crashreporter-symbols \
|
2009-02-16 23:46:32 -08:00
|
|
|
$(MAKE_SYM_STORE_PATH) > \
|
2009-03-10 10:36:14 -07:00
|
|
|
$(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
|
2007-03-22 10:30:00 -07:00
|
|
|
echo packing symbols
|
2009-11-04 06:59:47 -08:00
|
|
|
$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
|
2009-03-10 10:36:14 -07:00
|
|
|
cd $(DIST)/crashreporter-symbols && \
|
2009-09-29 15:22:08 -07:00
|
|
|
zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
|
2010-01-14 06:52:33 -08:00
|
|
|
else
|
|
|
|
ifdef WINCE
|
|
|
|
ifdef SYMBOLSTORE_PATH
|
|
|
|
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" .
|
|
|
|
endif # SYMBOLSTORE_PATH
|
|
|
|
endif # WINCE
|
2007-08-08 08:19:57 -07:00
|
|
|
endif # MOZ_CRASHREPORTER
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
uploadsymbols:
|
2007-08-08 08:19:57 -07:00
|
|
|
ifdef MOZ_CRASHREPORTER
|
2009-09-29 15:22:08 -07:00
|
|
|
$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
|
2007-03-22 10:30:00 -07:00
|
|
|
endif
|
|
|
|
|
2010-02-25 08:19:35 -08:00
|
|
|
# defined in package-name.mk
|
2009-12-20 06:25:48 -08:00
|
|
|
export MOZ_SOURCE_STAMP
|
|
|
|
|
2008-02-20 15:29:11 -08: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
|
|
|
|
ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
|
2008-03-06 03:57:21 -08:00
|
|
|
# No point in clobbering if PGO has been explicitly disabled.
|
|
|
|
ifndef NO_PROFILE_GUIDED_OPTIMIZE
|
2009-12-03 00:20:11 -08:00
|
|
|
maybe_clobber_profiledbuild: clean
|
2008-02-20 15:29:11 -08:00
|
|
|
else
|
|
|
|
maybe_clobber_profiledbuild:
|
|
|
|
endif
|
2008-03-06 03:57:21 -08:00
|
|
|
else
|
|
|
|
maybe_clobber_profiledbuild:
|
|
|
|
endif
|
2008-02-20 15:29:11 -08:00
|
|
|
|
|
|
|
.PHONY: maybe_clobber_profiledbuild
|