2005-03-28 19:36:24 +00:00
# vim:set ts=8 sw=8 sts=8 noet:
1998-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +00:00
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
1998-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +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/
1998-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +00:00
# 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-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +00:00
# The Original Code is mozilla.org code.
1998-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +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.
1998-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +00:00
# Contributor(s):
2005-06-02 23:27:48 +00:00
# Chase Phillips <chase@mozilla.org>
2006-01-28 17:32:37 +00:00
# Benjamin Smedberg <benjamin@smedbergs.us>
2007-01-31 03:25:46 +00:00
# Jeff Walden <jwalden+code@mit.edu>
1998-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +00:00
# Alternatively, the contents of this file may be used under the terms of
# either of 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-03-28 02:44:41 +00:00
#
2004-04-18 14:21:17 +00:00
# ***** END LICENSE BLOCK *****
2009-05-18 18:15:05 +00:00
1998-08-19 20:42:14 +00:00
i f n d e f t o p s r c d i r
2009-05-18 18:15:05 +00:00
$( error topsrcdir was not set ) )
1998-08-19 20:42:14 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
2000-09-20 19:35:24 +00:00
i f n d e f M O Z I L L A _ D I R
2000-10-27 08:47:51 +00:00
MOZILLA_DIR = $( topsrcdir)
2000-09-20 19:35:24 +00:00
e n d i f
2000-03-14 03:00:52 +00:00
i f n d e f I N C L U D E D _ C O N F I G _ M K
1998-08-19 20:42:14 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / c o n f i g . m k
1998-03-28 02:44:41 +00:00
e n d i f
2002-03-22 15:01:17 +00:00
i f n d e f I N C L U D E D _ V E R S I O N _ M K
i n c l u d e $( topsrcdir ) / c o n f i g / v e r s i o n . m k
e n d i f
2009-05-18 18:15:05 +00:00
i f d e f S D K _ X P I D L S R C S
XPIDLSRCS += $( SDK_XPIDLSRCS)
e n d i f
i f d e f S D K _ H E A D E R S
EXPORTS += $( SDK_HEADERS)
e n d i f
2000-02-25 03:55:50 +00:00
REPORT_BUILD = @echo $( notdir $<)
2000-06-21 00:54:56 +00:00
i f e q ( $( OS_ARCH ) , O S 2 )
EXEC =
e l s e
EXEC = exec
e n d i f
2009-01-27 23:35:44 +00:00
# Don't copy xulrunner files at install time, when using system xulrunner
i f d e f S Y S T E M _ L I B X U L
SKIP_COPY_XULRUNNER = 1
e n d i f
2000-03-14 03:00:52 +00:00
# ELOG prints out failed command when building silently (gmake -s).
2005-01-23 21:32:20 +00:00
i f n e q ( , $( findstring -s ,$ ( MAKEFLAGS ) ) )
2000-06-21 00:54:56 +00:00
ELOG := $( EXEC) sh $( BUILD_TOOLS) /print-failed-commands.sh
2000-02-26 04:21:53 +00:00
e l s e
2000-03-14 03:00:52 +00:00
ELOG :=
2000-02-26 04:21:53 +00:00
e n d i f
2005-04-22 19:06:27 +00:00
i f e q ( , $( filter -out WINNT WINCE ,$ ( OS_ARCH ) ) )
2003-03-08 05:18:43 +00:00
i f n d e f G N U _ C C
_LIBNAME_RELATIVE_PATHS = 1
e n d i f
2001-12-04 21:17:48 +00:00
e n d i f
2005-04-22 19:06:27 +00:00
i f e q ( , $( filter -out WINNT WINCE ,$ ( OS_ARCH ) ) )
2009-09-22 13:05:48 +00:00
_VPATH_SRCS = $( abspath $<)
2002-12-13 02:36:06 +00:00
e l s e
_VPATH_SRCS = $<
e n d i f
2005-11-08 23:08:05 +00:00
# Add $(DIST)/lib to VPATH so that -lfoo dependencies are followed
VPATH += $( DIST) /lib
2006-01-28 17:32:37 +00:00
i f d e f L I B X U L _ S D K
VPATH += $( LIBXUL_SDK) /lib
e n d i f
2005-11-08 23:08:05 +00:00
2006-02-24 20:34:03 +00:00
# EXPAND_LIBNAME - $(call EXPAND_LIBNAME,foo)
# expands to foo.lib on platforms with import libs and -lfoo otherwise
# EXPAND_LIBNAME_PATH - $(call EXPAND_LIBNAME_PATH,foo,dir)
# expands to dir/foo.lib on platforms with import libs and
# -Ldir -lfoo otherwise
# EXPAND_MOZLIBNAME - $(call EXPAND_MOZLIBNAME,foo)
# expands to $(DIST)/lib/foo.lib on platforms with import libs and
# -lfoo otherwise
2003-03-08 05:18:43 +00:00
i f d e f _ L I B N A M E _ R E L A T I V E _ P A T H S
2006-02-24 20:34:03 +00:00
EXPAND_LIBNAME = $( foreach lib,$( 1) ,$( LIB_PREFIX) $( lib) .$( LIB_SUFFIX) )
EXPAND_LIBNAME_PATH = $( foreach lib,$( 1) ,$( 2) /$( LIB_PREFIX) $( lib) .$( LIB_SUFFIX) )
EXPAND_MOZLIBNAME = $( foreach lib,$( 1) ,$( DIST) /lib/$( LIB_PREFIX) $( lib) .$( LIB_SUFFIX) )
2000-03-31 01:24:48 +00:00
e l s e
2003-03-08 05:18:43 +00:00
EXPAND_LIBNAME = $( addprefix -l,$( 1) )
2006-02-24 20:34:03 +00:00
EXPAND_LIBNAME_PATH = -L$( 2) $( addprefix -l,$( 1) )
2003-03-08 05:18:43 +00:00
EXPAND_MOZLIBNAME = $( addprefix -l,$( 1) )
e n d i f
i f d e f E X T R A _ D S O _ L I B S
EXTRA_DSO_LIBS := $( call EXPAND_MOZLIBNAME,$( EXTRA_DSO_LIBS) )
1999-09-09 09:24:58 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
2008-12-04 06:25:00 +00:00
################################################################################
# Testing frameworks support
################################################################################
i f d e f E N A B L E _ T E S T S
i f d e f X P C S H E L L _ T E S T S
i f n d e f M O D U L E
$( error Must define MODULE when defining XPCSHELL_TESTS .)
e n d i f
2009-02-23 18:28:20 +00:00
testxpcobjdir = $( DEPTH) /_tests/xpcshell
2008-12-04 06:25:00 +00:00
# Test file installation
2009-07-23 06:12:32 +00:00
i f n e q ( , $( filter WINNT os 2-emx ,$ ( HOST_OS_ARCH ) ) )
# Windows and OS/2 nsinstall can't recursively copy directories, so use nsinstall.py
2009-03-21 15:20:00 +00:00
TEST_INSTALLER = $( PYTHON) $( topsrcdir) /config/nsinstall.py
e l s e
TEST_INSTALLER = $( INSTALL)
e n d i f
2009-03-11 15:56:58 +00:00
d e f i n e _ I N S T A L L _ T E S T S
2009-03-21 15:20:00 +00:00
$( TEST_INSTALLER ) $( wildcard $ ( srcdir ) /$ ( dir ) /*) $( testxpcobjdir ) / $( MODULE ) / $( dir )
2009-03-11 15:56:58 +00:00
e n d e f # do not remove the blank line!
SOLO_FILE ?= $( error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
2008-12-04 06:25:00 +00:00
libs ::
2009-03-11 15:56:58 +00:00
$( foreach dir,$( XPCSHELL_TESTS) ,$( _INSTALL_TESTS) )
2009-03-21 15:20:00 +00:00
$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl \
$( testxpcobjdir) /all-test-dirs.list \
$( addprefix $( MODULE) /,$( XPCSHELL_TESTS) )
2008-12-04 06:25:00 +00:00
2009-02-23 18:28:20 +00:00
testxpcsrcdir = $( topsrcdir) /testing/xpcshell
2009-01-22 18:39:02 +00:00
2009-03-11 15:56:58 +00:00
# Execute all tests in the $(XPCSHELL_TESTS) directories.
2009-04-26 21:32:41 +00:00
# See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
xpcshell-tests :
2009-05-11 19:54:39 +00:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
-I$( topsrcdir) /build \
2009-03-11 15:56:58 +00:00
$( testxpcsrcdir) /runxpcshelltests.py \
2009-05-11 19:54:39 +00:00
--symbols-path= $( DIST) /crashreporter-symbols \
2009-03-11 15:56:58 +00:00
$( DIST) /bin/xpcshell \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( MODULE) /$( dir) )
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
# start the test. Instead, present the xpcshell prompt so the user can
# attach a debugger and then start the test.
2009-04-26 21:32:41 +00:00
check-interactive :
2009-05-11 19:54:39 +00:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
-I$( topsrcdir) /build \
2009-03-11 15:56:58 +00:00
$( testxpcsrcdir) /runxpcshelltests.py \
2009-05-11 19:54:39 +00:00
--symbols-path= $( DIST) /crashreporter-symbols \
2009-07-31 19:58:42 +00:00
--test-path= $( SOLO_FILE) \
2009-03-11 15:56:58 +00:00
--interactive \
$( DIST) /bin/xpcshell \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( MODULE) /$( dir) )
# Execute a single test, specified in $(SOLO_FILE)
2009-04-26 21:32:41 +00:00
check-one :
2009-05-11 19:54:39 +00:00
$( PYTHON) -u $( topsrcdir) /config/pythonpath.py \
-I$( topsrcdir) /build \
2009-03-11 15:56:58 +00:00
$( testxpcsrcdir) /runxpcshelltests.py \
2009-05-11 19:54:39 +00:00
--symbols-path= $( DIST) /crashreporter-symbols \
2009-07-31 19:58:42 +00:00
--test-path= $( SOLO_FILE) \
2009-03-11 15:56:58 +00:00
$( DIST) /bin/xpcshell \
$( foreach dir,$( XPCSHELL_TESTS) ,$( testxpcobjdir) /$( MODULE) /$( dir) )
2008-12-04 06:25:00 +00:00
e n d i f # XPCSHELL_TESTS
i f d e f C P P _ U N I T _ T E S T S
# Compile the tests to $(DIST)/bin. Make lots of niceties available by default
# through TestHarness.h, by modifying the list of includes and the libs against
# which stuff links.
CPPSRCS += $( CPP_UNIT_TESTS)
SIMPLE_PROGRAMS += $( CPP_UNIT_TESTS:.cpp= $( BIN_SUFFIX) )
2009-05-18 18:15:05 +00:00
INCLUDES += -I$( DIST) /include/testing
2008-12-04 08:40:04 +00:00
LIBS += $( XPCOM_GLUE_LDOPTS) $( NSPR_LIBS)
2008-12-04 06:25:00 +00:00
# ...and run them the usual way
check ::
@$( EXIT_ON_ERROR) \
for f in $( subst .cpp,,$( CPP_UNIT_TESTS) ) ; do \
XPCOM_DEBUG_BREAK = stack-and-abort $( RUN_TEST_PROGRAM) $( DIST) /bin/$$ f; \
done
e n d i f # CPP_UNIT_TESTS
2009-04-28 22:57:48 +00:00
.PHONY : check xpcshell -tests check -interactive check -one
2008-12-04 06:25:00 +00:00
e n d i f # ENABLE_TESTS
2003-03-08 05:18:43 +00:00
#
# Library rules
#
2005-10-17 14:57:32 +00:00
# If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library.
# Otherwise, build a shared library.
2003-03-08 05:18:43 +00:00
#
2000-03-31 01:24:48 +00:00
i f n d e f L I B R A R Y
2008-12-24 19:04:43 +00:00
i f d e f S T A T I C _ L I B R A R Y _ N A M E
2009-09-25 16:41:16 +00:00
i f e q ( O S 2 , $( OS_ARCH ) )
2009-10-12 08:33:20 +00:00
i f d e f S H O R T _ L I B N A M E
2008-12-24 19:04:43 +00:00
STATIC_LIBRARY_NAME := $( SHORT_LIBNAME)
2009-01-16 13:59:19 +00:00
SHARED_LIBRARY_NAME := $( SHORT_LIBNAME)
1999-09-09 09:24:58 +00:00
e n d i f
2009-10-12 08:33:20 +00:00
e n d i f
2008-12-24 19:04:43 +00:00
LIBRARY := $( LIB_PREFIX) $( STATIC_LIBRARY_NAME) .$( LIB_SUFFIX)
e n d i f # STATIC_LIBRARY_NAME
e n d i f # LIBRARY
1999-02-19 03:06:32 +00:00
2000-03-31 07:18:52 +00:00
i f n d e f H O S T _ L I B R A R Y
i f d e f H O S T _ L I B R A R Y _ N A M E
2001-12-09 07:08:58 +00:00
HOST_LIBRARY := $( LIB_PREFIX) $( HOST_LIBRARY_NAME) .$( LIB_SUFFIX)
2000-03-31 07:18:52 +00:00
e n d i f
e n d i f
2000-03-31 01:24:48 +00:00
i f d e f L I B R A R Y
2005-10-17 14:57:32 +00:00
i f n e q ( _ 1 , $( FORCE_SHARED_LIB ) _ $( BUILD_STATIC_LIBS ) )
1998-03-28 02:44:41 +00:00
i f d e f M K S H L I B
1999-05-05 23:38:15 +00:00
2001-12-09 07:08:58 +00:00
i f d e f L I B _ I S _ C _ O N L Y
MKSHLIB = $( MKCSHLIB)
e n d i f
2007-08-20 00:00:11 +00:00
i f d e f M A K E _ F R A M E W O R K
2008-12-24 19:04:43 +00:00
SHARED_LIBRARY := $( SHARED_LIBRARY_NAME)
2007-08-20 00:00:11 +00:00
e l s e
2008-12-24 19:04:43 +00:00
SHARED_LIBRARY := $( DLL_PREFIX) $( SHARED_LIBRARY_NAME) $( DLL_SUFFIX)
2007-08-20 00:00:11 +00:00
e n d i f
2001-12-09 07:08:58 +00:00
1998-03-28 02:44:41 +00:00
i f e q ( $( OS_ARCH ) , O S 2 )
2000-03-31 01:24:48 +00:00
DEF_FILE := $( SHARED_LIBRARY:.dll= .def)
2000-03-31 10:49:39 +00:00
e n d i f
1999-05-05 23:38:15 +00:00
2005-04-22 19:06:27 +00:00
i f n e q ( , $( filter OS 2 WINNT WINCE ,$ ( OS_ARCH ) ) )
2008-12-24 19:04:43 +00:00
IMPORT_LIBRARY := $( LIB_PREFIX) $( SHARED_LIBRARY_NAME) .$( IMPORT_LIB_SUFFIX)
2001-12-09 07:08:58 +00:00
e n d i f
1999-06-26 08:16:01 +00:00
2007-09-26 11:17:47 +00:00
i f d e f M O Z _ E N A B L E _ L I B X U L
2007-09-26 10:38:29 +00:00
EMBED_MANIFEST_AT = 2
e n d i f
1999-02-19 03:06:32 +00:00
e n d i f # MKSHLIB
2005-10-17 14:57:32 +00:00
e n d i f # FORCE_SHARED_LIB && !BUILD_STATIC_LIBS
2000-03-31 10:49:39 +00:00
e n d i f # LIBRARY
1998-07-08 03:49:31 +00:00
2001-06-18 22:10:38 +00:00
i f e q ( , $( BUILD_STATIC_LIBS ) $( FORCE_STATIC_LIB ) )
LIBRARY := $( NULL)
1998-07-08 03:49:31 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
2005-10-17 14:57:32 +00:00
i f e q ( _ 1 , $( FORCE_SHARED_LIB ) _ $( BUILD_STATIC_LIBS ) )
2001-06-18 22:10:38 +00:00
SHARED_LIBRARY := $( NULL)
2001-06-19 00:08:53 +00:00
DEF_FILE := $( NULL)
IMPORT_LIBRARY := $( NULL)
2001-06-18 22:10:38 +00:00
e n d i f
i f d e f F O R C E _ S T A T I C _ L I B
i f n d e f F O R C E _ S H A R E D _ L I B
SHARED_LIBRARY := $( NULL)
2001-06-19 00:08:53 +00:00
DEF_FILE := $( NULL)
IMPORT_LIBRARY := $( NULL)
2001-06-18 22:10:38 +00:00
e n d i f
1998-08-19 20:42:14 +00:00
e n d i f
2002-01-25 03:20:51 +00:00
i f d e f F O R C E _ S H A R E D _ L I B
i f n d e f F O R C E _ S T A T I C _ L I B
LIBRARY := $( NULL)
e n d i f
e n d i f
2006-09-27 15:23:31 +00:00
i f d e f J A V A _ L I B R A R Y _ N A M E
JAVA_LIBRARY := $( JAVA_LIBRARY_NAME) .jar
e n d i f
2005-04-22 19:06:27 +00:00
i f e q ( , $( filter -out WINNT WINCE ,$ ( OS_ARCH ) ) )
2003-03-08 05:18:43 +00:00
i f n d e f G N U _ C C
2001-12-09 07:08:58 +00:00
2005-06-02 23:27:48 +00:00
#
2008-11-26 19:38:09 +00:00
# Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
# directory. For parallel builds, this PDB file is shared and locked by
# MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
# without SP1, don't do parallel builds.
2008-11-04 19:38:40 +00:00
#
# The final PDB for libraries and programs is created by the linker and uses
# a different name from the single PDB file created by the compiler. See
# bug 462740.
#
2008-11-26 19:38:09 +00:00
i f d e f S I M P L E _ P R O G R A M S
COMPILE_PDBFILE = $( basename $( @F) ) .pdb
e l s e
2008-11-04 19:38:40 +00:00
COMPILE_PDBFILE = generated.pdb
2008-11-26 19:38:09 +00:00
e n d i f
2008-11-04 19:38:40 +00:00
LINK_PDBFILE = $( basename $( @F) ) .pdb
2001-12-09 07:08:58 +00:00
i f d e f M O Z _ D E B U G
2002-06-17 17:09:57 +00:00
CODFILE = $( basename $( @F) ) .cod
2002-01-01 00:03:57 +00:00
e n d i f
2001-12-09 07:08:58 +00:00
2002-10-07 19:09:05 +00:00
i f d e f M O Z _ M A P I N F O
2008-12-24 19:04:43 +00:00
i f d e f S H A R E D _ L I B R A R Y _ N A M E
MAPFILE = $( SHARED_LIBRARY_NAME) .map
2002-10-07 19:09:05 +00:00
e l s e
MAPFILE = $( basename $( @F) ) .map
2008-12-24 19:04:43 +00:00
e n d i f # SHARED_LIBRARY_NAME
2002-10-07 19:09:05 +00:00
e n d i f # MOZ_MAPINFO
2001-12-09 07:08:58 +00:00
i f d e f D E F F I L E
2009-07-22 21:43:24 +00:00
OS_LDFLAGS += -DEF:$( call normalizepath,$( DEFFILE) )
2008-07-17 14:45:11 +00:00
EXTRA_DEPS += $( DEFFILE)
2001-12-09 07:08:58 +00:00
e n d i f
i f d e f M A P F I L E
2008-02-10 06:04:19 +00:00
OS_LDFLAGS += -MAP:$( MAPFILE)
2001-12-04 21:17:48 +00:00
e n d i f
2003-03-08 05:18:43 +00:00
e n d i f # !GNU_CC
2004-11-23 19:34:02 +00:00
i f d e f E N A B L E _ C X X _ E X C E P T I O N S
2004-11-28 01:20:08 +00:00
i f d e f G N U _ C C
CXXFLAGS += -fexceptions
e l s e
i f e q ( , $( filter -out 1200 1300 1310,$ ( _MSC_VER ) ) )
CXXFLAGS += -GX
e l s e
CXXFLAGS += -EHsc
e n d i f # _MSC_VER
2004-11-23 19:34:02 +00:00
e n d i f # GNU_CC
e n d i f # ENABLE_CXX_EXCEPTIONS
2001-12-09 07:08:58 +00:00
e n d i f # WINNT
2009-10-26 06:25:40 +00:00
i f e q ( $( SOLARIS_SUNPRO_CXX ) , 1 )
CXXFLAGS += -features= extensions -D__FUNCTION__= __func__
2009-11-20 06:15:39 +00:00
i f e q ( 8 6 , $( findstring 86,$ ( OS_TEST ) ) )
OS_LDFLAGS += -M $( topsrcdir) /config/solaris_ia32.map
e n d i f # x86
2009-10-26 06:25:40 +00:00
e n d i f # Solaris Sun Studio C++
2005-07-06 01:49:32 +00:00
i f e q ( , $( filter -out WINNT WINCE ,$ ( HOST_OS_ARCH ) ) )
HOST_PDBFILE = $( basename $( @F) ) .pdb
e n d i f
1998-03-28 02:44:41 +00:00
i f n d e f T A R G E T S
2006-09-27 15:23:31 +00:00
TARGETS = $( LIBRARY) $( SHARED_LIBRARY) $( PROGRAM) $( SIMPLE_PROGRAMS) $( HOST_LIBRARY) $( HOST_PROGRAM) $( HOST_SIMPLE_PROGRAMS) $( JAVA_LIBRARY)
1998-03-28 02:44:41 +00:00
e n d i f
i f n d e f O B J S
2001-09-29 04:30:14 +00:00
_OBJS = \
$( JRI_STUB_CFILES) \
$( addsuffix .$( OBJ_SUFFIX) , $( JMC_GEN) ) \
$( CSRCS:.c= .$( OBJ_SUFFIX) ) \
2006-10-26 22:52:30 +00:00
$( patsubst %.cc,%.$( OBJ_SUFFIX) ,$( CPPSRCS:.cpp= .$( OBJ_SUFFIX) ) ) \
2004-06-18 00:56:48 +00:00
$( CMSRCS:.m= .$( OBJ_SUFFIX) ) \
2001-10-31 01:20:39 +00:00
$( CMMSRCS:.mm= .$( OBJ_SUFFIX) ) \
2001-09-29 04:30:14 +00:00
$( ASFILES:.$( ASM_SUFFIX) = .$( OBJ_SUFFIX) )
2002-08-31 04:03:52 +00:00
OBJS = $( strip $( _OBJS) )
1998-03-28 02:44:41 +00:00
e n d i f
2000-03-31 07:18:52 +00:00
i f n d e f H O S T _ O B J S
2007-04-27 11:47:10 +00:00
_HOST_OBJS = \
$( addprefix host_,$( HOST_CSRCS:.c= .$( OBJ_SUFFIX) ) ) \
$( addprefix host_,$( patsubst %.cc,%.$( OBJ_SUFFIX) ,$( HOST_CPPSRCS:.cpp= .$( OBJ_SUFFIX) ) ) ) \
$( addprefix host_,$( HOST_CMSRCS:.m= .$( OBJ_SUFFIX) ) ) \
$( addprefix host_,$( HOST_CMMSRCS:.mm= .$( OBJ_SUFFIX) ) )
HOST_OBJS = $( strip $( _HOST_OBJS) )
2000-03-31 07:18:52 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
LIBOBJS := $( addprefix \" , $( OBJS) )
LIBOBJS := $( addsuffix \" , $( LIBOBJS) )
2001-05-22 07:52:30 +00:00
i f n d e f M O Z _ A U T O _ D E P S
2009-05-18 18:15:05 +00:00
i f n e q ( , $( OBJS ) $( XPIDLSRCS ) $( SIMPLE_PROGRAMS ) )
2001-05-22 07:52:30 +00:00
MDDEPFILES = $( addprefix $( MDDEPDIR) /,$( OBJS:.$( OBJ_SUFFIX) = .pp) )
2006-01-04 13:43:59 +00:00
i f n d e f N O _ G E N _ X P T
2009-05-18 18:15:05 +00:00
MDDEPFILES += $( addprefix $( MDDEPDIR) /,$( XPIDLSRCS:.idl= .xpt) )
2006-01-04 13:43:59 +00:00
e n d i f
2001-05-22 07:52:30 +00:00
e n d i f
e n d i f
2000-03-14 03:00:52 +00:00
ALL_TRASH = \
$( GARBAGE) $( TARGETS) $( OBJS) $( PROGOBJS) LOGS TAGS a.out \
2008-08-19 15:14:02 +00:00
$( filter-out $( ASFILES) ,$( OBJS:.$( OBJ_SUFFIX) = .s) ) $( OBJS:.$( OBJ_SUFFIX) = .ii) \
2007-10-13 22:14:28 +00:00
$( OBJS:.$( OBJ_SUFFIX) = .i) \
2000-07-19 14:03:25 +00:00
$( HOST_PROGOBJS) $( HOST_OBJS) $( IMPORT_LIBRARY) $( DEF_FILE) \
2003-09-18 17:24:54 +00:00
$( EXE_DEF_FILE) so_locations _gen _stubs $( wildcard *.res) $( wildcard *.RES) \
2002-06-17 17:09:57 +00:00
$( wildcard *.pdb) $( CODFILE) $( MAPFILE) $( IMPORT_LIBRARY) \
2003-09-11 11:36:40 +00:00
$( SHARED_LIBRARY:$( DLL_SUFFIX) = .exp) $( wildcard *.ilk) \
2001-12-09 08:56:06 +00:00
$( PROGRAM:$( BIN_SUFFIX) = .exp) $( SIMPLE_PROGRAMS:$( BIN_SUFFIX) = .exp) \
$( PROGRAM:$( BIN_SUFFIX) = .lib) $( SIMPLE_PROGRAMS:$( BIN_SUFFIX) = .lib) \
2002-07-01 02:34:57 +00:00
$( SIMPLE_PROGRAMS:$( BIN_SUFFIX) = .$( OBJ_SUFFIX) ) \
2000-03-14 03:00:52 +00:00
$( wildcard gts_tmp_*) $( LIBRARY:%.a= .%.timestamp)
2000-08-30 01:15:32 +00:00
ALL_TRASH_DIRS = \
2002-01-08 09:29:10 +00:00
$( GARBAGE_DIRS) /no-such-file
1998-03-28 02:44:41 +00:00
2008-04-19 13:14:38 +00:00
i f d e f Q T D I R
GARBAGE += $( MOCSRCS)
e n d i f
2000-06-12 00:49:01 +00:00
i f d e f S I M P L E _ P R O G R A M S
2001-09-22 00:20:31 +00:00
GARBAGE += $( SIMPLE_PROGRAMS:%= %.$( OBJ_SUFFIX) )
2000-06-12 00:49:01 +00:00
e n d i f
i f d e f H O S T _ S I M P L E _ P R O G R A M S
2006-01-24 17:25:42 +00:00
GARBAGE += $( HOST_SIMPLE_PROGRAMS:%= %.$( OBJ_SUFFIX) )
2000-06-12 00:49:01 +00:00
e n d i f
2000-01-11 22:11:02 +00:00
#
# the Solaris WorkShop template repository cache. it occasionally can get
# out of sync, so targets like clobber should kill it.
#
2009-02-09 06:21:09 +00:00
i f e q ( $( SOLARIS_SUNPRO_CXX ) , 1 )
2000-09-13 07:36:37 +00:00
GARBAGE_DIRS += SunWS_cache
2000-01-11 22:11:02 +00:00
e n d i f
2002-12-12 00:08:59 +00:00
i f e q ( $( OS_ARCH ) , O p e n V M S )
2003-05-14 22:01:25 +00:00
GARBAGE += $( wildcard *.*_defines)
2002-12-12 00:08:59 +00:00
i f d e f S H A R E D _ L I B R A R Y
VMS_SYMVEC_FILE = $( SHARED_LIBRARY:$( DLL_SUFFIX) = _symvec.opt)
2003-05-14 22:01:25 +00:00
i f d e f M O Z _ D E B U G
VMS_SYMVEC_FILE_MODULE = $( topsrcdir) /build/unix/vms/$( notdir $( SHARED_LIBRARY:$( DLL_SUFFIX) = _dbg_symvec.opt) )
e l s e
VMS_SYMVEC_FILE_MODULE = $( topsrcdir) /build/unix/vms/$( notdir $( SHARED_LIBRARY:$( DLL_SUFFIX) = _symvec.opt) )
e n d i f
2002-12-12 00:08:59 +00:00
VMS_SYMVEC_FILE_COMP = $( topsrcdir) /build/unix/vms/component_symvec.opt
GARBAGE += $( VMS_SYMVEC_FILE)
i f d e f I S _ C O M P O N E N T
DSO_LDOPTS := $( filter-out -auto_symvec,$( DSO_LDOPTS) ) $( VMS_SYMVEC_FILE)
e n d i f
e n d i f
e n d i f
1999-05-08 02:06:15 +00:00
XPIDL_GEN_DIR = _xpidlgen
1998-03-28 02:44:41 +00:00
2000-03-02 03:39:19 +00:00
i f d e f M O Z _ U P D A T E _ X T E R M
2000-04-18 01:27:01 +00:00
# Its good not to have a newline at the end of the titlebar string because it
# makes the make -s output easier to read. Echo -n does not work on all
# platforms, but we can trick sed into doing it.
2009-02-27 21:03:53 +00:00
UPDATE_TITLE = sed -e " s!Y! $( 1) in $( shell $( BUILD_TOOLS) /print-depth-path.sh) / $( 2) ! " $( MOZILLA_DIR) /config/xterm.str;
1999-02-08 19:59:25 +00:00
e n d i f
2009-02-27 21:03:53 +00:00
d e f i n e S U B M A K E # $(call SUBMAKE,target,directory)
@ $( UPDATE_TITLE )
+ @ $( MAKE ) $( if $ ( 2) ,-C $ ( 2) ) $( 1)
e n d e f # The extra line is important here! don't delete it
2008-12-19 14:50:24 +00:00
i f n e q ( , $( strip $ ( DIRS ) ) )
2000-03-02 03:39:19 +00:00
LOOP_OVER_DIRS = \
2009-02-27 21:03:53 +00:00
$( foreach dir,$( DIRS) ,$( call SUBMAKE,$@ ,$( dir) ) )
2008-12-19 14:50:24 +00:00
e n d i f
2000-11-10 00:55:44 +00:00
2008-10-30 17:02:14 +00:00
# we only use this for the makefiles target and other stuff that doesn't matter
2008-12-19 14:50:24 +00:00
i f n e q ( , $( strip $ ( PARALLEL_DIRS ) ) )
2008-10-30 17:02:14 +00:00
LOOP_OVER_PARALLEL_DIRS = \
2009-02-27 21:03:53 +00:00
$( foreach dir,$( PARALLEL_DIRS) ,$( call SUBMAKE,$@ ,$( dir) ) )
2008-12-19 14:50:24 +00:00
e n d i f
2008-10-30 17:02:14 +00:00
2008-12-19 14:50:24 +00:00
i f n e q ( , $( strip $ ( STATIC_DIRS ) ) )
2008-02-09 10:37:42 +00:00
LOOP_OVER_STATIC_DIRS = \
2009-02-27 21:03:53 +00:00
$( foreach dir,$( STATIC_DIRS) ,$( call SUBMAKE,$@ ,$( dir) ) )
2008-12-19 14:50:24 +00:00
e n d i f
2008-02-09 10:37:42 +00:00
2008-12-19 14:50:24 +00:00
i f n e q ( , $( strip $ ( TOOL_DIRS ) ) )
2004-12-08 12:38:22 +00:00
LOOP_OVER_TOOL_DIRS = \
2009-02-27 21:03:53 +00:00
$( foreach dir,$( TOOL_DIRS) ,$( call SUBMAKE,$@ ,$( dir) ) )
2008-12-19 14:50:24 +00:00
e n d i f
2004-12-08 12:38:22 +00:00
2008-10-30 17:02:14 +00:00
i f d e f P A R A L L E L _ D I R S
# create a bunch of fake targets for order-only processing
PARALLEL_DIRS_export = $( addsuffix _export,$( PARALLEL_DIRS) )
PARALLEL_DIRS_libs = $( addsuffix _libs,$( PARALLEL_DIRS) )
PARALLEL_DIRS_tools = $( addsuffix _tools,$( PARALLEL_DIRS) )
2008-11-03 18:15:17 +00:00
.PHONY : $( PARALLEL_DIRS_export ) $( PARALLEL_DIRS_libs ) $( PARALLEL_DIRS_tools )
2008-10-30 17:02:14 +00:00
e n d i f
1998-07-08 03:49:31 +00:00
#
# Now we can differentiate between objects used to build a library, and
# objects used to build an executable in the same directory.
#
i f n d e f P R O G O B J S
PROGOBJS = $( OBJS)
e n d i f
2000-03-31 07:18:52 +00:00
i f n d e f H O S T _ P R O G O B J S
HOST_PROGOBJS = $( HOST_OBJS)
e n d i f
1999-08-24 21:45:06 +00:00
# MAKE_DIRS: List of directories to build while looping over directories.
2008-11-10 20:55:46 +00:00
# A Makefile that needs $(MDDEPDIR) created but doesn't set any of these
# variables we know to check can just set NEED_MDDEPDIR explicitly.
2009-05-18 18:15:05 +00:00
i f n e q ( , $( OBJS ) $( XPIDLSRCS ) $( SIMPLE_PROGRAMS ) $( NEED_MDDEPDIR ) )
2008-11-10 20:55:46 +00:00
MAKE_DIRS += $( CURDIR) /$( MDDEPDIR)
2000-08-30 01:15:32 +00:00
GARBAGE_DIRS += $( MDDEPDIR)
1999-09-09 09:24:58 +00:00
e n d i f
#
# Tags: emacs (etags), vi (ctags)
# TAG_PROGRAM := ctags -L -
#
TAG_PROGRAM = xargs etags -a
#
2007-04-25 14:26:42 +00:00
# Turn on C++ linking if we have any .cpp or .mm files
1999-09-09 09:24:58 +00:00
# (moved this from config.mk so that config.mk can be included
# before the CPPSRCS are defined)
#
2007-04-25 14:26:42 +00:00
i f n e q ( $( CPPSRCS ) $( CMMSRCS ) , )
1999-09-09 09:24:58 +00:00
CPP_PROG_LINK = 1
e n d i f
2000-04-23 17:48:04 +00:00
#
# Make sure to wrap static libs inside linker specific flags to turn on & off
# inclusion of all symbols inside the static libs
#
2000-11-15 03:37:45 +00:00
i f n d e f N O _ L D _ A R C H I V E _ F L A G S
2000-04-23 17:48:04 +00:00
i f d e f S H A R E D _ L I B R A R Y _ L I B S
EXTRA_DSO_LDOPTS := $( MKSHLIB_FORCE_ALL) $( SHARED_LIBRARY_LIBS) $( MKSHLIB_UNFORCE_ALL) $( EXTRA_DSO_LDOPTS)
e n d i f
2000-11-15 03:37:45 +00:00
e n d i f
2000-04-23 17:48:04 +00:00
1999-09-22 09:54:00 +00:00
#
2007-01-31 03:25:46 +00:00
# This will strip out symbols that the component should not be
1999-09-22 09:54:00 +00:00
# exporting from the .dynsym section.
#
1999-09-16 13:43:15 +00:00
i f d e f I S _ C O M P O N E N T
1999-09-22 09:54:00 +00:00
EXTRA_DSO_LDOPTS += $( MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
1999-09-16 13:43:15 +00:00
e n d i f # IS_COMPONENT
2003-03-15 22:56:35 +00:00
#
# Enforce the requirement that MODULE_NAME must be set
# for components in static builds
#
i f d e f I S _ C O M P O N E N T
i f d e f E X P O R T _ L I B R A R Y
i f n d e f F O R C E _ S H A R E D _ L I B
i f n d e f M O D U L E _ N A M E
$( error MODULE_NAME is required for components which may be used in static builds )
e n d i f
e n d i f
e n d i f
e n d i f
2000-03-11 03:08:04 +00:00
#
# MacOS X specific stuff
#
2001-04-05 03:36:56 +00:00
i f e q ( $( OS_ARCH ) , D a r w i n )
2003-06-09 22:25:25 +00:00
i f d e f S H A R E D _ L I B R A R Y
2000-03-11 03:08:04 +00:00
i f d e f I S _ C O M P O N E N T
EXTRA_DSO_LDOPTS += -bundle
e l s e
2007-07-11 17:26:11 +00:00
EXTRA_DSO_LDOPTS += -dynamiclib -install_name @executable_path/$( SHARED_LIBRARY) -compatibility_version 1 -current_version 1 -single_module
2003-06-09 22:25:25 +00:00
e n d i f
2000-03-11 03:08:04 +00:00
e n d i f
e n d i f
2001-03-09 07:55:29 +00:00
#
# On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be
# fatal symbol name clashes between components.
#
i f e q ( $( OS_ARCH ) , N e t B S D )
i f e q ( $( DLL_SUFFIX ) , . s o . 1 . 0 )
i f d e f I S _ C O M P O N E N T
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
e n d i f
e n d i f
e n d i f
2003-01-30 07:41:27 +00:00
i f e q ( $( OS_ARCH ) , F r e e B S D )
i f d e f I S _ C O M P O N E N T
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
e n d i f
e n d i f
2001-03-09 07:55:29 +00:00
i f e q ( $( OS_ARCH ) , N e t B S D )
i f n e q ( , $( filter arc cobalt hpcmips mipsco newsmips pmax sgimips ,$ ( OS_TEST ) ) )
i f e q ( $( MODULE ) , l a y o u t )
OS_CFLAGS += -Wa,-xgot
OS_CXXFLAGS += -Wa,-xgot
e n d i f
e n d i f
e n d i f
2001-08-16 05:18:04 +00:00
i f e q ( $( OS_ARCH ) , L i n u x )
i f n e q ( , $( filter mips mipsel ,$ ( OS_TEST ) ) )
i f e q ( $( MODULE ) , l a y o u t )
OS_CFLAGS += -Wa,-xgot
OS_CXXFLAGS += -Wa,-xgot
e n d i f
e n d i f
e n d i f
1999-11-18 02:49:30 +00:00
#
# HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
# which uses internal symbols first
#
i f e q ( $( OS_ARCH ) , H P - U X )
i f d e f I S _ C O M P O N E N T
i f e q ( $( GNU_CC ) $( GNU_CXX ) , )
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
2001-11-02 14:24:34 +00:00
i f n e q ( $( HAS_EXTRAEXPORTS ) , 1 )
2002-10-02 10:10:06 +00:00
MKSHLIB += -Wl,+eNSGetModule -Wl,+eerrno
2004-02-26 07:34:27 +00:00
MKCSHLIB += +eNSGetModule +eerrno
2002-10-02 10:10:06 +00:00
i f n e q ( $( OS_TEST ) , i a 6 4 )
MKSHLIB += -Wl,+e_shlInit
2004-02-26 07:34:27 +00:00
MKCSHLIB += +e_shlInit
2002-10-02 10:10:06 +00:00
e n d i f # !ia64
2001-11-02 14:24:34 +00:00
e n d i f # !HAS_EXTRAEXPORTS
1999-11-18 02:49:30 +00:00
e n d i f # non-gnu compilers
e n d i f # IS_COMPONENT
e n d i f # HP-UX
2001-11-08 12:15:48 +00:00
i f e q ( $( OS_ARCH ) , A I X )
i f d e f I S _ C O M P O N E N T
i f n e q ( $( HAS_EXTRAEXPORTS ) , 1 )
MKSHLIB += -bE:$( MOZILLA_DIR) /build/unix/aix.exp -bnoexpall
MKCSHLIB += -bE:$( MOZILLA_DIR) /build/unix/aix.exp -bnoexpall
e n d i f # HAS_EXTRAEXPORTS
e n d i f # IS_COMPONENT
e n d i f # AIX
2002-10-11 05:18:39 +00:00
#
# OSF1: add -B symbolic flag for components
#
i f e q ( $( OS_ARCH ) , O S F 1 )
i f d e f I S _ C O M P O N E N T
i f e q ( $( GNU_CC ) $( GNU_CXX ) , )
EXTRA_DSO_LDOPTS += -B symbolic
e n d i f
e n d i f
e n d i f
2002-02-14 04:32:11 +00:00
#
# Linux: add -Bsymbolic flag for components
#
i f e q ( $( OS_ARCH ) , L i n u x )
i f d e f I S _ C O M P O N E N T
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
e n d i f
e n d i f
2003-03-18 22:04:00 +00:00
#
# MINGW32
#
i f e q ( $( OS_ARCH ) , W I N N T )
i f d e f G N U _ C C
i f n d e f I S _ C O M P O N E N T
2004-03-16 08:07:25 +00:00
DSO_LDOPTS += -Wl,--out-implib -Wl,$( IMPORT_LIBRARY)
2003-03-18 22:04:00 +00:00
e n d i f
e n d i f
e n d i f
2000-03-31 01:24:48 +00:00
i f e q ( $( USE_TVFS ) , 1 )
IFLAGS1 = -rb
IFLAGS2 = -rb
e l s e
2001-07-24 23:41:43 +00:00
IFLAGS1 = -m 644
IFLAGS2 = -m 755
2000-03-31 01:24:48 +00:00
e n d i f
1999-11-18 02:49:30 +00:00
2001-12-04 21:17:48 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( OS_ARCH ) )
OUTOPTION = -Fo# eol
e l s e
OUTOPTION = -o # eol
e n d i f # WINNT && !GNU_CC
2005-04-22 19:06:27 +00:00
i f n e q ( , $( filter WINCE ,$ ( OS_ARCH ) ) )
OUTOPTION = -Fo# eol
e n d i f
2009-12-04 19:14:18 +00:00
i f e q ( $( OS_ARCH ) , W I N C E )
2005-04-22 19:06:27 +00:00
OUTOPTION = -Fo# eol
2008-02-21 21:02:06 +00:00
HOST_OUTOPTION = -Fo# eol
e l s e
2001-12-04 21:17:48 +00:00
2007-03-26 18:17:02 +00:00
i f e q ( , $( CROSS_COMPILE ) )
HOST_OUTOPTION = $( OUTOPTION)
e l s e
HOST_OUTOPTION = -o # eol
e n d i f
2008-02-21 21:02:06 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
################################################################################
2006-08-25 10:45:39 +00:00
# SUBMAKEFILES: List of Makefiles for next level down.
# This is used to update or create the Makefiles before invoking them.
2008-11-03 18:15:17 +00:00
SUBMAKEFILES += $( addsuffix /Makefile, $( DIRS) $( TOOL_DIRS) $( PARALLEL_DIRS) )
2006-08-25 10:45:39 +00:00
2005-03-31 21:40:23 +00:00
# The root makefile doesn't want to do a plain export/libs, because
# of the tiers and because of libxul. Suppress the default rules in favor
# of something else. Makefiles which use this var *must* provide a sensible
# default rule before including rules.mk
i f n d e f S U P P R E S S _ D E F A U L T _ R U L E S
2006-08-25 10:45:39 +00:00
i f d e f T I E R S
default all alldep ::
2009-02-27 21:03:53 +00:00
$( foreach tier,$( TIERS) ,$( call SUBMAKE,tier_$( tier) ) )
2006-08-25 10:45:39 +00:00
e l s e
default all ::
2008-12-19 14:50:24 +00:00
i f n e q ( , $( strip $ ( STATIC_DIRS ) ) )
2009-02-27 21:03:53 +00:00
$( foreach dir,$( STATIC_DIRS) ,$( call SUBMAKE,,$( dir) ) )
2008-12-19 14:50:24 +00:00
e n d i f
2001-11-30 22:53:10 +00:00
$( MAKE) export
$( MAKE) libs
2006-03-22 07:24:46 +00:00
$( MAKE) tools
1998-03-28 02:44:41 +00:00
1999-01-21 07:42:44 +00:00
# Do depend as well
2001-11-30 22:53:10 +00:00
alldep ::
$( MAKE) export
$( MAKE) depend
$( MAKE) libs
2006-03-22 07:24:46 +00:00
$( MAKE) tools
1999-01-21 07:42:44 +00:00
2006-08-25 10:45:39 +00:00
e n d i f # TIERS
2005-03-31 21:40:23 +00:00
e n d i f # SUPPRESS_DEFAULT_RULES
2008-07-15 10:54:05 +00:00
i f e q ( $( filter s ,$ ( MAKEFLAGS ) ) , )
2008-07-12 10:55:43 +00:00
ECHO := echo
QUIET :=
e l s e
ECHO := true
QUIET := -q
e n d i f
2008-02-13 11:35:45 +00:00
MAKE_TIER_SUBMAKEFILES = +$( if $( tier_$* _dirs) ,$( MAKE) $( addsuffix /Makefile,$( tier_$* _dirs) ) )
2006-08-25 10:45:39 +00:00
2009-02-27 21:03:53 +00:00
export_tier_% :
2008-07-12 10:55:43 +00:00
@$( ECHO) " $@ "
2006-08-25 10:45:39 +00:00
@$( MAKE_TIER_SUBMAKEFILES)
2009-02-27 21:03:53 +00:00
$( foreach dir,$( tier_$* _dirs) ,$( call SUBMAKE,export,$( dir) ) )
2006-08-25 10:45:39 +00:00
libs_tier_% :
2008-07-12 10:55:43 +00:00
@$( ECHO) " $@ "
2006-08-25 10:45:39 +00:00
@$( MAKE_TIER_SUBMAKEFILES)
2009-02-27 21:03:53 +00:00
$( foreach dir,$( tier_$* _dirs) ,$( call SUBMAKE,libs,$( dir) ) )
2006-08-25 10:45:39 +00:00
tools_tier_% :
2008-07-12 10:55:43 +00:00
@$( ECHO) " $@ "
2006-08-25 10:45:39 +00:00
@$( MAKE_TIER_SUBMAKEFILES)
2009-02-27 21:03:53 +00:00
$( foreach dir,$( tier_$* _dirs) ,$( call SUBMAKE,tools,$( dir) ) )
2006-08-25 10:45:39 +00:00
$(foreach tier,$(TIERS),tier_$(tier)) ::
2008-07-12 10:55:43 +00:00
@$( ECHO) " $@ : $( $@ _staticdirs) $( $@ _dirs) "
2009-02-27 21:03:53 +00:00
$( foreach dir,$( $@ _staticdirs) ,$( call SUBMAKE,,$( dir) ) )
2006-08-25 10:45:39 +00:00
$( MAKE) export_$@
$( MAKE) libs_$@
1999-01-21 07:42:44 +00:00
# Do everything from scratch
2001-11-30 22:53:10 +00:00
everything ::
$( MAKE) clean
$( MAKE) alldep
1999-01-21 07:42:44 +00:00
2001-04-05 01:18:34 +00:00
# Add dummy depend target for tinderboxes
depend ::
1999-09-03 22:18:30 +00:00
# Target to only regenerate makefiles
makefiles : $( SUBMAKEFILES )
2008-10-30 17:02:14 +00:00
i f n e q ( , $( DIRS ) $( TOOL_DIRS ) $( PARALLEL_DIRS ) )
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
1999-09-03 22:18:30 +00:00
e n d i f
2008-10-30 17:02:14 +00:00
i f d e f P A R A L L E L _ D I R S
2008-11-03 18:15:17 +00:00
export :: $( PARALLEL_DIRS_export )
2008-10-30 17:02:14 +00:00
2008-11-03 18:15:17 +00:00
$(PARALLEL_DIRS_export) : %_export : %/Makefile
2009-02-27 21:03:53 +00:00
+@$( call SUBMAKE,export,$* )
2008-10-30 17:02:14 +00:00
e n d i f
2009-05-18 18:15:05 +00:00
export :: $( SUBMAKEFILES ) $( MAKE_DIRS ) $( if $ ( XPIDLSRCS ) ,$ ( IDL_DIR ) )
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
2004-12-08 12:38:22 +00:00
2008-10-30 17:02:14 +00:00
i f d e f P A R A L L E L _ D I R S
2008-11-03 18:15:17 +00:00
tools :: $( PARALLEL_DIRS_tools )
2008-10-30 17:02:14 +00:00
2008-11-03 18:15:17 +00:00
$(PARALLEL_DIRS_tools) : %_tools : %/Makefile
2009-02-27 21:03:53 +00:00
+@$( call SUBMAKE,tools,$* )
2008-10-30 17:02:14 +00:00
e n d i f
2004-12-08 12:38:22 +00:00
tools :: $( SUBMAKEFILES ) $( MAKE_DIRS )
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_DIRS)
2008-12-19 14:50:24 +00:00
i f n e q ( , $( strip $ ( TOOL_DIRS ) ) )
2009-02-27 21:03:53 +00:00
$( foreach dir,$( TOOL_DIRS) ,$( call SUBMAKE,libs,$( dir) ) )
2008-12-02 22:17:41 +00:00
e n d i f
2005-01-12 11:23:43 +00:00
2001-04-28 18:51:31 +00:00
#
# Rule to create list of libraries for final link
#
export ::
i f d e f L I B R A R Y _ N A M E
i f d e f E X P O R T _ L I B R A R Y
i f d e f I S _ C O M P O N E N T
2001-06-18 22:10:38 +00:00
i f d e f B U I L D _ S T A T I C _ L I B S
2008-12-24 19:04:43 +00:00
@$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl $( FINAL_LINK_COMPS) $( STATIC_LIBRARY_NAME)
2001-06-20 20:21:49 +00:00
i f d e f M O D U L E _ N A M E
2001-08-17 12:06:03 +00:00
@$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl $( FINAL_LINK_COMP_NAMES) $( MODULE_NAME)
2001-06-20 20:21:49 +00:00
e n d i f
2008-12-24 19:04:43 +00:00
e n d i f # BUILD_STATIC_LIBS
e l s e # !IS_COMPONENT
$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl $( FINAL_LINK_LIBS) $( STATIC_LIBRARY_NAME)
2001-04-28 18:51:31 +00:00
e n d i f # IS_COMPONENT
e n d i f # EXPORT_LIBRARY
e n d i f # LIBRARY_NAME
2005-11-08 23:08:05 +00:00
# Create dependencies on static (and shared EXTRA_DSO_LIBS) libraries
2004-02-07 08:22:28 +00:00
LIBS_DEPS = $( filter %.$( LIB_SUFFIX) , $( LIBS) )
HOST_LIBS_DEPS = $( filter %.$( LIB_SUFFIX) , $( HOST_LIBS) )
2005-11-08 23:08:05 +00:00
DSO_LDOPTS_DEPS = $( EXTRA_DSO_LIBS) $( filter %.$( LIB_SUFFIX) , $( EXTRA_DSO_LDOPTS) )
2004-01-23 21:21:38 +00:00
2009-08-16 21:54:45 +00:00
i f n d e f _ L I B N A M E _ R E L A T I V E _ P A T H S
LIBS_DEPS += $( filter -l%, $( LIBS) )
HOST_LIBS_DEPS += $( filter -l%, $( HOST_LIBS) )
DSO_LDOPTS_DEPS += $( filter -l%, $( EXTRA_DSO_LDOPTS) )
_LIBDIRS = $( patsubst -L%,%,$( filter -L%, $( LIBS) $( HOST_LIBS) $( EXTRA_DSO_LDOPTS) ) )
i f n e q ( , $( _LIBDIRS ) )
v p a t h $( LIB_PREFIX ) % . $( LIB_SUFFIX ) $( _LIBDIRS )
i f d e f I M P O R T _ L I B _ S U F F I X
v p a t h $( LIB_PREFIX ) % . $( IMPORT_LIB_SUFFIX ) $( _LIBDIRS )
e n d i f # IMPORT_LIB_SUFFIX
v p a t h $( DLL_PREFIX ) % $( DLL_SUFFIX ) $( _LIBDIRS )
e n d i f # _LIBDIRS
e n d i f # _LIBNAME_RELATIVE_PATHS
2008-11-28 02:26:44 +00:00
# Dependancies which, if modified, should cause everything to rebuild
2009-06-20 15:37:04 +00:00
GLOBAL_DEPS += Makefile Makefile.in $( DEPTH) /config/autoconf.mk $( topsrcdir) /config/config.mk
2008-11-28 02:26:44 +00:00
2000-03-31 01:24:48 +00:00
##############################################
2008-10-30 17:02:14 +00:00
i f d e f P A R A L L E L _ D I R S
2008-11-03 18:15:17 +00:00
libs :: $( PARALLEL_DIRS_libs )
2008-10-30 17:02:14 +00:00
2008-11-03 18:15:17 +00:00
$(PARALLEL_DIRS_libs) : %_libs : %/Makefile
2009-02-27 21:03:53 +00:00
+@$( call SUBMAKE,libs,$* )
2008-10-30 17:02:14 +00:00
e n d i f
2007-02-21 15:13:36 +00:00
libs :: $( SUBMAKEFILES ) $( MAKE_DIRS ) $( HOST_LIBRARY ) $( LIBRARY ) $( SHARED_LIBRARY ) $( IMPORT_LIBRARY ) $( HOST_PROGRAM ) $( PROGRAM ) $( HOST_SIMPLE_PROGRAMS ) $( SIMPLE_PROGRAMS ) $( JAVA_LIBRARY )
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
1998-03-28 02:44:41 +00:00
i f d e f L I B R A R Y
2007-02-21 15:13:36 +00:00
i f d e f E X P O R T _ L I B R A R Y # Stage libs that will be linked into a static build
2002-12-28 03:30:04 +00:00
i f d e f I S _ C O M P O N E N T
2007-02-21 15:13:36 +00:00
$( INSTALL) $( IFLAGS1) $( LIBRARY) $( DEPTH) /staticlib/components
e l s e
$( INSTALL) $( IFLAGS1) $( LIBRARY) $( DEPTH) /staticlib
e n d i f
e n d i f # EXPORT_LIBRARY
i f d e f D I S T _ I N S T A L L
i f d e f I S _ C O M P O N E N T
$( error Shipping static component libs makes no sense.)
2002-12-28 03:30:04 +00:00
e l s e
2000-06-21 00:54:56 +00:00
$( INSTALL) $( IFLAGS1) $( LIBRARY) $( DIST) /lib
1998-03-28 02:44:41 +00:00
e n d i f
2007-02-21 15:13:36 +00:00
e n d i f # DIST_INSTALL
2001-04-28 18:51:31 +00:00
e n d i f # LIBRARY
1998-03-28 02:44:41 +00:00
i f d e f S H A R E D _ L I B R A R Y
1999-03-03 01:25:21 +00:00
i f d e f I S _ C O M P O N E N T
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS2) $( SHARED_LIBRARY) $( FINAL_TARGET) /components
$( ELF_DYNSTR_GC) $( FINAL_TARGET) /components/$( SHARED_LIBRARY)
2009-11-05 14:08:49 +00:00
@$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl $( FINAL_TARGET) /components/components.list $( SHARED_LIBRARY)
2000-09-17 18:40:42 +00:00
i f d e f B E O S _ A D D O N _ W O R K A R O U N D
2005-02-18 22:17:37 +00:00
( cd $( FINAL_TARGET) /components && $( CC) -nostart -o $( SHARED_LIBRARY) .stub $( SHARED_LIBRARY) )
2000-09-17 18:40:42 +00:00
e n d i f
2000-03-31 01:24:48 +00:00
e l s e # ! IS_COMPONENT
2005-04-22 19:06:27 +00:00
i f n e q ( , $( filter OS 2 WINNT WINCE ,$ ( OS_ARCH ) ) )
2000-03-31 01:24:48 +00:00
$( INSTALL) $( IFLAGS2) $( IMPORT_LIBRARY) $( DIST) /lib
1999-03-03 01:25:21 +00:00
e l s e
2000-06-21 00:54:56 +00:00
$( INSTALL) $( IFLAGS2) $( SHARED_LIBRARY) $( DIST) /lib
e n d i f
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS2) $( SHARED_LIBRARY) $( FINAL_TARGET)
2000-09-17 05:32:36 +00:00
i f d e f B E O S _ A D D O N _ W O R K A R O U N D
2005-02-18 22:17:37 +00:00
( cd $( FINAL_TARGET) && $( CC) -nostart -o $( SHARED_LIBRARY) .stub $( SHARED_LIBRARY) )
1998-03-28 02:44:41 +00:00
e n d i f
2000-09-17 18:40:42 +00:00
e n d i f # IS_COMPONENT
2000-09-17 05:32:36 +00:00
e n d i f # SHARED_LIBRARY
1998-03-28 02:44:41 +00:00
i f d e f P R O G R A M
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS2) $( PROGRAM) $( FINAL_TARGET)
1999-01-23 11:41:15 +00:00
e n d i f
i f d e f S I M P L E _ P R O G R A M S
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS2) $( SIMPLE_PROGRAMS) $( FINAL_TARGET)
2000-03-31 07:18:52 +00:00
e n d i f
i f d e f H O S T _ P R O G R A M
$( INSTALL) $( IFLAGS2) $( HOST_PROGRAM) $( DIST) /host/bin
e n d i f
i f d e f H O S T _ S I M P L E _ P R O G R A M S
$( INSTALL) $( IFLAGS2) $( HOST_SIMPLE_PROGRAMS) $( DIST) /host/bin
e n d i f
i f d e f H O S T _ L I B R A R Y
$( INSTALL) $( IFLAGS1) $( HOST_LIBRARY) $( DIST) /host/lib
1998-03-28 02:44:41 +00:00
e n d i f
2006-09-27 15:23:31 +00:00
i f d e f J A V A _ L I B R A R Y
i f d e f I S _ C O M P O N E N T
$( INSTALL) $( IFLAGS1) $( JAVA_LIBRARY) $( FINAL_TARGET) /components
e l s e
$( INSTALL) $( IFLAGS1) $( JAVA_LIBRARY) $( FINAL_TARGET)
e n d i f
e n d i f # JAVA_LIBRARY
2001-12-31 09:04:25 +00:00
e n d i f # !NO_DIST_INSTALL
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_DIRS)
1998-03-28 02:44:41 +00:00
2002-04-25 02:52:44 +00:00
##############################################
2008-02-20 23:29:11 +00:00
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-09-25 16:50:53 +00:00
i f d e f M O Z _ P R O F I L E _ U S E
2008-02-20 23:29:11 +00:00
i f e q ( $( OS_ARCH ) _ $( GNU_CC ) $( INTERNAL_TOOLS ) , W I N N T _ )
2009-09-25 16:50:53 +00:00
# When building with PGO, we have to make sure to re-link
# in the MOZ_PROFILE_USE phase if we linked in the
# MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
# file in the link rule in the GENERATE phase to indicate
# that we need a relink.
2008-02-20 23:29:11 +00:00
i f d e f S H A R E D _ L I B R A R Y
2009-09-25 16:50:53 +00:00
$(SHARED_LIBRARY) : pgo .relink
2008-02-20 23:29:11 +00:00
e n d i f
i f d e f P R O G R A M
2009-09-25 16:50:53 +00:00
$(PROGRAM) : pgo .relink
2008-02-20 23:29:11 +00:00
e n d i f
# In the second pass, we need to merge the pgc files into the pgd file.
# The compiler would do this for us automatically if they were in the right
# place, but they're in dist/bin.
2009-01-08 18:52:38 +00:00
i f n e q ( , $( SHARED_LIBRARY ) $( PROGRAM ) )
2008-02-20 23:29:11 +00:00
export ::
2009-01-08 18:52:38 +00:00
i f d e f P R O G R A M
2008-02-20 23:29:11 +00:00
$( PYTHON) $( topsrcdir) /build/win32/pgomerge.py \
2009-01-08 18:52:38 +00:00
$( PROGRAM:$( BIN_SUFFIX) = ) $( DIST) /bin
e n d i f
i f d e f S H A R E D _ L I B R A R Y
$( PYTHON) $( topsrcdir) /build/win32/pgomerge.py \
2008-12-24 19:04:43 +00:00
$( SHARED_LIBRARY_NAME) $( DIST) /bin
2009-01-08 18:52:38 +00:00
e n d i f
2009-09-25 16:50:53 +00:00
e n d i f # SHARED_LIBRARY || PROGRAM
2008-02-20 23:29:11 +00:00
e n d i f # WINNT_
e n d i f # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
e n d i f # NO_PROFILE_GUIDED_OPTIMIZE
##############################################
1999-02-17 17:33:07 +00:00
checkout :
2000-03-31 01:24:48 +00:00
$( MAKE) -C $( topsrcdir) -f client.mk checkout
1999-02-17 17:33:07 +00:00
2000-03-14 03:00:52 +00:00
clean clobber realclean clobber_all :: $( SUBMAKEFILES )
2001-06-26 21:21:10 +00:00
-rm -f $( ALL_TRASH)
-rm -rf $( ALL_TRASH_DIRS)
2009-02-27 21:03:53 +00:00
$( foreach dir,$( PARALLEL_DIRS) $( DIRS) $( STATIC_DIRS) $( TOOL_DIRS) ,-$( call SUBMAKE,$@ ,$( dir) ) )
1998-03-28 02:44:41 +00:00
1999-08-24 21:45:06 +00:00
distclean :: $( SUBMAKEFILES )
2009-02-27 21:03:53 +00:00
$( foreach dir,$( PARALLEL_DIRS) $( DIRS) $( STATIC_DIRS) $( TOOL_DIRS) ,-$( call SUBMAKE,$@ ,$( dir) ) )
2001-06-16 23:47:49 +00:00
-rm -rf $( ALL_TRASH_DIRS)
-rm -f $( ALL_TRASH) \
2000-12-12 21:28:24 +00:00
Makefile .HSancillary \
2005-06-29 16:28:02 +00:00
$( wildcard *.$( OBJ_SUFFIX) ) $( wildcard *.ho) $( wildcard host_*.o*) \
2003-04-23 00:54:38 +00:00
$( wildcard *.$( LIB_SUFFIX) ) $( wildcard *$( DLL_SUFFIX) ) \
$( wildcard *.$( IMPORT_LIB_SUFFIX) )
2008-10-11 01:01:28 +00:00
i f e q ( $( OS_ARCH ) , O S 2 )
2001-06-16 23:47:49 +00:00
-rm -f $( PROGRAM:.exe= .map)
e n d i f
1999-06-03 22:23:06 +00:00
1998-03-28 02:44:41 +00:00
alltags :
rm -f TAGS
1999-06-11 20:21:48 +00:00
find $( topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $( TAG_PROGRAM)
1998-03-28 02:44:41 +00:00
1999-01-23 11:41:15 +00:00
#
# PROGRAM = Foo
# creates OBJS, links with LIBS to create Foo
#
2008-11-28 02:26:44 +00:00
$(PROGRAM) : $( PROGOBJS ) $( LIBS_DEPS ) $( EXTRA_DEPS ) $( EXE_DEF_FILE ) $( RESFILE ) $( GLOBAL_DEPS )
2005-04-22 19:06:27 +00:00
i f e q ( W I N C E , $( OS_ARCH ) )
2005-06-01 14:28:35 +00:00
$( LD) -NOLOGO -OUT:$@ $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( PROGOBJS) $( RESFILE) $( LIBS) $( EXTRA_LIBS) $( OS_LIBS)
2005-04-22 19:06:27 +00:00
e l s e
2001-12-09 07:08:58 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( OS_ARCH ) )
2008-11-04 19:38:40 +00:00
$( LD) -NOLOGO -OUT:$@ -PDB:$( LINK_PDBFILE) $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( PROGOBJS) $( RESFILE) $( LIBS) $( EXTRA_LIBS) $( OS_LIBS)
2006-01-23 17:16:17 +00:00
i f d e f M S M A N I F E S T _ T O O L
@if test -f $@ .manifest; then \
2006-03-21 14:49:45 +00:00
if test -f " $( srcdir) / $@ .manifest " ; then \
mt.exe -NOLOGO -MANIFEST " $( win_srcdir) / $@ .manifest " $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
else \
mt.exe -NOLOGO -MANIFEST $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
fi ; \
2006-01-23 17:16:17 +00:00
rm -f $@ .manifest; \
fi
e n d i f # MSVC with manifest tool
2009-09-25 16:50:53 +00:00
i f d e f M O Z _ P R O F I L E _ G E N E R A T E
# touch it a few seconds into the future to work around FAT's
# 2-second granularity
touch -t ` date +%Y%m%d%H%M.%S -d "now+5seconds" ` pgo.relink
e n d i f
e l s e # !WINNT || GNU_CC
1999-02-17 00:32:17 +00:00
i f e q ( $( CPP_PROG_LINK ) , 1 )
2009-09-15 17:06:32 +00:00
$( CCC) -o $@ $( CXXFLAGS) $( WRAP_MALLOC_CFLAGS) $( PROGOBJS) $( RESFILE) $( WIN32_EXE_LDFLAGS) $( SOLARIS_JEMALLOC_LDFLAGS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS) $( BIN_FLAGS) $( WRAP_MALLOC_LIB) $( EXE_DEF_FILE)
2000-03-31 10:49:39 +00:00
e l s e # ! CPP_PROG_LINK
2008-04-30 07:14:44 +00:00
$( CC) -o $@ $( CFLAGS) $( PROGOBJS) $( RESFILE) $( WIN32_EXE_LDFLAGS) $( SOLARIS_JEMALLOC_LDFLAGS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS) $( BIN_FLAGS) $( EXE_DEF_FILE)
2000-12-05 03:49:03 +00:00
e n d i f # CPP_PROG_LINK
2001-12-09 07:08:58 +00:00
e n d i f # WINNT && !GNU_CC
2005-04-22 19:06:27 +00:00
e n d i f # WINCE
2001-10-26 08:36:28 +00:00
i f d e f E N A B L E _ S T R I P
$( STRIP) $@
e n d i f
2001-10-26 12:39:30 +00:00
i f d e f M O Z _ P O S T _ P R O G R A M _ C O M M A N D
$( MOZ_POST_PROGRAM_COMMAND) $@
e n d i f
1999-06-26 08:16:01 +00:00
i f e q ( $( OS_ARCH ) , B e O S )
i f d e f B E O S _ P R O G R A M _ R E S O U R C E
xres -o $@ $( BEOS_PROGRAM_RESOURCE)
mimeset $@
e n d i f
2000-03-31 10:49:39 +00:00
e n d i f # BeOS
1999-01-23 09:36:40 +00:00
2008-11-28 02:26:44 +00:00
$(HOST_PROGRAM) : $( HOST_PROGOBJS ) $( HOST_LIBS_DEPS ) $( HOST_EXTRA_DEPS ) $( GLOBAL_DEPS )
2005-04-22 19:06:27 +00:00
i f e q ( W I N C E , $( OS_ARCH ) )
2005-06-22 15:55:32 +00:00
$( HOST_LD) -NOLOGO -OUT:$@ $( HOST_OBJS) $( WIN32_EXE_LDFLAGS) $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2005-06-29 16:28:02 +00:00
e l s e
2006-01-24 17:25:42 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( HOST_OS_ARCH ) )
2008-11-04 19:38:40 +00:00
$( HOST_LD) -NOLOGO -OUT:$@ -PDB:$( HOST_PDBFILE) $( HOST_OBJS) $( WIN32_EXE_LDFLAGS) $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2006-01-23 17:16:17 +00:00
i f d e f M S M A N I F E S T _ T O O L
@if test -f $@ .manifest; then \
2009-08-03 22:01:55 +00:00
if test -f " $( srcdir) / $@ .manifest " ; then \
mt.exe -NOLOGO -MANIFEST " $( win_srcdir) / $@ .manifest " $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
else \
mt.exe -NOLOGO -MANIFEST $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
fi ; \
2006-01-23 17:16:17 +00:00
rm -f $@ .manifest; \
fi
e n d i f # MSVC with manifest tool
2002-11-15 03:41:17 +00:00
e l s e
2007-04-27 11:47:10 +00:00
i f e q ( $( CPP_PROG_LINK ) , 1 )
2007-05-14 14:21:44 +00:00
$( HOST_CXX) -o $@ $( HOST_CXXFLAGS) $( HOST_LDFLAGS) $( HOST_PROGOBJS) $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2007-04-27 11:47:10 +00:00
e l s e
2007-05-14 14:21:44 +00:00
$( HOST_CC) -o $@ $( HOST_CFLAGS) $( HOST_LDFLAGS) $( HOST_PROGOBJS) $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2007-04-27 11:47:10 +00:00
e n d i f # CPP_PROG_LINK
2002-11-15 03:41:17 +00:00
e n d i f
2003-01-15 21:36:53 +00:00
e n d i f
2000-03-31 07:18:52 +00:00
1999-01-23 11:41:15 +00:00
#
# This is an attempt to support generation of multiple binaries
# in one directory, it assumes everything to compile Foo is in
# Foo.o (from either Foo.c or Foo.cpp).
#
# SIMPLE_PROGRAMS = Foo Bar
# creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
#
2008-11-28 02:26:44 +00:00
$(SIMPLE_PROGRAMS) : %$( BIN_SUFFIX ) : %.$( OBJ_SUFFIX ) $( LIBS_DEPS ) $( EXTRA_DEPS ) $( GLOBAL_DEPS )
2005-04-22 19:06:27 +00:00
i f e q ( W I N C E , $( OS_ARCH ) )
2005-06-01 14:28:35 +00:00
$( LD) -nologo -entry:main -out:$@ $< $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( LIBS) $( EXTRA_LIBS) $( OS_LIBS)
2005-04-22 19:06:27 +00:00
e l s e
2001-12-09 07:08:58 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( OS_ARCH ) )
2008-11-04 19:38:40 +00:00
$( LD) -nologo -out:$@ -pdb:$( LINK_PDBFILE) $< $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( LIBS) $( EXTRA_LIBS) $( OS_LIBS)
2006-01-23 17:16:17 +00:00
i f d e f M S M A N I F E S T _ T O O L
@if test -f $@ .manifest; then \
mt.exe -NOLOGO -MANIFEST $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
rm -f $@ .manifest; \
fi
e n d i f # MSVC with manifest tool
2000-03-31 01:24:48 +00:00
e l s e
2001-12-09 07:08:58 +00:00
i f e q ( $( CPP_PROG_LINK ) , 1 )
2009-09-15 17:06:32 +00:00
$( CCC) $( WRAP_MALLOC_CFLAGS) $( CXXFLAGS) -o $@ $< $( WIN32_EXE_LDFLAGS) $( SOLARIS_JEMALLOC_LDFLAGS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS) $( WRAP_MALLOC_LIB) $( BIN_FLAGS)
1999-01-23 12:20:00 +00:00
e l s e
2009-09-15 17:06:32 +00:00
$( CC) $( WRAP_MALLOC_CFLAGS) $( CFLAGS) $( OUTOPTION) $@ $< $( WIN32_EXE_LDFLAGS) $( SOLARIS_JEMALLOC_LDFLAGS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS) $( WRAP_MALLOC_LIB) $( BIN_FLAGS)
2001-12-09 07:08:58 +00:00
e n d i f # CPP_PROG_LINK
e n d i f # WINNT && !GNU_CC
2005-04-22 19:06:27 +00:00
e n d i f # WINCE
2001-10-26 08:36:28 +00:00
i f d e f E N A B L E _ S T R I P
$( STRIP) $@
1999-01-23 12:20:00 +00:00
e n d i f
2001-10-26 12:39:30 +00:00
i f d e f M O Z _ P O S T _ P R O G R A M _ C O M M A N D
$( MOZ_POST_PROGRAM_COMMAND) $@
e n d i f
1999-01-23 11:41:15 +00:00
2008-11-28 02:26:44 +00:00
$(HOST_SIMPLE_PROGRAMS) : host_ %$( HOST_BIN_SUFFIX ) : host_ %.$( OBJ_SUFFIX ) $( HOST_LIBS_DEPS ) $( HOST_EXTRA_DEPS ) $( GLOBAL_DEPS )
2005-07-05 17:02:20 +00:00
i f e q ( W I N C E , $( OS_ARCH ) )
$( HOST_LD) -NOLOGO -OUT:$@ $( WIN32_EXE_LDFLAGS) $< $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2006-01-24 17:25:42 +00:00
e l s e
i f e q ( W I N N T _ , $( HOST_OS_ARCH ) _ $( GNU_CC ) )
2008-11-04 19:38:40 +00:00
$( HOST_LD) -NOLOGO -OUT:$@ -PDB:$( HOST_PDBFILE) $< $( WIN32_EXE_LDFLAGS) $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2007-03-26 18:29:16 +00:00
e l s e
2007-07-16 18:40:49 +00:00
i f n e q ( , $( HOST_CPPSRCS ) $( USE_HOST_CXX ) )
2007-04-20 08:12:30 +00:00
$( HOST_CXX) $( HOST_OUTOPTION) $@ $( HOST_CXXFLAGS) $( INCLUDES) $< $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2005-07-05 17:02:20 +00:00
e l s e
2007-03-26 18:17:02 +00:00
$( HOST_CC) $( HOST_OUTOPTION) $@ $( HOST_CFLAGS) $( INCLUDES) $< $( HOST_LIBS) $( HOST_EXTRA_LIBS)
2005-07-05 17:02:20 +00:00
e n d i f
2006-01-24 17:25:42 +00:00
e n d i f
e n d i f
2000-03-31 07:18:52 +00:00
1999-01-27 07:17:32 +00:00
#
# Purify target. Solaris/sparc only to start.
# Purify does not recognize "egcs" or "c++" so we go with
# "gcc" and "g++" for now.
#
pure : $( PROGRAM )
1999-02-17 00:32:17 +00:00
i f e q ( $( CPP_PROG_LINK ) , 1 )
1999-12-22 03:40:16 +00:00
$( PURIFY) $( CCC) -o $^.pure $( CXXFLAGS) $( PROGOBJS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS)
1999-01-27 07:17:32 +00:00
e l s e
1999-12-22 03:40:16 +00:00
$( PURIFY) $( CC) -o $^.pure $( CFLAGS) $( PROGOBJS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS)
1999-01-27 07:17:32 +00:00
e n d i f
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS2) $^.pure $( FINAL_TARGET)
2001-12-31 09:04:25 +00:00
e n d i f
1999-01-23 11:41:15 +00:00
1999-03-10 08:32:42 +00:00
quantify : $( PROGRAM )
i f e q ( $( CPP_PROG_LINK ) , 1 )
1999-12-22 03:40:16 +00:00
$( QUANTIFY) $( CCC) -o $^.quantify $( CXXFLAGS) $( PROGOBJS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS)
1999-03-10 08:32:42 +00:00
e l s e
1999-12-22 03:40:16 +00:00
$( QUANTIFY) $( CC) -o $^.quantify $( CFLAGS) $( PROGOBJS) $( LDFLAGS) $( LIBS_DIR) $( LIBS) $( OS_LIBS) $( EXTRA_LIBS)
1999-03-10 08:32:42 +00:00
e n d i f
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS2) $^.quantify $( FINAL_TARGET)
2001-12-31 09:04:25 +00:00
e n d i f
1999-03-10 08:32:42 +00:00
1999-03-25 21:01:59 +00:00
#
# This allows us to create static versions of the shared libraries
# that are built using other static libraries. Confused...?
#
i f d e f S H A R E D _ L I B R A R Y _ L I B S
2005-04-22 19:06:27 +00:00
i f e q ( , $( GNU_LD ) $( filter -out OS 2 WINNT WINCE , $ ( OS_ARCH ) ) )
2002-06-17 17:09:57 +00:00
i f n e q ( , $( BUILD_STATIC_LIBS ) $( FORCE_STATIC_LIB ) )
2002-01-25 03:20:51 +00:00
LOBJS += $( SHARED_LIBRARY_LIBS)
2002-06-17 17:09:57 +00:00
e n d i f
2002-01-25 03:20:51 +00:00
e l s e
i f n e q ( , $( filter OSF 1 BSD_OS FreeBSD NetBSD OpenBSD SunOS Darwin ,$ ( OS_ARCH ) ) )
1999-05-20 03:27:20 +00:00
CLEANUP1 := | egrep -v '(________64ELEL_|__.SYMDEF)'
CLEANUP2 := rm -f ________64ELEL_ __.SYMDEF
1999-04-06 23:26:00 +00:00
e l s e
CLEANUP2 := true
e n d i f
SUB_LOBJS = $( shell for lib in $( SHARED_LIBRARY_LIBS) ; do $( AR_LIST) $$ { lib} $( CLEANUP1) ; done ; )
1999-03-25 21:01:59 +00:00
e n d i f
2001-12-18 09:14:29 +00:00
e n d i f
2007-10-10 23:03:14 +00:00
i f d e f M O Z I L L A _ P R O B E _ L I B S
PROBE_LOBJS = $( shell for lib in $( MOZILLA_PROBE_LIBS) ; do $( AR_LIST) $$ { lib} $( CLEANUP1) ; done ; )
e n d i f
i f d e f D T R A C E _ P R O B E _ O B J
EXTRA_DEPS += $( DTRACE_PROBE_OBJ)
e n d i f
2001-12-18 09:14:29 +00:00
2008-11-28 02:26:44 +00:00
$(LIBRARY) : $( OBJS ) $( LOBJS ) $( SHARED_LIBRARY_LIBS ) $( EXTRA_DEPS ) $( GLOBAL_DEPS )
1998-03-28 02:44:41 +00:00
rm -f $@
2005-04-22 19:06:27 +00:00
i f n e q ( , $( GNU_LD ) $( filter -out OS 2 WINNT WINCE , $ ( OS_ARCH ) ) )
1999-03-25 21:01:59 +00:00
i f d e f S H A R E D _ L I B R A R Y _ L I B S
@rm -f $( SUB_LOBJS)
1999-04-06 23:26:00 +00:00
@for lib in $( SHARED_LIBRARY_LIBS) ; do $( AR_EXTRACT) $$ { lib} ; $( CLEANUP2) ; done
2002-01-25 03:20:51 +00:00
e n d i f
1999-03-25 21:01:59 +00:00
e n d i f
1999-08-29 18:10:23 +00:00
$( AR) $( AR_FLAGS) $( OBJS) $( LOBJS) $( SUB_LOBJS)
1998-03-28 02:44:41 +00:00
$( RANLIB) $@
1999-03-25 21:01:59 +00:00
@rm -f foodummyfilefoo $( SUB_LOBJS)
1999-10-08 05:18:46 +00:00
2005-04-22 19:06:27 +00:00
i f e q ( , $( filter -out WINNT WINCE , $ ( OS_ARCH ) ) )
2002-04-19 02:42:28 +00:00
$(IMPORT_LIBRARY) : $( SHARED_LIBRARY )
e n d i f
2003-03-24 14:07:08 +00:00
i f e q ( $( OS_ARCH ) , O S 2 )
$(DEF_FILE) : $( OBJS ) $( SHARED_LIBRARY_LIBS )
1998-03-28 02:44:41 +00:00
rm -f $@
2008-12-24 19:04:43 +00:00
echo LIBRARY $( SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
2003-03-24 14:07:08 +00:00
echo PROTMODE >> $@
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
echo EXPORTS >> $@
2001-03-12 03:33:50 +00:00
i f e q ( $( IS_COMPONENT ) , 1 )
i f e q ( $( HAS_EXTRAEXPORTS ) , 1 )
2006-03-08 18:47:19 +00:00
i f n d e f M O Z _ O S 2 _ U S E _ D E C L S P E C
2003-03-24 14:07:08 +00:00
$( FILTER) $( OBJS) $( SHARED_LIBRARY_LIBS) >> $@
2006-03-08 18:47:19 +00:00
e n d i f
2000-03-31 01:24:48 +00:00
e l s e
2003-09-18 17:24:54 +00:00
echo _NSGetModule >> $@
2001-03-12 03:33:50 +00:00
e n d i f
e l s e
2006-03-08 18:47:19 +00:00
i f n d e f M O Z _ O S 2 _ U S E _ D E C L S P E C
2003-03-24 14:07:08 +00:00
$( FILTER) $( OBJS) $( SHARED_LIBRARY_LIBS) >> $@
2006-03-08 18:47:19 +00:00
e n d i f
2000-03-31 01:24:48 +00:00
e n d i f
$( ADD_TO_DEF_FILE)
2001-07-01 12:11:13 +00:00
2006-03-08 18:47:19 +00:00
i f d e f M O Z _ O S 2 _ U S E _ D E C L S P E C
$(IMPORT_LIBRARY) : $( SHARED_LIBRARY )
e l s e
2003-03-24 14:07:08 +00:00
$(IMPORT_LIBRARY) : $( DEF_FILE )
2006-03-08 18:47:19 +00:00
e n d i f
2000-03-31 01:24:48 +00:00
rm -f $@
2006-03-08 18:47:19 +00:00
$( IMPLIB) $@ $^
1998-03-28 02:44:41 +00:00
$( RANLIB) $@
2001-12-04 21:17:48 +00:00
e n d i f # OS/2
1998-03-28 02:44:41 +00:00
2000-03-31 07:18:52 +00:00
$(HOST_LIBRARY) : $( HOST_OBJS ) Makefile
rm -f $@
2002-09-20 08:57:51 +00:00
$( HOST_AR) $( HOST_AR_FLAGS) $( HOST_OBJS)
2000-03-31 07:18:52 +00:00
$( HOST_RANLIB) $@
2000-04-23 17:48:04 +00:00
i f d e f N O _ L D _ A R C H I V E _ F L A G S
SUB_SHLOBJS = $( SUB_LOBJS)
e n d i f
2007-10-19 22:24:32 +00:00
i f d e f H A V E _ D T R A C E
2007-11-02 06:36:49 +00:00
i f n d e f X P _ M A C O S X
2007-10-19 22:24:32 +00:00
i f d e f D T R A C E _ P R O B E _ O B J
i f n d e f D T R A C E _ L I B _ D E P E N D E N T
$(DTRACE_PROBE_OBJ) : $( OBJS )
dtrace -G -C -32 -s $( MOZILLA_DTRACE_SRC) -o $( DTRACE_PROBE_OBJ) $( OBJS)
e n d i f
e n d i f
e n d i f
2007-11-02 06:36:49 +00:00
e n d i f
2007-10-19 22:24:32 +00:00
2007-06-30 05:20:00 +00:00
# On Darwin (Mac OS X), dwarf2 debugging uses debug info left in .o files,
# so instead of deleting .o files after repacking them into a dylib, we make
# symlinks back to the originals. The symlinks are a no-op for stabs debugging,
# so no need to conditionalize on OS version or debugging format.
2008-11-28 02:26:44 +00:00
$(SHARED_LIBRARY) : $( OBJS ) $( LOBJS ) $( DEF_FILE ) $( RESFILE ) $( SHARED_LIBRARY_LIBS ) $( EXTRA_DEPS ) $( DSO_LDOPTS_DEPS ) $( GLOBAL_DEPS )
2003-09-16 22:36:02 +00:00
i f n d e f I N C R E M E N T A L _ L I N K E R
1998-03-28 02:44:41 +00:00
rm -f $@
2003-09-16 22:36:02 +00:00
e n d i f
2002-12-12 00:08:59 +00:00
i f e q ( $( OS_ARCH ) , O p e n V M S )
@if test ! -f $( VMS_SYMVEC_FILE) ; then \
if test -f $( VMS_SYMVEC_FILE_MODULE) ; then \
echo Creating specific component options file $( VMS_SYMVEC_FILE) ; \
cp $( VMS_SYMVEC_FILE_MODULE) $( VMS_SYMVEC_FILE) ; \
fi ; \
fi
i f d e f I S _ C O M P O N E N T
@if test ! -f $( VMS_SYMVEC_FILE) ; then \
echo Creating generic component options file $( VMS_SYMVEC_FILE) ; \
cp $( VMS_SYMVEC_FILE_COMP) $( VMS_SYMVEC_FILE) ; \
fi
e n d i f
2008-08-26 21:34:36 +00:00
e n d i f # OpenVMS
2000-04-23 17:48:04 +00:00
i f d e f N O _ L D _ A R C H I V E _ F L A G S
1999-08-03 02:08:12 +00:00
i f d e f S H A R E D _ L I B R A R Y _ L I B S
2000-04-23 17:48:04 +00:00
@rm -f $( SUB_SHLOBJS)
1999-08-03 02:08:12 +00:00
@for lib in $( SHARED_LIBRARY_LIBS) ; do $( AR_EXTRACT) $$ { lib} ; $( CLEANUP2) ; done
2008-01-07 22:07:42 +00:00
i f e q ( $( OS_ARCH ) , D a r w i n )
@echo Making symlinks to the original object files in the archive libraries $( SHARED_LIBRARY_LIBS)
@for lib in $( SHARED_LIBRARY_LIBS) ; do \
libdir = ` echo $$ lib| sed -e 's,/[^/]*\.a,,' ` ; \
ofiles = ` $( AR_LIST) $$ { lib} ` ; \
for ofile in $$ ofiles; do \
if [ -f $$ libdir/$$ ofile ] ; then \
rm -f $$ ofile; \
ln -s $$ libdir/$$ ofile $$ ofile; \
fi ; \
done ; \
done
e n d i f
2000-04-23 17:48:04 +00:00
e n d i f # SHARED_LIBRARY_LIBS
e n d i f # NO_LD_ARCHIVE_FLAGS
2007-10-19 22:24:32 +00:00
i f d e f D T R A C E _ L I B _ D E P E N D E N T
2007-10-10 23:03:14 +00:00
@rm -f $( PROBE_LOBJS)
@for lib in $( MOZILLA_PROBE_LIBS) ; do $( AR_EXTRACT) $$ { lib} ; $( CLEANUP2) ; done
2007-11-02 06:36:49 +00:00
i f n d e f X P _ M A C O S X
2007-10-19 22:24:32 +00:00
dtrace -G -C -32 -s $( MOZILLA_DTRACE_SRC) -o $( DTRACE_PROBE_OBJ) $( PROBE_LOBJS)
2007-11-02 06:36:49 +00:00
e n d i f
2007-10-10 23:03:14 +00:00
@for lib in $( MOZILLA_PROBE_LIBS) ; do \
ofiles = ` $( AR_LIST) $$ { lib} ` ; \
$( AR_DELETE) $$ { lib} $$ ofiles; \
done
2007-10-19 22:24:32 +00:00
$( MKSHLIB) $( SHLIB_LDSTARTFILE) $( OBJS) $( LOBJS) $( SUB_SHLOBJS) $( DTRACE_PROBE_OBJ) $( PROBE_LOBJS) $( RESFILE) $( LDFLAGS) $( EXTRA_DSO_LDOPTS) $( OS_LIBS) $( EXTRA_LIBS) $( DEF_FILE) $( SHLIB_LDENDFILE)
2007-10-10 23:03:14 +00:00
@rm -f $( PROBE_LOBJS)
2007-10-19 22:24:32 +00:00
@rm -f $( DTRACE_PROBE_OBJ)
2007-10-10 23:03:14 +00:00
@for lib in $( MOZILLA_PROBE_LIBS) ; do \
if [ -L $$ { lib} ] ; then rm -f ` readlink $$ { lib} ` ; fi ; \
done
@rm -f $( MOZILLA_PROBE_LIBS)
2008-08-26 21:34:36 +00:00
e l s e # ! DTRACE_LIB_DEPENDENT
2007-10-10 23:03:14 +00:00
$( MKSHLIB) $( SHLIB_LDSTARTFILE) $( OBJS) $( DTRACE_PROBE_OBJ) $( LOBJS) $( SUB_SHLOBJS) $( RESFILE) $( LDFLAGS) $( EXTRA_DSO_LDOPTS) $( OS_LIBS) $( EXTRA_LIBS) $( DEF_FILE) $( SHLIB_LDENDFILE)
2007-10-19 22:24:32 +00:00
e n d i f # DTRACE_LIB_DEPENDENT
2007-10-10 23:03:14 +00:00
2006-01-23 17:16:17 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( OS_ARCH ) )
i f d e f M S M A N I F E S T _ T O O L
2007-09-26 10:38:29 +00:00
i f d e f E M B E D _ M A N I F E S T _ A T
2006-01-23 17:16:17 +00:00
@if test -f $@ .manifest; then \
2007-09-26 10:38:29 +00:00
mt.exe -NOLOGO -MANIFEST $@ .manifest -OUTPUTRESOURCE:$@ \; $( EMBED_MANIFEST_AT) ; \
2006-01-23 17:16:17 +00:00
rm -f $@ .manifest; \
fi
2007-09-26 10:38:29 +00:00
e n d i f # EMBED_MANIFEST_AT
2006-01-23 17:16:17 +00:00
e n d i f # MSVC with manifest tool
2009-09-25 16:50:53 +00:00
i f d e f M O Z _ P R O F I L E _ G E N E R A T E
touch -t ` date +%Y%m%d%H%M.%S -d "now+5seconds" ` pgo.relink
e n d i f
2006-01-23 17:16:17 +00:00
e n d i f # WINNT && !GCC
2009-08-27 17:48:18 +00:00
i f n e q ( $( OS_ARCH ) , D a r w i n )
2007-06-30 05:20:00 +00:00
@rm -f $( SUB_SHLOBJS)
e n d i f # Darwin
@rm -f foodummyfilefoo $( DELETE_AFTER_LINK)
1998-03-28 02:44:41 +00:00
chmod +x $@
2001-10-26 08:36:28 +00:00
i f d e f E N A B L E _ S T R I P
$( STRIP) $@
e n d i f
2001-10-26 12:39:30 +00:00
i f d e f M O Z _ P O S T _ D S O _ L I B _ C O M M A N D
$( MOZ_POST_DSO_LIB_COMMAND) $@
e n d i f
1998-03-28 02:44:41 +00:00
2001-05-22 07:52:30 +00:00
i f d e f M O Z _ A U T O _ D E P S
2007-08-17 23:07:39 +00:00
i f d e f C O M P I L E R _ D E P E N D
2009-02-09 06:21:09 +00:00
i f e q ( $( SOLARIS_SUNPRO_CC ) , 1 )
2007-08-17 23:07:39 +00:00
_MDDEPFILE = $( MDDEPDIR) /$( @F) .pp
d e f i n e M A K E _ D E P S _ A U T O _ C C
i f t e s t - d $( @D ) ; t h e n \
echo " Building deps for $< using Sun Studio cc " ; \
$( CC) $( COMPILE_CFLAGS) -xM $< >$( _MDDEPFILE) ; \
f i
e n d e f
d e f i n e M A K E _ D E P S _ A U T O _ C X X
i f t e s t - d $( @D ) ; t h e n \
echo " Building deps for $< using Sun Studio CC " ; \
$( CXX) $( COMPILE_CXXFLAGS) -xM $< >$( _MDDEPFILE) ; \
f i
e n d e f
e n d i f # Sun Studio on Solaris
e l s e # COMPILER_DEPEND
2001-04-05 01:18:34 +00:00
#
# Generate dependencies on the fly
#
2001-10-16 09:26:31 +00:00
_MDDEPFILE = $( MDDEPDIR) /$( @F) .pp
2001-04-05 01:18:34 +00:00
2002-06-21 05:06:47 +00:00
d e f i n e M A K E _ D E P S _ A U T O
i f t e s t - d $( @D ) ; t h e n \
2003-08-05 04:43:49 +00:00
echo " Building deps for $< " ; \
2007-08-30 22:48:28 +00:00
$( MKDEPEND) -o'.$(OBJ_SUFFIX)' -f- $( DEFINES) $( ACDEFINES) $( INCLUDES) $< 2>/dev/null | sed -e "s|^[^ ]*/||" > $( _MDDEPFILE) ; \
2002-06-21 05:06:47 +00:00
f i
e n d e f
2007-08-17 23:07:39 +00:00
MAKE_DEPS_AUTO_CC = $( MAKE_DEPS_AUTO)
MAKE_DEPS_AUTO_CXX = $( MAKE_DEPS_AUTO)
e n d i f # COMPILER_DEPEND
2001-04-05 01:18:34 +00:00
2001-05-22 07:52:30 +00:00
e n d i f # MOZ_AUTO_DEPS
2008-05-28 18:42:31 +00:00
i f d e f M O Z _ M E M O R Y
i f e q ( $( OS_ARCH ) , S u n O S )
SOLARIS_JEMALLOC_LDFLAGS = $( call EXPAND_LIBNAME_PATH,jemalloc,$( DIST) /lib)
e n d i f
e n d i f
2002-11-15 07:24:44 +00:00
# Rules for building native targets must come first because of the host_ prefix
2008-11-28 02:26:44 +00:00
host_%.$(OBJ_SUFFIX) : %.c $( GLOBAL_DEPS )
2002-11-15 07:24:44 +00:00
$( REPORT_BUILD)
2007-03-26 18:17:02 +00:00
$( ELOG) $( HOST_CC) $( HOST_OUTOPTION) $@ -c $( HOST_CFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2008-11-28 02:26:44 +00:00
host_%.$(OBJ_SUFFIX) : %.cpp $( GLOBAL_DEPS )
2007-03-26 18:17:02 +00:00
$( REPORT_BUILD)
$( ELOG) $( HOST_CXX) $( HOST_OUTOPTION) $@ -c $( HOST_CXXFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2002-11-15 07:24:44 +00:00
2008-11-28 02:26:44 +00:00
host_%.$(OBJ_SUFFIX) : %.cc $( GLOBAL_DEPS )
2007-04-27 11:47:10 +00:00
$( REPORT_BUILD)
$( ELOG) $( HOST_CXX) $( HOST_OUTOPTION) $@ -c $( HOST_CXXFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2008-11-28 02:26:44 +00:00
host_%.$(OBJ_SUFFIX) : %.m $( GLOBAL_DEPS )
2007-04-27 11:47:10 +00:00
$( REPORT_BUILD)
2008-02-22 21:08:36 +00:00
$( ELOG) $( HOST_CC) $( HOST_OUTOPTION) $@ -c $( HOST_CFLAGS) $( HOST_CMFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2007-04-27 11:47:10 +00:00
2008-11-28 02:26:44 +00:00
host_%.$(OBJ_SUFFIX) : %.mm $( GLOBAL_DEPS )
2007-04-27 11:47:10 +00:00
$( REPORT_BUILD)
2008-02-22 21:08:36 +00:00
$( ELOG) $( HOST_CXX) $( HOST_OUTOPTION) $@ -c $( HOST_CXXFLAGS) $( HOST_CMMFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2007-04-27 11:47:10 +00:00
2009-02-27 21:03:53 +00:00
% :: %.c $( GLOBAL_DEPS )
2000-02-25 03:55:50 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CC)
2002-12-13 02:36:06 +00:00
$( ELOG) $( CC) $( CFLAGS) $( LDFLAGS) $( OUTOPTION) $@ $( _VPATH_SRCS)
1998-03-28 02:44:41 +00:00
2008-11-28 02:26:44 +00:00
%.$(OBJ_SUFFIX) : %.c $( GLOBAL_DEPS )
2000-02-25 03:55:50 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CC)
2002-12-13 02:36:06 +00:00
$( ELOG) $( CC) $( OUTOPTION) $@ -c $( COMPILE_CFLAGS) $( _VPATH_SRCS)
1998-03-28 02:44:41 +00:00
2008-11-28 02:26:44 +00:00
moc_%.cpp : %.h $( GLOBAL_DEPS )
2001-12-04 21:17:48 +00:00
$( MOC) $< $( OUTOPTION) $@
1999-08-09 14:55:56 +00:00
2007-10-13 22:14:28 +00:00
i f d e f A S F I L E S
1999-03-08 15:01:13 +00:00
# The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
# a '-c' flag.
2008-11-28 02:26:44 +00:00
%.$(OBJ_SUFFIX) : %.$( ASM_SUFFIX ) $( GLOBAL_DEPS )
2002-12-13 02:36:06 +00:00
$( AS) -o $@ $( ASFLAGS) $( AS_DASH_C_FLAG) $( _VPATH_SRCS)
2001-07-02 03:49:50 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
2008-11-28 02:26:44 +00:00
%.$(OBJ_SUFFIX) : %.S $( GLOBAL_DEPS )
1998-08-19 20:42:14 +00:00
$( AS) -o $@ $( ASFLAGS) -c $<
1998-03-28 02:44:41 +00:00
2009-02-27 21:03:53 +00:00
% :: %.cpp $( GLOBAL_DEPS )
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CXX)
2002-12-13 02:36:06 +00:00
$( CCC) $( OUTOPTION) $@ $( CXXFLAGS) $( _VPATH_SRCS) $( LDFLAGS)
1998-03-28 02:44:41 +00:00
#
# Please keep the next two rules in sync.
#
2008-11-28 02:26:44 +00:00
%.$(OBJ_SUFFIX) : %.cc $( GLOBAL_DEPS )
2000-02-25 03:55:50 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CXX)
2002-12-13 02:36:06 +00:00
$( ELOG) $( CCC) $( OUTOPTION) $@ -c $( COMPILE_CXXFLAGS) $( _VPATH_SRCS)
1998-03-28 02:44:41 +00:00
2008-11-28 02:26:44 +00:00
%.$(OBJ_SUFFIX) : %.cpp $( GLOBAL_DEPS )
2000-02-25 03:55:50 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CXX)
1998-03-28 02:44:41 +00:00
i f d e f S T R I C T _ C P L U S P L U S _ S U F F I X
1999-08-20 06:52:59 +00:00
echo " #line 1 \" $* .cpp\" " | cat - $* .cpp > t_$* .cc
2000-02-26 04:21:53 +00:00
$( ELOG) $( CCC) -o $@ -c $( COMPILE_CXXFLAGS) t_$* .cc
1999-08-20 06:52:59 +00:00
rm -f t_$* .cc
1998-03-28 02:44:41 +00:00
e l s e
2002-12-13 02:36:06 +00:00
$( ELOG) $( CCC) $( OUTOPTION) $@ -c $( COMPILE_CXXFLAGS) $( _VPATH_SRCS)
1998-03-28 02:44:41 +00:00
e n d i f #STRICT_CPLUSPLUS_SUFFIX
2008-11-28 02:26:44 +00:00
$(OBJ_PREFIX)%.$(OBJ_SUFFIX) : %.mm $( GLOBAL_DEPS )
2001-10-31 01:20:39 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CXX)
2008-02-22 21:08:36 +00:00
$( ELOG) $( CCC) -o $@ -c $( COMPILE_CXXFLAGS) $( COMPILE_CMMFLAGS) $( _VPATH_SRCS)
2001-10-31 01:20:39 +00:00
2008-11-28 02:26:44 +00:00
$(OBJ_PREFIX)%.$(OBJ_SUFFIX) : %.m $( GLOBAL_DEPS )
2004-06-18 00:56:48 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CC)
2008-02-22 21:08:36 +00:00
$( ELOG) $( CC) -o $@ -c $( COMPILE_CFLAGS) $( COMPILE_CMFLAGS) $( _VPATH_SRCS)
2004-06-18 00:56:48 +00:00
2003-03-08 05:18:43 +00:00
%.s : %.cpp
2003-08-05 04:43:49 +00:00
$( CCC) -S $( COMPILE_CXXFLAGS) $( _VPATH_SRCS)
2003-03-08 05:18:43 +00:00
2007-07-11 17:26:11 +00:00
%.s : %.cc
$( CCC) -S $( COMPILE_CXXFLAGS) $( _VPATH_SRCS)
2003-03-08 05:18:43 +00:00
%.s : %.c
2003-08-05 04:43:49 +00:00
$( CC) -S $( COMPILE_CFLAGS) $( _VPATH_SRCS)
2003-03-08 05:18:43 +00:00
1998-03-28 02:44:41 +00:00
%.i : %.cpp
2003-08-05 04:43:49 +00:00
$( CCC) -C -E $( COMPILE_CXXFLAGS) $( _VPATH_SRCS) > $* .i
1998-03-28 02:44:41 +00:00
2007-07-11 17:26:11 +00:00
%.i : %.cc
$( CCC) -C -E $( COMPILE_CXXFLAGS) $( _VPATH_SRCS) > $* .i
1998-03-28 02:44:41 +00:00
%.i : %.c
2003-08-05 04:43:49 +00:00
$( CC) -C -E $( COMPILE_CFLAGS) $( _VPATH_SRCS) > $* .i
1998-03-28 02:44:41 +00:00
2008-03-13 11:12:10 +00:00
%.i : %.mm
$( CCC) -C -E $( COMPILE_CXXFLAGS) $( COMPILE_CMMFLAGS) $( _VPATH_SRCS) > $* .i
2002-01-01 00:03:57 +00:00
%.res : %.rc
@echo Creating Resource file: $@
2002-03-21 13:45:32 +00:00
i f e q ( $( OS_ARCH ) , O S 2 )
2004-12-02 16:41:01 +00:00
$( RC) $( RCFLAGS:-D%= -d %) -i $( subst /,\, $( srcdir) ) -r $< $@
2003-03-08 05:18:43 +00:00
e l s e
i f d e f G N U _ C C
2003-08-05 04:43:49 +00:00
$( RC) $( RCFLAGS) $( filter-out -U%,$( DEFINES) ) $( INCLUDES:-I%= --include-dir %) $( OUTOPTION) $@ $( _VPATH_SRCS)
2002-03-21 13:45:32 +00:00
e l s e
2003-08-05 04:43:49 +00:00
$( RC) $( RCFLAGS) -r $( DEFINES) $( INCLUDES) $( OUTOPTION) $@ $( _VPATH_SRCS)
2002-03-21 13:45:32 +00:00
e n d i f
2003-03-08 05:18:43 +00:00
e n d i f
2002-01-01 00:03:57 +00:00
2000-05-16 04:41:54 +00:00
# need 3 separate lines for OS/2
2009-02-27 21:03:53 +00:00
% :: %.pl
2000-05-16 04:41:54 +00:00
rm -f $@
cp $< $@
chmod +x $@
1998-03-28 02:44:41 +00:00
2009-02-27 21:03:53 +00:00
% :: %.sh
1998-08-19 20:42:14 +00:00
rm -f $@ ; cp $< $@ ; chmod +x $@
1998-03-28 02:44:41 +00:00
1999-03-22 20:43:05 +00:00
# Cancel these implicit rules
#
% : %, v
% : RCS /%, v
% : s .%
% : SCCS /s .%
2006-09-27 15:23:31 +00:00
###############################################################################
# Java rules
###############################################################################
i f n e q ( , $( filter OS 2 WINNT WINCE ,$ ( OS_ARCH ) ) )
SEP := ;
e l s e
SEP := :
e n d i f
EMPTY :=
SPACE := $( EMPTY) $( EMPTY)
2007-03-07 22:44:16 +00:00
# Cygwin and MSYS have their own special path form, but javac expects the source
# and class paths to be in the DOS form (i.e. e:/builds/...). This function
# does the appropriate conversion on Windows, but is a noop on other systems.
i f e q ( , $( filter -out WINNT WINCE , $ ( HOST_OS_ARCH ) ) )
i f d e f C Y G W I N _ W R A P P E R
normalizepath = $( foreach p,$( 1) ,$( shell cygpath -m $( p) ) )
e l s e
# assume MSYS
2007-05-02 17:02:45 +00:00
# We use 'pwd -W' to get DOS form of the path. However, since the given path
# could be a file or a non-existent path, we cannot call 'pwd -W' directly
# on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
# on it, then merge with the rest of the path.
root-path = $( shell echo $( 1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\1|" )
non-root-path = $( shell echo $( 1) | sed -e "s|\(/[^/]*\)/\?\(.*\)|\2|" )
2009-08-03 16:16:05 +00:00
normalizepath = $( foreach p,$( 1) ,$( if $( filter /%,$( 1) ) ,$( patsubst %/,%,$( shell cd $( call root-path,$( 1) ) && pwd -W) ) /$( call non-root-path,$( 1) ) ,$( 1) ) )
2007-03-07 22:44:16 +00:00
e n d i f
e l s e
normalizepath = $( 1)
e n d i f
_srcdir = $( call normalizepath,$( srcdir) )
2006-09-27 15:23:31 +00:00
i f d e f J A V A _ S O U R C E P A T H
2007-03-07 22:44:16 +00:00
SP = $( subst $( SPACE) ,$( SEP) ,$( call normalizepath,$( strip $( JAVA_SOURCEPATH) ) ) )
_JAVA_SOURCEPATH = " . $( SEP) $( _srcdir) $( SEP) $( SP) "
2006-09-27 15:23:31 +00:00
e l s e
2007-03-07 22:44:16 +00:00
_JAVA_SOURCEPATH = " . $( SEP) $( _srcdir) "
2006-09-27 15:23:31 +00:00
e n d i f
i f d e f J A V A _ C L A S S P A T H
2007-05-02 17:02:45 +00:00
CP = $( subst $( SPACE) ,$( SEP) ,$( call normalizepath,$( strip $( JAVA_CLASSPATH) ) ) )
2006-09-27 15:23:31 +00:00
_JAVA_CLASSPATH = " . $( SEP) $( CP) "
e l s e
_JAVA_CLASSPATH = .
e n d i f
_JAVA_DIR = _java
$(_JAVA_DIR) ::
$( NSINSTALL) -D $@
2008-11-28 02:26:44 +00:00
$(_JAVA_DIR)/%.class : %.java $( GLOBAL_DEPS ) $( _JAVA_DIR )
2006-09-27 19:08:29 +00:00
$( CYGWIN_WRAPPER) $( JAVAC) $( JAVAC_FLAGS) -classpath $( _JAVA_CLASSPATH) \
2006-09-27 15:23:31 +00:00
-sourcepath $( _JAVA_SOURCEPATH) -d $( _JAVA_DIR) $( _VPATH_SRCS)
2008-11-28 02:26:44 +00:00
$(JAVA_LIBRARY) : $( addprefix $ ( _JAVA_DIR ) /,$ ( JAVA_SRCS :.java =.class ) ) $( GLOBAL_DEPS )
2006-09-27 15:23:31 +00:00
$( JAR) cf $@ -C $( _JAVA_DIR) .
GARBAGE_DIRS += $( _JAVA_DIR)
1999-01-29 20:00:50 +00:00
###############################################################################
# Update Makefiles
###############################################################################
2005-02-07 14:55:07 +00:00
# In GNU make 3.80, makefiles must use the /cygdrive syntax, even if we're
# processing them with AS perl. See bug 232003
i f d e f A S _ P E R L
CYGWIN_TOPSRCDIR = -nowrap -p $( topsrcdir) -wrap
e n d i f
1999-08-25 22:09:50 +00:00
# Note: Passing depth to make-makefile is optional.
# It saves the script some work, though.
2002-08-31 04:03:52 +00:00
Makefile : Makefile .in
2005-02-07 14:55:07 +00:00
@$( PERL) $( AUTOCONF_TOOLS) /make-makefile -t $( topsrcdir) -d $( DEPTH) $( CYGWIN_TOPSRCDIR)
1999-08-24 21:45:06 +00:00
1999-09-14 23:09:37 +00:00
i f d e f S U B M A K E F I L E S
1999-09-03 22:18:30 +00:00
# VPATH does not work on some machines in this case, so add $(srcdir)
$(SUBMAKEFILES) : % : $( srcdir ) /%.in
2005-02-07 14:55:07 +00:00
$( PERL) $( AUTOCONF_TOOLS) /make-makefile -t $( topsrcdir) -d $( DEPTH) $( CYGWIN_TOPSRCDIR) $@
1999-09-14 23:09:37 +00:00
e n d i f
1999-01-29 20:00:50 +00:00
2000-04-03 00:56:31 +00:00
i f d e f A U T O U P D A T E _ C O N F I G U R E
$(topsrcdir)/configure : $( topsrcdir ) /configure .in
( cd $( topsrcdir) && $( AUTOCONF) ) && ( cd $( DEPTH) && ./config.status --recheck)
e n d i f
1999-01-29 20:00:50 +00:00
###############################################################################
1998-03-28 02:44:41 +00:00
# Bunch of things that extend the 'export' rule (in order):
1999-01-29 20:00:50 +00:00
###############################################################################
1998-03-28 02:44:41 +00:00
1999-03-22 20:43:05 +00:00
################################################################################
2009-05-18 18:15:05 +00:00
# Copy each element of EXPORTS to $(DIST)/include
1998-03-28 02:44:41 +00:00
2006-08-28 15:24:32 +00:00
i f d e f M O Z _ J A V A X P C O M
2009-05-18 18:15:05 +00:00
i f n e q ( $( XPIDLSRCS ) , )
2006-08-28 15:24:32 +00:00
$(JAVA_DIST_DIR) ::
$( NSINSTALL) -D $@
e n d i f
e n d i f
2005-02-18 22:17:37 +00:00
i f n e q ( $( XPI_NAME ) , )
2008-10-31 00:03:02 +00:00
$(FINAL_TARGET) :
$( NSINSTALL) -D $@
export :: $( FINAL_TARGET )
2005-02-18 22:17:37 +00:00
e n d i f
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2009-05-18 18:15:05 +00:00
i f n e q ( , $( EXPORTS ) )
export :: $( EXPORTS )
$( INSTALL) $( IFLAGS1) $^ $( DIST) /include
e n d i f
2009-05-19 15:08:15 +00:00
e n d i f # NO_DIST_INSTALL
2002-02-25 23:20:01 +00:00
2009-05-18 18:15:05 +00:00
d e f i n e E X P O R T _ N A M E S P A C E _ R U L E
2009-05-19 15:08:15 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2009-05-18 18:15:05 +00:00
export :: $( EXPORTS_ $ ( namespace ) )
$( INSTALL) $( IFLAGS1) $$ ^ $( DIST) /include/$( namespace)
2009-05-19 15:08:15 +00:00
e n d i f # NO_DIST_INSTALL
2009-05-18 18:15:05 +00:00
e n d e f
$( foreach namespace ,$ ( EXPORTS_NAMESPACES ) ,$ ( eval $ ( EXPORT_NAMESPACE_RULE ) ) )
2002-02-25 23:20:01 +00:00
1999-06-03 00:41:11 +00:00
################################################################################
2004-01-16 19:22:43 +00:00
# Copy each element of PREF_JS_EXPORTS
1999-06-03 00:41:11 +00:00
2004-01-16 19:22:43 +00:00
i f d e f G R E _ M O D U L E
PREF_DIR = greprefs
e l s e
2006-01-28 17:32:37 +00:00
i f n e q ( , $( XPI_NAME ) $( LIBXUL_SDK ) )
2005-03-28 19:36:24 +00:00
PREF_DIR = defaults/preferences
e l s e
2004-01-16 19:22:43 +00:00
PREF_DIR = defaults/pref
e n d i f
2005-03-28 19:36:24 +00:00
e n d i f
2004-01-16 19:22:43 +00:00
2007-08-03 14:46:17 +00:00
i f n e q ( $( PREF_JS_EXPORTS ) , )
2004-03-10 00:22:46 +00:00
# on win32, pref files need CRLF line endings... see bug 206029
i f e q ( W I N N T , $( OS_ARCH ) )
PREF_PPFLAGS = --line-endings= crlf
e n d i f
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2008-10-31 00:03:02 +00:00
$(FINAL_TARGET)/$(PREF_DIR) :
$( NSINSTALL) -D $@
libs :: $( FINAL_TARGET ) /$( PREF_DIR ) $( PREF_JS_EXPORTS )
2004-01-16 23:59:09 +00:00
$( EXIT_ON_ERROR) \
2007-03-21 19:03:53 +00:00
for i in $( PREF_JS_EXPORTS) ; do \
dest = $( FINAL_TARGET) /$( PREF_DIR) /` basename $$ i` ; \
$( RM) -f $$ dest; \
2007-04-11 16:35:01 +00:00
$( PYTHON) $( topsrcdir) /config/Preprocessor.py $( PREF_PPFLAGS) $( DEFINES) $( ACDEFINES) $( XULPPFLAGS) $$ i > $$ dest; \
2004-01-16 19:22:43 +00:00
done
e n d i f
e n d i f
2001-12-21 22:29:31 +00:00
################################################################################
2005-02-18 22:17:37 +00:00
# Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
2001-12-21 22:29:31 +00:00
i f n e q ( $( AUTOCFG_JS_EXPORTS ) , )
2005-02-18 22:17:37 +00:00
$(FINAL_TARGET)/defaults/autoconfig ::
2008-10-31 00:03:02 +00:00
$( NSINSTALL) -D $@
1998-03-28 02:44:41 +00:00
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2005-02-18 22:17:37 +00:00
export :: $( AUTOCFG_JS_EXPORTS ) $( FINAL_TARGET ) /defaults /autoconfig
2001-12-21 22:29:31 +00:00
$( INSTALL) $( IFLAGS1) $^
2001-12-31 09:04:25 +00:00
e n d i f
2002-04-25 02:52:44 +00:00
2001-12-21 22:29:31 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
################################################################################
2009-05-18 18:15:05 +00:00
# Export the elements of $(XPIDLSRCS)
2002-02-25 23:20:01 +00:00
# generating .h and .xpt files and moving them to the appropriate places.
1999-05-08 02:06:15 +00:00
2009-05-18 18:15:05 +00:00
i f n e q ( $( XPIDLSRCS ) , )
1999-06-20 08:59:31 +00:00
2005-12-13 23:15:14 +00:00
export :: $( patsubst %.idl ,$ ( XPIDL_GEN_DIR ) /%.h , $ ( XPIDLSRCS ) )
1999-05-26 01:38:36 +00:00
i f n d e f X P I D L _ M O D U L E
1999-09-09 09:24:58 +00:00
XPIDL_MODULE = $( MODULE)
1999-05-26 01:38:36 +00:00
e n d i f
i f e q ( $( XPIDL_MODULE ) , ) # we need $(XPIDL_MODULE) to make $(XPIDL_MODULE).xpt
1999-05-08 22:28:49 +00:00
export :: FORCE
@echo
1999-05-09 08:16:07 +00:00
@echo "*** Error processing XPIDLSRCS:"
1999-05-26 01:38:36 +00:00
@echo "Please define MODULE or XPIDL_MODULE when defining XPIDLSRCS,"
1999-05-08 22:28:49 +00:00
@echo "so we have a module name to use when creating MODULE.xpt."
@echo; sleep 2; false
1999-11-30 04:25:19 +00:00
e n d i f
1999-01-22 01:28:13 +00:00
2009-05-18 18:15:05 +00:00
$(IDL_DIR) ::
2008-10-31 00:03:02 +00:00
$( NSINSTALL) -D $@
1999-01-22 01:28:13 +00:00
2009-05-18 18:15:05 +00:00
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
2000-10-24 21:10:31 +00:00
# warn against overriding existing .h file.
$(XPIDL_GEN_DIR)/.done :
2000-10-25 23:06:55 +00:00
@if test ! -d $( XPIDL_GEN_DIR) ; then echo Creating $( XPIDL_GEN_DIR) /.done; rm -rf $( XPIDL_GEN_DIR) ; mkdir $( XPIDL_GEN_DIR) ; fi
@touch $@
1999-05-08 02:06:15 +00:00
1999-06-20 00:02:37 +00:00
# don't depend on $(XPIDL_GEN_DIR), because the modification date changes
# with any addition to the directory, regenerating all .h files -> everything.
1999-06-20 08:59:31 +00:00
2000-10-24 21:10:31 +00:00
$(XPIDL_GEN_DIR)/%.h : %.idl $( XPIDL_COMPILE ) $( XPIDL_GEN_DIR ) /.done
2000-02-25 03:55:50 +00:00
$( REPORT_BUILD)
2006-01-28 17:32:37 +00:00
$( ELOG) $( XPIDL_COMPILE) -m header -w $( XPIDL_FLAGS) -o $( XPIDL_GEN_DIR) /$* $( _VPATH_SRCS)
2009-05-18 18:15:05 +00:00
@if test -n " $( findstring $* .h, $( EXPORTS) ) " ; \
1999-06-03 20:28:34 +00:00
then echo " *** WARNING: file $* .h generated from $* .idl overrides $( srcdir) / $* .h " ; else true; fi
1999-05-08 02:06:15 +00:00
1999-05-11 23:43:36 +00:00
i f n d e f N O _ G E N _ X P T
1999-05-08 02:06:15 +00:00
# generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
2005-02-18 22:17:37 +00:00
# into $(XPIDL_MODULE).xpt and export it to $(FINAL_TARGET)/components.
2003-02-27 02:53:46 +00:00
$(XPIDL_GEN_DIR)/%.xpt : %.idl $( XPIDL_COMPILE ) $( XPIDL_GEN_DIR ) /.done
2000-02-25 03:55:50 +00:00
$( REPORT_BUILD)
2006-01-28 17:32:37 +00:00
$( ELOG) $( XPIDL_COMPILE) -m typelib -w $( XPIDL_FLAGS) -e $@ -d $( MDDEPDIR) /$* .pp $( _VPATH_SRCS)
1999-05-08 02:06:15 +00:00
2003-02-22 07:40:51 +00:00
# no need to link together if XPIDLSRCS contains only XPIDL_MODULE
i f n e q ( $( XPIDL_MODULE ) . i d l , $( strip $ ( XPIDLSRCS ) ) )
2009-05-18 18:15:05 +00:00
$(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt : $( patsubst %.idl ,$ ( XPIDL_GEN_DIR ) /%.xpt ,$ ( XPIDLSRCS ) ) $( GLOBAL_DEPS ) $( XPIDL_LINK )
$( XPIDL_LINK) $( XPIDL_GEN_DIR) /$( XPIDL_MODULE) .xpt $( patsubst %.idl,$( XPIDL_GEN_DIR) /%.xpt,$( XPIDLSRCS) )
2003-02-22 07:40:51 +00:00
e n d i f # XPIDL_MODULE.xpt != XPIDLSRCS
1999-05-08 02:06:15 +00:00
2001-11-21 08:55:59 +00:00
libs :: $( XPIDL_GEN_DIR ) /$( XPIDL_MODULE ) .xpt
2001-12-31 09:04:25 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2005-02-18 22:17:37 +00:00
$( INSTALL) $( IFLAGS1) $( XPIDL_GEN_DIR) /$( XPIDL_MODULE) .xpt $( FINAL_TARGET) /components
2001-12-31 09:04:25 +00:00
e n d i f
2002-04-25 02:52:44 +00:00
2002-02-25 23:20:01 +00:00
e n d i f # NO_GEN_XPT
GARBAGE_DIRS += $( XPIDL_GEN_DIR)
2009-05-18 18:15:05 +00:00
e n d i f # XPIDLSRCS
2002-02-25 23:20:01 +00:00
i f n e q ( $( XPIDLSRCS ) , )
# export .idl files to $(IDL_DIR)
2005-12-13 17:25:26 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2002-02-25 23:20:01 +00:00
export :: $( XPIDLSRCS ) $( IDL_DIR )
$( INSTALL) $( IFLAGS1) $^
2003-02-27 02:53:46 +00:00
2009-05-18 18:15:05 +00:00
export :: $( patsubst %.idl ,$ ( XPIDL_GEN_DIR ) /%.h , $ ( XPIDLSRCS ) ) $( DIST ) /include
2005-12-13 17:25:26 +00:00
$( INSTALL) $( IFLAGS1) $^
2003-02-27 02:53:46 +00:00
e n d i f # NO_DIST_INSTALL
2002-02-25 23:20:01 +00:00
e n d i f # XPIDLSRCS
2002-06-11 22:26:27 +00:00
#
# General rules for exporting idl files.
#
# WORK-AROUND ONLY, for mozilla/tools/module-deps/bootstrap.pl build.
2007-01-31 03:25:46 +00:00
# Bug to fix idl dependency problems w/o this extra build pass is
2002-06-11 22:26:27 +00:00
# http://bugzilla.mozilla.org/show_bug.cgi?id=145777
#
$(IDL_DIR) ::
2008-10-31 00:03:02 +00:00
$( NSINSTALL) -D $@
2002-06-11 22:26:27 +00:00
2002-10-25 05:59:52 +00:00
export-idl :: $( SUBMAKEFILES ) $( MAKE_DIRS )
2009-05-18 18:15:05 +00:00
i f n e q ( $( XPIDLSRCS ) , )
2002-06-11 22:26:27 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2009-05-18 18:15:05 +00:00
export-idl :: $( XPIDLSRCS ) $( IDL_DIR )
2002-06-11 22:26:27 +00:00
$( INSTALL) $( IFLAGS1) $^
e n d i f
e n d i f
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
2002-06-11 22:26:27 +00:00
2006-08-28 15:24:32 +00:00
i f d e f M O Z _ J A V A X P C O M
2009-05-18 18:15:05 +00:00
i f n e q ( $( XPIDLSRCS ) , )
2006-08-28 15:24:32 +00:00
2009-05-18 18:15:05 +00:00
JAVA_XPIDLSRCS = $( XPIDLSRCS)
2006-08-28 15:24:32 +00:00
# A single IDL file can contain multiple interfaces, which result in multiple
# Java interface files. So use hidden dependency files.
JAVADEPFILES = $( addprefix $( JAVA_GEN_DIR) /.,$( JAVA_XPIDLSRCS:.idl= .java.pp) )
$(JAVA_GEN_DIR) :
$( NSINSTALL) -D $@
GARBAGE_DIRS += $( JAVA_GEN_DIR)
# generate .java files into _javagen/[package name dirs]
_JAVA_GEN_DIR = $( JAVA_GEN_DIR) /$( JAVA_IFACES_PKG_NAME)
$(_JAVA_GEN_DIR) :
$( NSINSTALL) -D $@
$(JAVA_GEN_DIR)/.%.java.pp : %.idl $( XPIDL_COMPILE ) $( _JAVA_GEN_DIR )
$( REPORT_BUILD)
$( ELOG) $( XPIDL_COMPILE) -m java -w -I$( srcdir) -I$( IDL_DIR) -o $( _JAVA_GEN_DIR) /$* $( _VPATH_SRCS)
@touch $@
# "Install" generated Java interfaces. We segregate them based on the XPI_NAME.
# If XPI_NAME is not set, install into the "default" directory.
i f n e q ( $( XPI_NAME ) , )
JAVA_INSTALL_DIR = $( JAVA_DIST_DIR) /$( XPI_NAME)
e l s e
JAVA_INSTALL_DIR = $( JAVA_DIST_DIR) /default
e n d i f
2006-08-28 17:15:52 +00:00
$(JAVA_INSTALL_DIR) :
$( NSINSTALL) -D $@
export :: $( JAVA_DIST_DIR ) $( JAVADEPFILES ) $( JAVA_INSTALL_DIR )
2007-08-03 14:46:17 +00:00
( cd $( JAVA_GEN_DIR) && tar $( TAR_CREATE_FLAGS) - .) | ( cd $( JAVA_INSTALL_DIR) && tar -xf -)
2006-08-28 15:24:32 +00:00
2009-05-18 18:15:05 +00:00
e n d i f # XPIDLSRCS
2006-08-28 15:24:32 +00:00
e n d i f # MOZ_JAVAXPCOM
2002-04-25 02:52:44 +00:00
################################################################################
2005-02-18 22:17:37 +00:00
# Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
2002-04-25 02:52:44 +00:00
i f d e f E X T R A _ C O M P O N E N T S
libs :: $( EXTRA_COMPONENTS )
i f n d e f N O _ D I S T _ I N S T A L L
2006-03-30 13:47:00 +00:00
$( INSTALL) $( IFLAGS1) $^ $( FINAL_TARGET) /components
2009-11-05 14:08:49 +00:00
@$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl $( FINAL_TARGET) /components/components.list $( notdir $^)
2002-04-25 02:52:44 +00:00
e n d i f
e n d i f
2005-01-12 11:23:43 +00:00
i f d e f E X T R A _ P P _ C O M P O N E N T S
libs :: $( EXTRA_PP_COMPONENTS )
i f n d e f N O _ D I S T _ I N S T A L L
$( EXIT_ON_ERROR) \
2008-01-04 08:57:11 +00:00
$( NSINSTALL) -D $( FINAL_TARGET) /components; \
2007-03-21 19:03:53 +00:00
for i in $^; do \
2009-11-05 14:08:49 +00:00
fname = ` basename $$ i` ; \
dest = $( FINAL_TARGET) /components/$$ { fname} ; \
2007-03-21 19:03:53 +00:00
$( RM) -f $$ dest; \
2007-04-11 16:35:01 +00:00
$( PYTHON) $( topsrcdir) /config/Preprocessor.py $( DEFINES) $( ACDEFINES) $( XULPPFLAGS) $$ i > $$ dest; \
2009-11-05 14:08:49 +00:00
$( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/build-list.pl $( FINAL_TARGET) /components/components.list $$ fname; \
2005-01-12 11:23:43 +00:00
done
e n d i f
e n d i f
2007-06-10 22:14:53 +00:00
################################################################################
# Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
i f d e f E X T R A _ J S _ M O D U L E S
libs :: $( EXTRA_JS_MODULES )
i f n d e f N O _ D I S T _ I N S T A L L
$( INSTALL) $( IFLAGS1) $^ $( FINAL_TARGET) /modules
e n d i f
e n d i f
i f d e f E X T R A _ P P _ J S _ M O D U L E S
libs :: $( EXTRA_PP_JS_MODULES )
i f n d e f N O _ D I S T _ I N S T A L L
$( EXIT_ON_ERROR) \
2008-01-04 08:57:11 +00:00
$( NSINSTALL) -D $( FINAL_TARGET) /modules; \
2007-06-10 22:14:53 +00:00
for i in $^; do \
dest = $( FINAL_TARGET) /modules/` basename $$ i` ; \
$( RM) -f $$ dest; \
$( PYTHON) $( topsrcdir) /config/Preprocessor.py $( DEFINES) $( ACDEFINES) $( XULPPFLAGS) $$ i > $$ dest; \
done
e n d i f
e n d i f
2009-05-21 18:12:46 +00:00
################################################################################
# SDK
i f n e q ( , $( SDK_LIBRARY ) )
$(SDK_LIB_DIR) ::
$( NSINSTALL) -D $@
i f n d e f N O _ D I S T _ I N S T A L L
libs :: $( SDK_LIBRARY ) $( SDK_LIB_DIR )
$( INSTALL) $( IFLAGS2) $^
e n d i f
e n d i f # SDK_LIBRARY
i f n e q ( , $( SDK_BINARY ) )
$(SDK_BIN_DIR) ::
$( NSINSTALL) -D $@
i f n d e f N O _ D I S T _ I N S T A L L
libs :: $( SDK_BINARY ) $( SDK_BIN_DIR )
$( INSTALL) $( IFLAGS2) $^
e n d i f
e n d i f # SDK_BINARY
1999-07-27 14:30:34 +00:00
################################################################################
2000-09-20 19:35:24 +00:00
# CHROME PACKAGING
2000-09-09 05:54:35 +00:00
2000-09-20 21:28:30 +00:00
JAR_MANIFEST := $( srcdir) /jar.mn
2000-09-09 05:54:35 +00:00
2003-10-15 20:30:59 +00:00
chrome ::
$( MAKE) realchrome
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
2003-10-15 20:30:59 +00:00
2008-10-31 00:03:02 +00:00
$(FINAL_TARGET)/chrome :
$( NSINSTALL) -D $@
2008-11-26 19:43:59 +00:00
i f n e q ( , $( wildcard $ ( JAR_MANIFEST ) ) )
2002-04-25 02:52:44 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2008-11-26 19:43:59 +00:00
libs realchrome :: $( CHROME_DEPS ) $( FINAL_TARGET ) /chrome
$( PYTHON) $( MOZILLA_DIR) /config/JarMaker.py \
$( QUIET) -j $( FINAL_TARGET) /chrome \
$( MAKE_JARS_FLAGS) $( XULPPFLAGS) $( DEFINES) $( ACDEFINES) \
$( JAR_MANIFEST)
e n d i f
2002-04-25 02:52:44 +00:00
e n d i f
2005-03-28 19:36:24 +00:00
i f n e q ( $( DIST_FILES ) , )
2009-01-30 03:45:58 +00:00
$(DIST)/bin :
$( NSINSTALL) -D $@
libs :: $( DIST_FILES ) $( DIST ) /bin
2005-03-28 19:36:24 +00:00
@$( EXIT_ON_ERROR) \
for f in $( DIST_FILES) ; do \
2007-03-21 19:03:53 +00:00
dest = $( FINAL_TARGET) /` basename $$ f` ; \
$( RM) -f $$ dest; \
2007-04-11 16:35:01 +00:00
$( PYTHON) $( MOZILLA_DIR) /config/Preprocessor.py \
2007-03-21 19:03:53 +00:00
$( XULAPP_DEFINES) $( DEFINES) $( ACDEFINES) $( XULPPFLAGS) \
$( srcdir) /$$ f > $$ dest; \
2005-03-28 19:36:24 +00:00
done
e n d i f
i f n e q ( $( DIST_CHROME_FILES ) , )
libs :: $( DIST_CHROME_FILES )
@$( EXIT_ON_ERROR) \
for f in $( DIST_CHROME_FILES) ; do \
2007-03-21 19:03:53 +00:00
dest = $( FINAL_TARGET) /chrome/` basename $$ f` ; \
$( RM) -f $$ dest; \
2007-04-11 16:35:01 +00:00
$( PYTHON) $( MOZILLA_DIR) /config/Preprocessor.py \
2007-03-21 19:03:53 +00:00
$( XULAPP_DEFINES) $( DEFINES) $( ACDEFINES) $( XULPPFLAGS) \
$( srcdir) /$$ f > $$ dest; \
2005-03-28 19:36:24 +00:00
done
e n d i f
2005-06-01 11:59:09 +00:00
i f n e q ( $( XPI_PKGNAME ) , )
libs realchrome ::
2006-02-06 19:07:40 +00:00
i f d e f S T R I P _ X P I
2006-03-28 21:44:14 +00:00
i f n d e f M O Z _ D E B U G
2006-01-03 19:08:27 +00:00
@echo " Stripping $( XPI_PKGNAME) package directory... "
@echo $( FINAL_TARGET)
@cd $( FINAL_TARGET) && find . ! -type d \
! -name "*.js" \
! -name "*.xpt" \
! -name "*.gif" \
! -name "*.jpg" \
! -name "*.png" \
! -name "*.xpm" \
! -name "*.txt" \
! -name "*.rdf" \
! -name "*.sh" \
! -name "*.properties" \
! -name "*.dtd" \
! -name "*.html" \
! -name "*.xul" \
! -name "*.css" \
! -name "*.xml" \
! -name "*.jar" \
! -name "*.dat" \
! -name "*.tbl" \
! -name "*.src" \
! -name "*.reg" \
$( PLATFORM_EXCLUDE_LIST) \
-exec $( STRIP) $( STRIP_FLAGS) { } >/dev/null 2>& 1 \;
2006-03-28 21:44:14 +00:00
e n d i f
2006-01-03 19:08:27 +00:00
e n d i f
2005-06-01 11:59:09 +00:00
@echo " Packaging $( XPI_PKGNAME) .xpi... "
cd $( FINAL_TARGET) && $( ZIP) -qr ../$( XPI_PKGNAME) .xpi *
e n d i f
i f d e f I N S T A L L _ E X T E N S I O N _ I D
i f n d e f X P I _ N A M E
$( error XPI_NAME must be set for INSTALL_EXTENSION_ID )
e n d i f
libs ::
$( RM) -rf " $( DIST) /bin/extensions/ $( INSTALL_EXTENSION_ID) "
$( NSINSTALL) -D " $( DIST) /bin/extensions/ $( INSTALL_EXTENSION_ID) "
2007-08-03 14:46:17 +00:00
cd $( FINAL_TARGET) && tar $( TAR_CREATE_FLAGS) - . | ( cd " ../../bin/extensions/ $( INSTALL_EXTENSION_ID) " && tar -xf -)
2005-06-01 11:59:09 +00:00
e n d i f
i f n e q ( , $( filter flat symlink ,$ ( MOZ_CHROME_FILE_FORMAT ) ) )
_JAR_REGCHROME_DISABLE_JAR = 1
e l s e
_JAR_REGCHROME_DISABLE_JAR = 0
e n d i f
2004-07-08 15:06:19 +00:00
REGCHROME = $( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/add-chrome.pl \
2007-04-30 23:52:44 +00:00
$( if $( filter gtk2,$( MOZ_WIDGET_TOOLKIT) ) ,-x) \
2005-02-18 22:17:37 +00:00
$( if $( CROSS_COMPILE) ,-o $( OS_ARCH) ) $( FINAL_TARGET) /chrome/installed-chrome.txt \
2004-07-08 15:06:19 +00:00
$( _JAR_REGCHROME_DISABLE_JAR)
REGCHROME_INSTALL = $( PERL) -I$( MOZILLA_DIR) /config $( MOZILLA_DIR) /config/add-chrome.pl \
2007-04-30 23:52:44 +00:00
$( if $( filter gtk2,$( MOZ_WIDGET_TOOLKIT) ) ,-x) \
2004-07-08 15:06:19 +00:00
$( if $( CROSS_COMPILE) ,-o $( OS_ARCH) ) $( DESTDIR) $( mozappdir) /chrome/installed-chrome.txt \
$( _JAR_REGCHROME_DISABLE_JAR)
2000-09-09 05:54:35 +00:00
2007-01-31 03:25:46 +00:00
1998-03-28 02:44:41 +00:00
#############################################################################
2001-05-22 07:52:30 +00:00
# Dependency system
1998-03-28 02:44:41 +00:00
#############################################################################
1999-03-22 20:43:05 +00:00
i f d e f C O M P I L E R _ D E P E N D
depend ::
1999-03-31 19:07:29 +00:00
@echo " $( MAKE) : No need to run depend target.\
Using compiler-based depend." 1>&2
i f e q ( $( GNU_CC ) $( GNU_CXX ) , )
# Non-GNU compilers
@echo " `echo ' $( MAKE) :'|sed 's/./ /g'` " \
2001-05-22 07:52:30 +00:00
'(Compiler-based depend was turned on by "--enable-md".)' 1>& 2
1999-03-31 19:07:29 +00:00
e l s e
# GNU compilers
@space= " `echo ' $( MAKE) : '|sed 's/./ /g'` " ; \
echo " $$ space " ' Since you are using a GNU compiler,\
it is on by default.' 1>& 2; \
echo " $$ space " 'To turn it off, pass --disable-md to configure.' 1>& 2
e n d i f
2001-05-22 07:52:30 +00:00
e l s e # ! COMPILER_DEPEND
1998-03-28 02:44:41 +00:00
2001-05-22 07:52:30 +00:00
i f n d e f M O Z _ A U T O _ D E P S
d e f i n e M A K E _ D E P S _ N O A U T O
2007-08-30 22:48:28 +00:00
$( MKDEPEND) -w1024 -o'.$(OBJ_SUFFIX)' -f- $( DEFINES) $( ACDEFINES) $( INCLUDES) $< 2>/dev/null | sed -e "s|^[^ ]*/||" > $@
2001-05-22 07:52:30 +00:00
e n d e f
$(MDDEPDIR)/%.pp : %.c
2001-12-18 09:14:29 +00:00
$( REPORT_BUILD)
@$( MAKE_DEPS_NOAUTO)
2001-05-22 07:52:30 +00:00
$(MDDEPDIR)/%.pp : %.cpp
2001-12-18 09:14:29 +00:00
$( REPORT_BUILD)
@$( MAKE_DEPS_NOAUTO)
2001-05-22 07:52:30 +00:00
2001-08-08 04:27:32 +00:00
$(MDDEPDIR)/%.pp : %.s
2001-12-18 09:14:29 +00:00
$( REPORT_BUILD)
@$( MAKE_DEPS_NOAUTO)
2001-08-08 04:27:32 +00:00
2009-05-18 18:15:05 +00:00
i f n e q ( , $( OBJS ) $( XPIDLSRCS ) $( SIMPLE_PROGRAMS ) )
2002-04-19 02:42:28 +00:00
depend :: $( SUBMAKEFILES ) $( MAKE_DIRS ) $( MDDEPFILES )
2001-05-22 07:52:30 +00:00
e l s e
depend :: $( SUBMAKEFILES )
e n d i f
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
2001-05-22 07:52:30 +00:00
dependclean :: $( SUBMAKEFILES )
rm -f $( MDDEPFILES)
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
2001-05-22 07:52:30 +00:00
e n d i f # MOZ_AUTO_DEPS
e n d i f # COMPILER_DEPEND
1999-03-22 20:43:05 +00:00
1999-02-17 17:33:07 +00:00
#############################################################################
1999-08-24 21:45:06 +00:00
# MDDEPDIR is the subdirectory where all the dependency files are placed.
# This uses a make rule (instead of a macro) to support parallel
# builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
# processes could simultaneously try to create the same directory.
#
2008-11-10 20:55:46 +00:00
# We use $(CURDIR) in the rule's target to ensure that we don't find
# a dependency directory in the source tree via VPATH (perhaps from
# a previous build in the source tree) and thus neglect to create a
# dependency directory in the object directory, where we really need
# it.
$(CURDIR)/$(MDDEPDIR) :
1999-09-09 09:24:58 +00:00
@if test ! -d $@ ; then echo Creating $@ ; rm -rf $@ ; mkdir $@ ; else true; fi
2008-02-13 13:41:49 +00:00
i f n e q ( , $( filter -out all chrome default export realchrome tools clean clobber clobber_all distclean realclean ,$ ( MAKECMDGOALS ) ) )
2009-05-18 18:15:05 +00:00
i f n e q ( , $( OBJS ) $( XPIDLSRCS ) $( SIMPLE_PROGRAMS ) )
2001-04-05 01:18:34 +00:00
MDDEPEND_FILES := $( strip $( wildcard $( MDDEPDIR) /*.pp) )
1999-09-09 09:24:58 +00:00
2001-04-05 01:18:34 +00:00
i f n e q ( , $( MDDEPEND_FILES ) )
1999-03-11 01:35:33 +00:00
# The script mddepend.pl checks the dependencies and writes to stdout
# one rule to force out-of-date objects. For example,
# foo.o boo.o: FORCE
# The script has an advantage over including the *.pp files directly
1999-05-18 00:26:10 +00:00
# because it handles the case when header files are removed from the build.
# 'make' would complain that there is no way to build missing headers.
2009-10-23 17:00:19 +00:00
ALL_PP_RESULTS = $( shell $( PERL) $( BUILD_TOOLS) /mddepend.pl - $( MDDEPEND_FILES) )
$( eval $ ( ALL_PP_RESULTS ) )
1999-03-09 01:31:26 +00:00
e n d i f
2001-04-05 01:18:34 +00:00
2008-02-13 13:41:49 +00:00
e n d i f
1999-03-10 00:03:12 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
#############################################################################
2008-06-06 19:43:26 +00:00
- i n c l u d e $( topsrcdir ) / $( MOZ_BUILD_APP ) / a p p - r u l e s . m k
1998-03-28 02:44:41 +00:00
- i n c l u d e $( MY_RULES )
#
# This speeds up gmake's processing if these files don't exist.
#
$(MY_CONFIG) $(MY_RULES) :
@touch $@
#
# Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
# or in $(MY_RULES)
#
i f d e f E T A G S
1998-04-15 23:56:45 +00:00
i f n e q ( $( CSRCS ) $( CPPSRCS ) $( HEADERS ) , )
1998-03-28 02:44:41 +00:00
all :: TAGS
TAGS :: $( CSRCS ) $( CPPSRCS ) $( HEADERS )
$( ETAGS) $( CSRCS) $( CPPSRCS) $( HEADERS)
e n d i f
e n d i f
################################################################################
# Special gmake rules.
################################################################################
2007-07-25 13:56:04 +00:00
#
# Disallow parallel builds with MSVC < 8
#
i f n e q ( , $( filter 1200 1300 1310,$ ( _MSC_VER ) ) )
.NOTPARALLEL :
e n d i f
1998-03-28 02:44:41 +00:00
#
# Re-define the list of default suffixes, so gmake won't have to churn through
# hundreds of built-in suffix rules for stuff we don't need.
#
.SUFFIXES :
#
# Fake targets. Always run these rules, even if a file/directory with that
# name already exists.
#
2009-06-27 05:31:32 +00:00
.PHONY : all alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_apprunner tools $( DIRS ) $( TOOL_DIRS ) FORCE
1999-03-09 21:56:44 +00:00
# Used as a dependency to force targets to rebuild
FORCE :
1998-03-28 02:44:41 +00:00
2000-09-28 04:02:15 +00:00
# Delete target if error occurs when building target
.DELETE_ON_ERROR :
2005-11-08 23:08:05 +00:00
# Properly set LIBPATTERNS for the platform
.LIBPATTERNS = $( if $( IMPORT_LIB_SUFFIX) ,$( LIB_PREFIX) %.$( IMPORT_LIB_SUFFIX) ) $( LIB_PREFIX) %.$( LIB_SUFFIX) $( DLL_PREFIX) %$( DLL_SUFFIX)
1999-05-11 23:43:36 +00:00
tags : TAGS
1999-08-24 21:45:06 +00:00
TAGS : $( SUBMAKEFILES ) $( CSRCS ) $( CPPSRCS ) $( wildcard *.h )
1999-05-11 23:43:36 +00:00
-etags $( CSRCS) $( CPPSRCS) $( wildcard *.h)
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
1999-05-11 23:43:36 +00:00
2007-05-23 20:08:44 +00:00
echo-variable-% :
2008-12-19 14:50:24 +00:00
@echo " $( $* ) "
2007-05-23 20:08:44 +00:00
2006-09-11 16:46:41 +00:00
echo-tiers :
@echo $( TIERS)
2008-12-16 18:46:16 +00:00
echo-tier-dirs :
@$( foreach tier,$( TIERS) ,echo '$(tier):' ; echo ' dirs: $(tier_$(tier)_dirs)' ; echo ' staticdirs: $(tier_$(tier)_staticdirs)' ; )
1999-10-21 14:57:38 +00:00
echo-dirs :
@echo $( DIRS)
2001-10-16 20:52:33 +00:00
echo-module :
@echo $( MODULE)
echo-requires :
@echo $( REQUIRES)
1999-10-21 14:57:38 +00:00
echo-depth-path :
2000-09-05 21:42:52 +00:00
@$( topsrcdir) /build/unix/print-depth-path.sh
1999-10-21 14:57:38 +00:00
echo-module-name :
@$( topsrcdir) /build/package/rpm/print-module-name.sh
echo-module-filelist :
@$( topsrcdir) /build/package/rpm/print-module-filelist.sh
2000-03-31 01:24:48 +00:00
showtargs :
2000-03-31 07:18:52 +00:00
i f n e q ( , $( filter $ ( PROGRAM ) $ ( HOST_PROGRAM ) $ ( SIMPLE_PROGRAMS ) $ ( HOST_LIBRARY ) $ ( LIBRARY ) $ ( SHARED_LIBRARY ) ,$ ( TARGETS ) ) )
2000-03-31 01:24:48 +00:00
@echo --------------------------------------------------------------------------------
@echo " PROGRAM = $( PROGRAM) "
@echo " SIMPLE_PROGRAMS = $( SIMPLE_PROGRAMS) "
@echo " LIBRARY = $( LIBRARY) "
@echo " SHARED_LIBRARY = $( SHARED_LIBRARY) "
@echo " SHARED_LIBRARY_LIBS = $( SHARED_LIBRARY_LIBS) "
@echo " LIBS = $( LIBS) "
@echo " DEF_FILE = $( DEF_FILE) "
@echo " IMPORT_LIBRARY = $( IMPORT_LIBRARY) "
@echo " STATIC_LIBS = $( STATIC_LIBS) "
@echo " SHARED_LIBS = $( SHARED_LIBS) "
@echo " EXTRA_DSO_LIBS = $( EXTRA_DSO_LIBS) "
@echo " EXTRA_DSO_LDOPTS = $( EXTRA_DSO_LDOPTS) "
2003-05-04 21:31:57 +00:00
@echo " DEPENDENT_LIBS = $( DEPENDENT_LIBS) "
2000-03-31 01:24:48 +00:00
@echo --------------------------------------------------------------------------------
e n d i f
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
2000-03-31 01:24:48 +00:00
showbuild :
@echo " MOZ_BUILD_ROOT = $( MOZ_BUILD_ROOT) "
@echo " MOZ_WIDGET_TOOLKIT = $( MOZ_WIDGET_TOOLKIT) "
@echo " CC = $( CC) "
@echo " CXX = $( CXX) "
2007-04-27 11:47:10 +00:00
@echo " CCC = $( CCC) "
2000-03-31 01:24:48 +00:00
@echo " CPP = $( CPP) "
@echo " LD = $( LD) "
@echo " AR = $( AR) "
@echo " IMPLIB = $( IMPLIB) "
@echo " FILTER = $( FILTER) "
@echo " MKSHLIB = $( MKSHLIB) "
@echo " MKCSHLIB = $( MKCSHLIB) "
@echo " RC = $( RC) "
@echo " CFLAGS = $( CFLAGS) "
@echo " OS_CFLAGS = $( OS_CFLAGS) "
@echo " COMPILE_CFLAGS = $( COMPILE_CFLAGS) "
@echo " CXXFLAGS = $( CXXFLAGS) "
2001-03-09 07:55:29 +00:00
@echo " OS_CXXFLAGS = $( OS_CXXFLAGS) "
2000-03-31 01:24:48 +00:00
@echo " COMPILE_CXXFLAGS = $( COMPILE_CXXFLAGS) "
2008-02-22 21:08:36 +00:00
@echo " COMPILE_CMFLAGS = $( COMPILE_CMFLAGS) "
@echo " COMPILE_CMMFLAGS = $( COMPILE_CMMFLAGS) "
2000-03-31 01:24:48 +00:00
@echo " LDFLAGS = $( LDFLAGS) "
@echo " OS_LDFLAGS = $( OS_LDFLAGS) "
@echo " DSO_LDOPTS = $( DSO_LDOPTS) "
@echo " OS_INCLUDES = $( OS_INCLUDES) "
@echo " OS_LIBS = $( OS_LIBS) "
@echo " EXTRA_LIBS = $( EXTRA_LIBS) "
@echo " BIN_FLAGS = $( BIN_FLAGS) "
@echo " INCLUDES = $( INCLUDES) "
@echo " DEFINES = $( DEFINES) "
@echo " ACDEFINES = $( ACDEFINES) "
@echo " BIN_SUFFIX = $( BIN_SUFFIX) "
@echo " LIB_SUFFIX = $( LIB_SUFFIX) "
@echo " DLL_SUFFIX = $( DLL_SUFFIX) "
2003-04-23 00:54:38 +00:00
@echo " IMPORT_LIB_SUFFIX = $( IMPORT_LIB_SUFFIX) "
2000-03-31 01:24:48 +00:00
@echo " INSTALL = $( INSTALL) "
2000-04-02 16:15:42 +00:00
showhost :
@echo " HOST_CC = $( HOST_CC) "
2007-04-27 11:47:10 +00:00
@echo " HOST_CXX = $( HOST_CXX) "
2000-04-02 16:15:42 +00:00
@echo " HOST_CFLAGS = $( HOST_CFLAGS) "
2002-12-12 00:08:59 +00:00
@echo " HOST_LDFLAGS = $( HOST_LDFLAGS) "
2000-04-02 16:15:42 +00:00
@echo " HOST_LIBS = $( HOST_LIBS) "
@echo " HOST_EXTRA_LIBS = $( HOST_EXTRA_LIBS) "
@echo " HOST_EXTRA_DEPS = $( HOST_EXTRA_DEPS) "
@echo " HOST_PROGRAM = $( HOST_PROGRAM) "
2007-04-27 11:47:10 +00:00
@echo " HOST_OBJS = $( HOST_OBJS) "
2000-04-02 16:15:42 +00:00
@echo " HOST_PROGOBJS = $( HOST_PROGOBJS) "
2007-04-27 11:47:10 +00:00
@echo " HOST_LIBRARY = $( HOST_LIBRARY) "
2000-04-02 16:15:42 +00:00
2000-04-21 01:14:45 +00:00
showbuildmods ::
@echo " Build Modules = $( BUILD_MODULES) "
@echo " Module dirs = $( BUILD_MODULE_DIRS) "
2002-02-22 11:11:24 +00:00
documentation :
@cd $( DEPTH)
2002-11-11 04:04:49 +00:00
$( DOXYGEN) $( DEPTH) /config/doxygen.cfg
2005-08-11 16:41:54 +00:00
2009-04-26 21:32:41 +00:00
i f d e f E N A B L E _ T E S T S
2005-08-11 16:41:54 +00:00
check :: $( SUBMAKEFILES ) $( MAKE_DIRS )
2009-02-27 21:03:53 +00:00
$( LOOP_OVER_PARALLEL_DIRS)
$( LOOP_OVER_DIRS)
$( LOOP_OVER_TOOL_DIRS)
2009-04-26 21:32:41 +00:00
e n d i f
2009-05-18 18:15:05 +00:00
FREEZE_VARIABLES = \
CSRCS \
CPPSRCS \
EXPORTS \
XPIDLSRCS \
DIRS \
LIBRARY \
MODULE \
REQUIRES \
SHORT_LIBNAME \
TIERS \
$( NULL)
$(foreach var,$(FREEZE_VARIABLES),$(eval $(var)_FROZEN : = '$( $ ( var ) ) '))
CHECK_FROZEN_VARIABLES = $( foreach var,$( FREEZE_VARIABLES) , \
$( if $( subst $( $( var) _FROZEN) ,,'$($(var))' ) ,$( error Makefile variable '$(var)' changed value after including rules.mk. Was $( $( var) _FROZEN) , now $( $( var) ) .) ) )
libs export libs ::
$( CHECK_FROZEN_VARIABLES)