mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 05:35:31 +00:00
622 lines
12 KiB
Makefile
622 lines
12 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)/build/unix/modules.mk
|
|
|
|
include $(topsrcdir)/config/config.mk
|
|
|
|
ifneq ($(MOZ_STANDALONE_BUILD),1) # {
|
|
#
|
|
# And now for something completely different...
|
|
# Divide the default build into tiers.
|
|
# Tiers must be defined on module boundaries
|
|
#
|
|
|
|
ifndef LIBXUL_SDK
|
|
TIERS += nspr
|
|
endif
|
|
|
|
TIERS += 0
|
|
|
|
ifndef LIBXUL_SDK
|
|
TIERS += \
|
|
1 \
|
|
2 \
|
|
9 \
|
|
50 \
|
|
$(NULL)
|
|
endif
|
|
|
|
TIERS += \
|
|
99 \
|
|
$(NULL)
|
|
|
|
#
|
|
# tier NSPR
|
|
#
|
|
|
|
ifdef GC_LEAK_DETECTOR
|
|
tier_nspr_staticdirs = gc/boehm
|
|
endif
|
|
|
|
ifndef MOZ_NATIVE_NSPR
|
|
tier_nspr_staticdirs += nsprpub
|
|
endif
|
|
|
|
#
|
|
# tier 0 - base build config dirs
|
|
#
|
|
tier_0_dirs = \
|
|
config \
|
|
build \
|
|
$(NULL)
|
|
|
|
#
|
|
# tier 1 - 3rd party individual libraries
|
|
#
|
|
|
|
ifndef MOZ_NATIVE_JPEG
|
|
tier_1_dirs += jpeg
|
|
endif
|
|
|
|
ifndef MOZ_NATIVE_ZLIB
|
|
tier_1_dirs += modules/zlib
|
|
endif
|
|
|
|
# Installer needs standalone libjar, hence standalone zlib
|
|
ifdef MOZ_INSTALLER
|
|
tier_1_dirs += modules/zlib/standalone
|
|
endif
|
|
|
|
ifdef MOZ_UPDATER
|
|
tier_1_dirs += modules/libbz2
|
|
tier_1_dirs += modules/libmar
|
|
endif
|
|
|
|
#
|
|
# tier 2 - base libraries
|
|
#
|
|
tier_2_dirs = \
|
|
js \
|
|
xpcom \
|
|
$(NULL)
|
|
|
|
ifneq (,$(MOZ_NO_XPCOM_OBSOLETE)$(MOZ_XPINSTALL))
|
|
tier_2_dirs += modules/libreg
|
|
endif
|
|
|
|
ifndef MOZ_NO_XPCOM_OBSOLETE
|
|
tier_2_dirs += xpcom/obsolete
|
|
endif
|
|
|
|
ifdef NS_TRACE_MALLOC
|
|
tier_2_dirs += tools/trace-malloc/lib
|
|
endif
|
|
|
|
#
|
|
# tier 9 - core components (necko,gecko)
|
|
#
|
|
|
|
tier_9_dirs += \
|
|
js/src/xpconnect \
|
|
intl \
|
|
$(NULL)
|
|
|
|
ifdef MOZ_ENABLE_XLIB
|
|
tier_9_dirs += gfx/src/xlibrgb widget/src/xlibxtbin
|
|
endif
|
|
|
|
ifdef MOZ_ENABLE_GTK
|
|
tier_9_dirs += widget/src/gtksuperwin widget/src/gtkxtbin
|
|
endif
|
|
|
|
ifdef MOZ_ENABLE_GTK2
|
|
tier_9_dirs += widget/src/gtkxtbin
|
|
endif
|
|
|
|
ifdef MOZ_IPCD
|
|
tier_9_dirs += ipc/ipcd
|
|
endif
|
|
|
|
tier_9_dirs += \
|
|
modules/libutil \
|
|
netwerk \
|
|
modules/libjar \
|
|
db \
|
|
$(NULL)
|
|
|
|
ifdef MOZ_PERMISSIONS
|
|
tier_9_dirs += \
|
|
extensions/cookie \
|
|
extensions/permissions \
|
|
$(NULL)
|
|
endif
|
|
|
|
ifdef MOZ_STORAGE
|
|
tier_9_dirs += storage
|
|
endif
|
|
|
|
ifdef MOZ_XUL
|
|
tier_9_dirs += rdf
|
|
endif
|
|
|
|
ifdef MOZ_JSDEBUGGER
|
|
tier_9_dirs += js/jsd
|
|
endif
|
|
|
|
tier_9_dirs += \
|
|
uriloader \
|
|
modules/libpref \
|
|
modules/libimg \
|
|
caps \
|
|
parser/expat \
|
|
parser/xml \
|
|
parser/htmlparser \
|
|
gfx \
|
|
modules/libpr0n \
|
|
sun-java \
|
|
modules/plugin \
|
|
dom \
|
|
view \
|
|
widget \
|
|
content \
|
|
layout \
|
|
docshell \
|
|
webshell \
|
|
embedding \
|
|
editor \
|
|
xpfe/appshell \
|
|
$(NULL)
|
|
|
|
ifdef MOZ_AUTH_EXTENSION
|
|
tier_9_dirs += extensions/auth
|
|
endif
|
|
|
|
ifdef MOZ_XMLEXTRAS
|
|
tier_9_dirs += extensions/xmlextras
|
|
endif
|
|
|
|
ifdef MOZ_WEBSERVICES
|
|
tier_9_dirs += extensions/webservices
|
|
endif
|
|
|
|
ifdef MOZ_UNIVERSALCHARDET
|
|
tier_9_dirs += extensions/universalchardet
|
|
endif
|
|
|
|
ifdef MOZ_OJI
|
|
tier_9_dirs += \
|
|
js/src/liveconnect \
|
|
modules/oji \
|
|
$(NULL)
|
|
endif
|
|
|
|
ifdef ACCESSIBILITY
|
|
tier_9_dirs += accessible
|
|
endif
|
|
|
|
#
|
|
# tier 50 - xpfe & toolkit
|
|
#
|
|
|
|
ifdef MOZ_XUL_APP
|
|
tier_50_dirs += chrome
|
|
else
|
|
ifdef MOZ_XUL
|
|
tier_50_dirs += rdf/chrome
|
|
else
|
|
tier_50_dirs += embedding/minimo/chromelite
|
|
endif
|
|
endif
|
|
|
|
tier_50_dirs += profile
|
|
|
|
# This must preceed xpfe
|
|
ifdef MOZ_JPROF
|
|
tier_50_dirs += tools/jprof
|
|
endif
|
|
|
|
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
|
tier_50_dirs += xpfe/bootstrap/appleevents
|
|
endif
|
|
|
|
tier_50_dirs += \
|
|
xpfe \
|
|
toolkit/components \
|
|
$(NULL)
|
|
|
|
ifndef MOZ_XUL_APP
|
|
tier_50_dirs += themes
|
|
endif
|
|
|
|
ifdef MOZ_ENABLE_XREMOTE
|
|
tier_50_dirs += widget/src/xremoteclient
|
|
endif
|
|
|
|
ifdef MOZ_SPELLCHECK
|
|
tier_50_dirs += extensions/spellcheck
|
|
endif
|
|
|
|
ifdef MOZ_XUL_APP
|
|
tier_50_dirs += toolkit
|
|
endif
|
|
|
|
ifdef MOZ_XPINSTALL
|
|
tier_50_dirs += xpinstall
|
|
endif
|
|
|
|
ifdef MOZ_PSM
|
|
tier_50_dirs += security/manager
|
|
else
|
|
tier_50_dirs += security/manager/boot/public security/manager/ssl/public
|
|
endif
|
|
|
|
ifdef MOZ_PREF_EXTENSIONS
|
|
tier_50_dirs += extensions/pref
|
|
endif
|
|
|
|
ifdef MOZ_JAVAXPCOM
|
|
tier_50_dirs += extensions/java
|
|
endif
|
|
|
|
ifndef BUILD_STATIC_LIBS
|
|
ifdef MOZ_XUL_APP
|
|
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
|
|
tier_50_dirs += embedding/browser/gtk
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
ifdef MOZ_XUL_APP
|
|
ifndef BUILD_STATIC_LIBS
|
|
tier_50_dirs += toolkit/library
|
|
endif
|
|
endif
|
|
|
|
ifdef MOZ_ENABLE_LIBXUL
|
|
tier_50_dirs += xpcom/stub
|
|
endif
|
|
|
|
ifdef NS_TRACE_MALLOC
|
|
tier_50_dirs += tools/trace-malloc
|
|
endif
|
|
|
|
ifdef MOZ_LDAP_XPCOM
|
|
tier_50_staticdirs += directory/c-sdk
|
|
tier_50_dirs += directory/xpcom
|
|
endif
|
|
|
|
ifndef MINIMO
|
|
ifdef MOZ_XUL_APP
|
|
ifdef MOZ_ENABLE_GTK2
|
|
tier_50_dirs += toolkit/components/gnome
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
ifdef MOZ_LEAKY
|
|
tier_50_dirs += tools/leaky
|
|
endif
|
|
|
|
ifdef MOZ_MAPINFO
|
|
tier_50_dirs += tools/codesighs
|
|
endif
|
|
|
|
#
|
|
# tier 99 - application binaries
|
|
#
|
|
|
|
ifdef MOZ_MAIL_NEWS
|
|
tier_99_dirs += mailnews
|
|
endif
|
|
|
|
ifdef MOZ_CALENDAR
|
|
tier_99_dirs += calendar
|
|
endif
|
|
|
|
ifdef MOZ_EXTENSIONS
|
|
tier_99_dirs += extensions
|
|
endif
|
|
|
|
# axcontrol
|
|
ifndef LIBXUL_SDK
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
ifndef MOZ_NO_ACTIVEX_SUPPORT
|
|
tier_99_dirs += \
|
|
embedding/browser/activex/src/control \
|
|
embedding/browser/activex/src/control_kicker \
|
|
$(NULL)
|
|
endif # MOZ_NO_ACTIVEX_SUPPORT
|
|
endif # WINNT
|
|
endif # LIBXUL_SDK
|
|
|
|
# Java Embedding Plugin
|
|
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
|
tier_99_dirs += plugin/oji/JEP
|
|
endif
|
|
|
|
ifdef MOZ_BRANDING_DIRECTORY
|
|
tier_99_dirs += $(MOZ_BRANDING_DIRECTORY)
|
|
endif
|
|
|
|
ifdef MOZ_PHOENIX
|
|
tier_99_dirs += browser xpfe/bootstrap/init.d
|
|
endif
|
|
|
|
ifdef MOZ_XULRUNNER
|
|
tier_99_dirs += xulrunner
|
|
endif
|
|
|
|
ifdef MOZ_COMPOSER
|
|
tier_99_dirs += editor/ui
|
|
endif
|
|
|
|
ifdef MOZ_THUNDERBIRD
|
|
tier_99_dirs += mail xpfe/bootstrap/init.d
|
|
endif
|
|
|
|
ifdef MOZ_STANDALONE_COMPOSER
|
|
tier_99_dirs += composer
|
|
endif
|
|
|
|
ifdef MOZ_SUNBIRD
|
|
tier_99_dirs += calendar/sunbird
|
|
endif
|
|
|
|
ifdef MOZ_SUITE
|
|
tier_99_dirs += \
|
|
xpfe/components/search \
|
|
xpfe/components/bookmarks \
|
|
$(NULL)
|
|
|
|
# When Suite becomes a full MOZ_XUL_APP we can remove this ifdef
|
|
ifdef MOZ_XUL_APP
|
|
tier_99_dirs += themes
|
|
endif
|
|
tier_99_dirs += suite
|
|
endif
|
|
|
|
ifdef MINIMO
|
|
tier_99_dirs += minimo
|
|
endif
|
|
|
|
ifdef MOZ_XUL_APP
|
|
# XXX SUITE doesn't want to build the toolkit installer yet
|
|
ifndef MOZ_SUITE
|
|
ifdef MOZ_INSTALLER
|
|
tier_99_dirs += toolkit/mozapps/installer
|
|
endif
|
|
endif # MOZ_SUITE
|
|
else
|
|
ifneq (,$(MOZ_XPFE_COMPONENTS)$(MOZ_XUL))
|
|
ifndef MINIMO
|
|
tier_99_dirs += xpfe/bootstrap
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
ifndef LIBXUL_SDK
|
|
|
|
# winembed, mfcembed
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL))
|
|
tier_99_dirs += embedding/tests
|
|
endif
|
|
endif
|
|
|
|
# os2embed
|
|
ifeq ($(OS_ARCH),OS2)
|
|
ifdef ENABLE_TESTS
|
|
tier_99_dirs += embedding/tests
|
|
endif
|
|
endif
|
|
|
|
endif # LIBXUL_SDK
|
|
|
|
ifeq ($(MOZ_BUILD_APP),macbrowser)
|
|
tier_99_dirs += \
|
|
embedding/config \
|
|
camino \
|
|
$(NULL)
|
|
endif
|
|
|
|
# test harnesses
|
|
ifdef ENABLE_TESTS
|
|
tier_99_dirs += tools/test-harness
|
|
endif
|
|
|
|
# Don't build the Java interfaces when cross compiling since that depends on the
|
|
# program GenerateJavaInterfaces (which doesn't work when cross compiling).
|
|
# This ifndef can be removed when bug 333618 is checked in.
|
|
ifndef CROSS_COMPILE
|
|
# This should be built last, after all IDL files in the tree have been processed
|
|
ifdef MOZ_JAVAXPCOM
|
|
tier_99_dirs += extensions/java/xpcom/interfaces
|
|
endif
|
|
endif
|
|
|
|
default alldep all::
|
|
$(RM) -rf $(DIST)/sdk
|
|
$(RM) -rf $(DIST)/include
|
|
$(MAKE) -C config export
|
|
|
|
else # } { MOZ_STANDALONE_BUILD
|
|
|
|
# Standalone build
|
|
|
|
ifeq ($(MOZ_BUILD_APP),content/xslt) # {
|
|
DIRS = \
|
|
xpcom/typelib \
|
|
xpcom \
|
|
parser/expat \
|
|
content/xslt/src \
|
|
$(NULL)
|
|
|
|
SUBMAKEFILES = xpcom/typelib/Makefile
|
|
|
|
endif # } MOZ_BUILD_APP == content/xslt
|
|
|
|
ifeq ($(MOZ_BUILD_APP),tools/update-packaging) # {
|
|
DIRS = \
|
|
config \
|
|
build \
|
|
modules/libbz2 \
|
|
modules/libmar \
|
|
other-licenses/bsdiff \
|
|
$(NULL)
|
|
|
|
endif # } MOZ_BUILD_APP == tools/update-packaging
|
|
|
|
ifeq ($(MOZ_BUILD_APP),standalone) # {
|
|
DIRS = $(BUILD_MODULE_DIRS)
|
|
|
|
# Hack to generate xpidl Makefile
|
|
ifneq ($(BUILD_MODULES),all)
|
|
ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS)))
|
|
DIRS := xpcom/typelib $(DIRS)
|
|
SUBMAKEFILES := xpcom/typelib/Makefile
|
|
endif
|
|
endif
|
|
endif # } MOZ_BUILD_APP == standalone
|
|
|
|
default:: $(SUBMAKEFILES)
|
|
$(MAKE) export
|
|
$(MAKE) libs
|
|
|
|
endif # } BUILD_MODULES == all or MOZ_STANDALONE
|
|
|
|
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
|
|
ifneq ($(BUILD_MODULES),all)
|
|
ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS)))
|
|
$(MAKE) -C xpcom/typelib
|
|
$(MAKE) export-idl
|
|
endif
|
|
endif
|
|
|
|
install::
|
|
ifndef MOZ_NATIVE_NSPR
|
|
$(MAKE) -C nsprpub install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr
|
|
$(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4))
|
|
$(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties)
|
|
endif
|
|
ifdef MOZ_LDAP_XPCOM
|
|
$(MAKE) -C directory/c-sdk real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/ldap
|
|
endif
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
# After we build tier 50, go back and build the tools from previous dirs
|
|
tier_50::
|
|
$(MAKE) tools_tier_2
|
|
$(MAKE) tools_tier_9
|
|
$(MAKE) tools_tier_50
|
|
|
|
# Clean up after pseudo-external modules
|
|
clean clobber realclean clobber_all distclean::
|
|
ifneq (,$(MOZ_NATIVE_NSPR)$(LIBXUL_SDK))
|
|
$(MAKE) -C nsprpub $@
|
|
endif
|
|
ifdef MOZ_LDAP_XPCOM
|
|
$(MAKE) -C directory/c-sdk $@
|
|
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" > 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
|
|
|
|
## XXXvlad -- the test and cp should be removed once bug 249782 is
|
|
## completely fixed
|
|
signnss:
|
|
ifdef MOZILLA_OFFICIAL
|
|
echo signing NSS libs
|
|
test -f $(DEPTH)/nss/shlibsign.exe.manifest && cp $(DEPTH)/nss/shlibsign.exe.manifest $(DIST)/bin
|
|
cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
|
|
cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
|
|
endif # MOZILLA_OFFICIAL
|
|
|
|
BUILDID = $(shell cat $(DEPTH)/config/build_number)
|
|
deliver: splitsymbols rebase signnss
|
|
|
|
endif # WINNT
|
|
|