mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 11:13:29 +00:00
209 lines
6.6 KiB
Makefile
209 lines
6.6 KiB
Makefile
#
|
|
# ***** 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@
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
include $(topsrcdir)/config/config.mk
|
|
|
|
default alldep all::
|
|
$(RM) -rf $(DIST)/sdk
|
|
$(RM) -rf $(DIST)/include
|
|
$(RM) -rf _tests
|
|
$(MAKE) -C config export
|
|
|
|
TIERS += base
|
|
|
|
#
|
|
# tier "base" - basic setup
|
|
#
|
|
tier_base_dirs = \
|
|
config \
|
|
build \
|
|
probes \
|
|
$(NULL)
|
|
|
|
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
|
|
|
|
TIERS += testharness
|
|
|
|
# test harnesses
|
|
ifdef ENABLE_TESTS
|
|
tier_testharness_dirs += tools/test-harness
|
|
endif
|
|
|
|
GARBAGE_DIRS += dist
|
|
DIST_GARBAGE = config.cache config.log config.status config-defs.h \
|
|
dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
|
|
unallmakefiles mozilla-config.h \
|
|
gfx/gfx-config.h netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
|
|
$(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
|
|
|
|
# Build pseudo-external modules first when export is explicitly called
|
|
export::
|
|
$(RM) -rf $(DIST)/sdk
|
|
$(MAKE) -C config export
|
|
$(MAKE) tier_nspr
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
# After we build tier toolkit, go back and build the tools from previous dirs
|
|
tier_toolkit::
|
|
$(MAKE) tools_tier_js
|
|
$(MAKE) tools_tier_xpcom
|
|
$(MAKE) tools_tier_necko
|
|
$(MAKE) tools_tier_gecko
|
|
$(MAKE) tools_tier_toolkit
|
|
|
|
ifeq (netwerk,$(MOZ_BUILD_APP))
|
|
tier_necko::
|
|
$(EXIT_ON_ERROR) \
|
|
$(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
|
|
endif
|
|
|
|
distclean::
|
|
cat unallmakefiles | $(XARGS) rm -f
|
|
rm -f unallmakefiles $(DIST_GARBAGE)
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
rebase:
|
|
ifdef MOZILLA_OFFICIAL
|
|
echo rebasing $(DIST)
|
|
/bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
|
|
rebase -b 60000000 -R . -G rebase.lst
|
|
rm rebase.lst
|
|
endif
|
|
|
|
splitsymbols:
|
|
ifdef MOZILLA_OFFICIAL
|
|
ifdef MOZ_DEBUG_SYMBOLS
|
|
echo finding pdb files
|
|
mkdir -p $(DIST)/$(BUILDID)
|
|
-cp `/bin/find . -path "./dist" -prune -o -name "*.dll" | sed "s/\.dll$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
|
|
-cp `/bin/find . -path "./dist" -prune -o -name "*.exe" | sed "s/\.exe$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
|
|
-cp `/bin/find . -path "./dist" -prune -o -name "*.EXE" | sed "s/\.EXE$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
|
|
endif # MOZ_DEBUG_SYMBOLS
|
|
ifdef MOZ_PROFILE
|
|
echo splitting symbols out of binaries
|
|
/bin/find $(DIST) -name "*.dll" -exec splitsym {} \;
|
|
/bin/find $(DIST) -name "*.exe" -exec splitsym {} \;
|
|
/bin/find $(DIST) -name "*.EXE" -exec splitsym {} \;
|
|
mkdir -p $(DIST)/$(BUILDID)
|
|
/bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \;
|
|
endif # MOZ_PROFILE
|
|
endif # MOZILLA_OFFICIAL
|
|
endif # WINNT
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
# we want to copy PDB files on Windows
|
|
MAKE_SYM_STORE_ARGS := -c
|
|
ifeq (,$(CYGWIN_WRAPPER))
|
|
# this doesn't work with Cygwin Python
|
|
MAKE_SYM_STORE_ARGS += --vcs-info
|
|
endif
|
|
DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
|
|
# PDB files don't get moved to dist, so we need to scan the whole objdir
|
|
MAKE_SYM_STORE_PATH := .
|
|
endif
|
|
ifeq ($(OS_ARCH),Darwin)
|
|
# need to pass arch flags for universal builds
|
|
ifdef UNIVERSAL_BINARY
|
|
MAKE_SYM_STORE_ARGS := -a "ppc i386" --vcs-info
|
|
MAKE_SYM_STORE_PATH := $(DIST)/universal
|
|
else
|
|
MAKE_SYM_STORE_ARGS := -a $(OS_TEST) --vcs-info
|
|
MAKE_SYM_STORE_PATH := $(DIST)/bin
|
|
endif
|
|
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
|
|
endif
|
|
ifeq ($(OS_ARCH),Linux)
|
|
MAKE_SYM_STORE_ARGS := --vcs-info
|
|
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
|
|
MAKE_SYM_STORE_PATH := $(DIST)/bin
|
|
endif
|
|
|
|
ifdef MOZ_SYMBOLS_EXTRA_BUILDID
|
|
EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
|
|
endif
|
|
|
|
SYMBOL_ARCHIVE_BASENAME = \
|
|
$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)
|
|
|
|
buildsymbols:
|
|
ifdef MOZ_CRASHREPORTER
|
|
echo building symbol store
|
|
mkdir -p $(DIST)/crashreporter-symbols/$(BUILDID)
|
|
$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
|
|
$(MAKE_SYM_STORE_ARGS) -s $(topsrcdir) $(DUMP_SYMS_BIN) \
|
|
$(DIST)/crashreporter-symbols/$(BUILDID) \
|
|
$(MAKE_SYM_STORE_PATH) > \
|
|
$(DIST)/crashreporter-symbols/$(BUILDID)/$(SYMBOL_ARCHIVE_BASENAME)-symbols.txt
|
|
echo packing symbols
|
|
mkdir -p $(topsrcdir)/../$(BUILDID)
|
|
cd $(DIST)/crashreporter-symbols/$(BUILDID) && \
|
|
zip -r9D ../crashreporter-symbols-$(SYMBOL_ARCHIVE_BASENAME).zip .
|
|
mv $(DIST)/crashreporter-symbols/crashreporter-symbols-$(SYMBOL_ARCHIVE_BASENAME).zip \
|
|
$(topsrcdir)/../$(BUILDID)
|
|
endif # MOZ_CRASHREPORTER
|
|
|
|
uploadsymbols:
|
|
ifdef MOZ_CRASHREPORTER
|
|
$(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(topsrcdir)/../$(BUILDID)/crashreporter-symbols-$(SYMBOL_ARCHIVE_BASENAME).zip
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
signnss:
|
|
ifdef MOZILLA_OFFICIAL
|
|
echo signing NSS libs
|
|
cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
|
|
cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
|
|
endif # MOZILLA_OFFICIAL
|
|
|
|
deliver: splitsymbols rebase signnss
|
|
|
|
endif # WINNT
|
|
|
|
ifneq (,$(wildcard $(DIST)/bin/application.ini))
|
|
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
|
|
else
|
|
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
|
|
endif
|