2011-07-07 15:29:41 +00:00
# -*- makefile -*-
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
#
2012-04-02 17:06:06 +00:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
1998-03-28 02:44:41 +00:00
#
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
2013-02-25 20:47:11 +00:00
# Integrate with mozbuild-generated make files. We first verify that no
# variables provided by the automatically generated .mk files are
# present. If they are, this is a violation of the separation of
# responsibility between Makefile.in and mozbuild files.
_MOZBUILD_EXTERNAL_VARIABLES := \
2013-07-24 07:24:07 +00:00
CPP_UNIT_TESTS \
2013-02-25 20:47:11 +00:00
DIRS \
2013-06-20 19:59:59 +00:00
EXTRA_PP_COMPONENTS \
2013-08-02 07:03:25 +00:00
EXTRA_PP_JS_MODULES \
2013-06-22 14:33:31 +00:00
GTEST_CMMSRCS \
GTEST_CPPSRCS \
GTEST_CSRCS \
2013-06-18 13:10:50 +00:00
HOST_CSRCS \
2013-06-19 13:19:25 +00:00
HOST_LIBRARY_NAME \
2013-03-19 18:47:00 +00:00
MODULE \
2013-07-10 19:08:21 +00:00
NO_DIST_INSTALL \
2013-02-25 20:47:11 +00:00
PARALLEL_DIRS \
TEST_DIRS \
TIERS \
TOOL_DIRS \
2013-03-12 05:00:00 +00:00
XPIDL_MODULE \
2013-02-25 20:47:11 +00:00
$( NULL)
i f n d e f E X T E R N A L L Y _ M A N A G E D _ M A K E _ F I L E
2013-03-12 17:15:24 +00:00
# Using $(firstword) may not be perfect. But it should be good enough for most
# scenarios.
_current_makefile = $( CURDIR) /$( firstword $( MAKEFILE_LIST) )
2013-02-25 20:47:11 +00:00
$( foreach var ,$ ( _MOZBUILD_EXTERNAL_VARIABLES ) ,$ ( if $ ( $ ( var ) ) ,\
2013-03-12 17:15:24 +00:00
$( error Variable $( var) is defined in $( _current_makefile) . It should only be defined in moz.build files) ,\
2013-02-25 20:47:11 +00:00
) )
2013-03-12 17:15:24 +00:00
i f n e q ( , $( XPIDLSRCS ) $( SDK_XPIDLSRCS ) )
$( error XPIDLSRCS and SDK_XPIDLSRCS have been merged and moved to moz.build files as the XPIDL_SOURCES variable. You must move these variables out of $( _current_makefile) )
e n d i f
2013-02-25 20:47:11 +00:00
# Import the automatically generated backend file. If this file doesn't exist,
# the backend hasn't been properly configured. We want this to be a fatal
# error, hence not using "-include".
i f n d e f S T A N D A L O N E _ M A K E F I L E
GLOBAL_DEPS += backend.mk
i n c l u d e b a c k e n d . m k
e n d i f
e n d i f
i f d e f T I E R S
DIRS += $( foreach tier,$( TIERS) ,$( tier_$( tier) _dirs) )
STATIC_DIRS += $( foreach tier,$( TIERS) ,$( tier_$( tier) _staticdirs) )
e n d i f
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
2012-05-15 16:20:30 +00:00
USE_AUTOTARGETS_MK = 1
2012-04-03 20:08:16 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / m a k e f i l e s / m a k e u t i l s . m k
2013-03-06 20:05:24 +00:00
# Only build with Pymake (not GNU make) on Windows.
i f e q ( $( HOST_OS_ARCH ) , W I N N T )
i f n d e f L 1 0 N B A S E D I R
i f n d e f . P Y M A K E
$( error Pymake is required to build on Windows . Run |./mach build | to \
a u t o m a t i c a l l y u s e p y m a k e o r i n v o k e p y m a k e d i r e c t l y v i a \
| p y t h o n b u i l d / p y m a k e / m a k e . p y | . )
e n d i f
e n d i f
e n d i f
2009-05-18 18:15:05 +00:00
i f d e f S D K _ H E A D E R S
2012-08-29 06:55:57 +00:00
_EXTRA_EXPORTS := $( filter-out $( EXPORTS) ,$( SDK_HEADERS) )
EXPORTS += $( _EXTRA_EXPORTS)
2009-05-18 18:15:05 +00:00
e n d i f
2012-08-06 16:14:13 +00:00
REPORT_BUILD = $( info $( notdir $<) )
2011-12-08 18:14:06 +00:00
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
2012-08-06 16:14:13 +00:00
# ELOG prints out failed command when building silently (gmake -s). Pymake
# prints out failed commands anyway, so ELOG just makes things worse by
# forcing shell invocations.
i f n d e f . P Y M A K E
2011-01-05 22:17:10 +00:00
i f n e q ( , $( findstring s , $ ( filter -out --%, $ ( 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 :=
2012-08-06 16:14:13 +00:00
e n d i f # -s
e l s e
ELOG :=
e n d i f # ifndef .PYMAKE
2000-02-26 04:21:53 +00:00
2009-09-22 13:05:48 +00:00
_VPATH_SRCS = $( abspath $<)
2002-12-13 02:36:06 +00:00
2008-12-04 06:25:00 +00:00
################################################################################
# Testing frameworks support
################################################################################
2010-12-03 20:24:22 +00:00
testxpcobjdir = $( DEPTH) /_tests/xpcshell
2008-12-04 06:25:00 +00:00
i f d e f E N A B L E _ T E S T S
2011-11-11 20:25:22 +00:00
# Add test directories to the regular directories list. TEST_DIRS should
# arguably have the same status as TOOL_DIRS and other *_DIRS variables. It is
# coded this way until Makefiles stop using the "ifdef ENABLE_TESTS; DIRS +="
# convention.
#
# The current developer workflow expects tests to be updated when processing
# the default target. If we ever change this implementation, the behavior
# should be preserved or the change should be widely communicated. A
# consequence of not processing test dir targets during the default target is
# that changes to tests may not be updated and code could assume to pass
# locally against non-current test code.
DIRS += $( TEST_DIRS)
2012-05-16 18:46:28 +00:00
i f n d e f I N C L U D E D _ T E S T S _ X P C S H E L L _ M K #{
include $( topsrcdir) /config/makefiles/xpcshell.mk
2012-07-03 20:49:02 +00:00
e n d i f #}
i f n d e f I N C L U D E D _ T E S T S _ M O C H I T E S T _ M K #{
include $( topsrcdir) /config/makefiles/mochitest.mk
2012-05-16 18:46:28 +00:00
e n d i f #}
2008-12-04 06:25:00 +00:00
2012-05-22 20:45:24 +00:00
i f d e f M O Z _ E N A B L E _ G T E S T
i f d e f G T E S T _ C P P S R C S
CPPSRCS += $( GTEST_CPPSRCS)
e n d i f
i f d e f G T E S T _ C S R C S
CSRCS += $( GTEST_CSRCS)
e n d i f
i f d e f G T E S T _ C M M S R C S
CMMSRCS += $( GTEST_CMMSRCS)
e n d i f
e n d i f
2008-12-04 06:25:00 +00:00
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)
2013-06-24 17:45:32 +00:00
CPP_UNIT_TEST_BINS := $( CPP_UNIT_TESTS:.cpp= $( BIN_SUFFIX) )
SIMPLE_PROGRAMS += $( CPP_UNIT_TEST_BINS)
2009-05-18 18:15:05 +00:00
INCLUDES += -I$( DIST) /include/testing
2012-08-07 07:30:01 +00:00
LIBS += $( XPCOM_GLUE_LDOPTS) $( NSPR_LIBS) $( MOZ_JS_LIBS) $( if $( JS_SHARED_LIBRARY) ,,$( MOZ_ZLIB_LIBS) )
2008-12-04 06:25:00 +00:00
2013-06-24 17:45:32 +00:00
i f n d e f M O Z _ P R O F I L E _ G E N E R A T E
libs :: $( CPP_UNIT_TEST_BINS ) $( call mkdir_deps ,$ ( DIST ) /cppunittests )
$( NSINSTALL) $( CPP_UNIT_TEST_BINS) $( DIST) /cppunittests
e n d i f
2008-12-04 06:25:00 +00:00
check ::
2012-08-30 19:20:38 +00:00
@$( PYTHON) $( topsrcdir) /testing/runcppunittests.py --xre-path= $( DIST) /bin --symbols-path= $( DIST) /crashreporter-symbols $( subst .cpp,$( BIN_SUFFIX) ,$( CPP_UNIT_TESTS) )
2008-12-04 06:25:00 +00:00
2013-01-03 20:02:11 +00:00
cppunittests-remote : DM_TRANS ?=adb
cppunittests-remote :
@if [ " ${ TEST_DEVICE } " != "" -o " $( DM_TRANS) " = "adb" ] ; then \
$( PYTHON) -u $( topsrcdir) /testing/remotecppunittests.py \
--xre-path= $( DEPTH) /dist/bin \
--localLib= $( DEPTH) /dist/$( MOZ_APP_NAME) \
--dm_trans= $( DM_TRANS) \
--deviceIP= ${ TEST_DEVICE } \
2013-01-31 19:55:30 +00:00
$( subst .cpp,$( BIN_SUFFIX) ,$( CPP_UNIT_TESTS) ) $( EXTRA_TEST_ARGS) ; \
2013-01-03 20:02:11 +00:00
else \
echo "please prepare your host with environment variables for TEST_DEVICE" ; \
fi
2008-12-04 06:25:00 +00:00
e n d i f # CPP_UNIT_TESTS
2012-05-16 18:46:28 +00:00
.PHONY : check
2009-04-28 22:57:48 +00:00
2012-12-12 15:01:32 +00:00
i f d e f P Y T H O N _ U N I T _ T E S T S
RUN_PYTHON_UNIT_TESTS := $( addprefix run-,$( PYTHON_UNIT_TESTS) )
.PHONY : $( RUN_PYTHON_UNIT_TESTS )
check :: $( RUN_PYTHON_UNIT_TESTS )
$(RUN_PYTHON_UNIT_TESTS) : run -%: %
@PYTHONDONTWRITEBYTECODE= 1 $( PYTHON) $<
e n d i f # PYTHON_UNIT_TESTS
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
#
2011-05-23 16:54:47 +00:00
# If FORCE_STATIC_LIB is set, build a static library.
2005-10-17 14:57:32 +00:00
# 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
2011-09-03 06:19:06 +00:00
REAL_LIBRARY := $( LIB_PREFIX) $( STATIC_LIBRARY_NAME) .$( LIB_SUFFIX)
2011-02-25 14:05:08 +00:00
# Only build actual library if it is installed in DIST/lib or SDK
i f e q ( , $( SDK_LIBRARY ) $( DIST_INSTALL ) $( NO_EXPAND_LIBS ) )
2011-09-03 06:19:06 +00:00
LIBRARY := $( REAL_LIBRARY) .$( LIBS_DESC_SUFFIX)
2011-02-25 14:05:08 +00:00
e l s e
2011-09-03 06:19:06 +00:00
LIBRARY := $( REAL_LIBRARY) $( REAL_LIBRARY) .$( LIBS_DESC_SUFFIX)
2011-02-25 14:05:08 +00:00
e n d i f
2008-12-24 19:04:43 +00:00
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
2011-05-23 16:54:47 +00:00
i f d e f F O R C E _ S H A R E D _ L I B
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
2011-04-19 04:11:40 +00:00
i f n e q ( , $( filter OS 2 WINNT ,$ ( OS_ARCH ) ) )
2010-02-04 14:51:02 +00:00
IMPORT_LIBRARY := $( LIB_PREFIX) $( SHARED_LIBRARY_NAME) .$( IMPORT_LIB_SUFFIX)
e n d i f
i f e q ( O S 2 , $( OS_ARCH ) )
i f d e f S H O R T _ L I B N A M E
SHARED_LIBRARY_NAME := $( SHORT_LIBNAME)
e n d i f
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
2007-09-26 10:38:29 +00:00
EMBED_MANIFEST_AT = 2
1999-02-19 03:06:32 +00:00
e n d i f # MKSHLIB
2011-05-23 16:54:47 +00:00
e n d i f # FORCE_SHARED_LIB
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 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
2011-05-23 16:54:47 +00:00
LIBRARY := $( NULL)
2002-01-25 03:20:51 +00:00
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
2011-04-19 04:11:40 +00:00
i f e q ( $( OS_ARCH ) , W I N N T )
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
2011-12-27 09:51:53 +00:00
e l s e #!GNU_CC
i f d e f D E F F I L E
OS_LDFLAGS += $( call normalizepath,$( DEFFILE) )
EXTRA_DEPS += $( DEFFILE)
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
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 )
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++
2011-04-19 04:11:40 +00:00
i f e q ( $( HOST_OS_ARCH ) , W I N N T )
2005-07-06 01:49:32 +00:00
HOST_PDBFILE = $( basename $( @F) ) .pdb
e n d i f
2011-04-14 09:23:13 +00:00
# Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
i f d e f M O Z _ P R O F I L E _ G E N E R A T E
SIMPLE_PROGRAMS :=
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
2013-07-02 21:40:17 +00:00
COBJS = $( notdir $( CSRCS:.c= .$( OBJ_SUFFIX) ) )
SOBJS = $( notdir $( SSRCS:.S= .$( OBJ_SUFFIX) ) )
# CPPSRCS can have different extensions (eg: .cpp, .cc)
CPPOBJS = $( notdir $( addsuffix .$( OBJ_SUFFIX) ,$( basename $( CPPSRCS) ) ) )
CMOBJS = $( notdir $( CMSRCS:.m= .$( OBJ_SUFFIX) ) )
CMMOBJS = $( notdir $( CMMSRCS:.mm= .$( OBJ_SUFFIX) ) )
ASOBJS = $( notdir $( ASFILES:.$( ASM_SUFFIX) = .$( OBJ_SUFFIX) ) )
1998-03-28 02:44:41 +00:00
i f n d e f O B J S
2013-07-02 21:40:17 +00:00
_OBJS = $( COBJS) $( SOBJS) $( CPPOBJS) $( CMOBJS) $( CMMOBJS) $( ASOBJS)
2012-05-15 05:44:32 +00:00
OBJS = $( strip $( _OBJS) )
1998-03-28 02:44:41 +00:00
e n d i f
2012-05-15 05:44:32 +00:00
HOST_COBJS = $( addprefix host_,$( HOST_CSRCS:.c= .$( OBJ_SUFFIX) ) )
HOST_CCOBJS = $( addprefix host_,$( patsubst %.cc,%.$( OBJ_SUFFIX) ,$( filter %.cc,$( HOST_CPPSRCS) ) ) )
HOST_CPPOBJS = $( addprefix host_,$( patsubst %.cpp,%.$( OBJ_SUFFIX) ,$( filter %.cpp,$( HOST_CPPSRCS) ) ) )
HOST_CMOBJS = $( addprefix host_,$( HOST_CMSRCS:.m= .$( OBJ_SUFFIX) ) )
HOST_CMMOBJS = $( addprefix host_,$( HOST_CMMSRCS:.mm= .$( OBJ_SUFFIX) ) )
2000-03-31 07:18:52 +00:00
i f n d e f H O S T _ O B J S
2012-05-15 05:44:32 +00:00
_HOST_OBJS = $( HOST_COBJS) $( HOST_CCOBJS) $( HOST_CPPOBJS) $( HOST_CMOBJS) $( HOST_CMMOBJS)
2007-04-27 11:47:10 +00:00
HOST_OBJS = $( strip $( _HOST_OBJS) )
2000-03-31 07:18:52 +00:00
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) \
2011-08-29 05:34:12 +00:00
$( OBJS:.$( OBJ_SUFFIX) = .i) $( OBJS:.$( OBJ_SUFFIX) = .i_o) \
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)
2011-11-17 06:28:33 +00:00
GARBAGE += $( RCCSRCS)
2008-04-19 13:14:38 +00:00
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
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
2012-08-07 08:42:45 +00:00
# platforms, but we can trick printf into doing it.
UPDATE_TITLE = printf "\033]0;%s in %s\007" $( 1) $( shell $( BUILD_TOOLS) /print-depth-path.sh) /$( 2) ;
1999-02-08 19:59:25 +00:00
e n d i f
2013-06-18 19:22:56 +00:00
# Static directories are largely independent of our build system. But, they
# could share the same build mechanism (like moz.build files). We need to
# prevent leaking of our backend state to these independent build systems. This
# is why MOZBUILD_BACKEND_CHECKED isn't exported to make invocations for static
# directories.
d e f i n e S U B M A K E # $(call SUBMAKE,target,directory,static)
2010-07-27 11:44:21 +00:00
+ @ $( UPDATE_TITLE )
2013-06-18 19:22:56 +00:00
+ $( if $ ( 3) , MOZBUILD_BACKEND_CHECKED =,) $( MAKE ) $( if $ ( 2) ,-C $ ( 2) ) $( 1)
2009-02-27 21:03:53 +00:00
e n d e f # The extra line is important here! don't delete it
2013-05-23 23:28:09 +00:00
d e f i n e T I E R _ D I R _ S U B M A K E
@ e c h o "BUILDSTATUS TIERDIR_START $(2)"
2013-06-18 19:22:56 +00:00
$( call SUBMAKE ,$ ( 1) ,$ ( 2) ,$ ( 3) )
2013-05-23 23:28:09 +00:00
@ e c h o "BUILDSTATUS TIERDIR_FINISH $(2)"
e n d e f # Ths empty line is important.
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 $ ( 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
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
2012-09-11 07:43:32 +00:00
GARBAGE_DIRS += $( wildcard $( CURDIR) /$( MDDEPDIR) )
1999-09-09 09:24:58 +00:00
#
# 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
2011-08-25 23:37:25 +00:00
# (moved this from config.mk so that config.mk can be included
1999-09-09 09:24:58 +00:00
# before the CPPSRCS are defined)
#
2011-01-24 08:56:40 +00:00
i f n e q ( $( HOST_CPPSRCS ) $( HOST_CMMSRCS ) , )
HOST_CPP_PROG_LINK = 1
e n d i f
1999-09-09 09:24:58 +00:00
1999-09-22 09:54:00 +00:00
#
2011-08-25 23:37:25 +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
#
2011-08-25 23:37:25 +00:00
# Enforce the requirement that MODULE_NAME must be set
2003-03-15 22:56:35 +00:00
# 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
2010-07-20 21:49:10 +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
2001-08-16 05:18:04 +00:00
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-02-14 04:32:11 +00:00
#
# Linux: add -Bsymbolic flag for components
2011-08-25 23:37:25 +00:00
#
2002-02-14 04:32:11 +00:00
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
2011-08-25 23:37:25 +00:00
e n d i f
2002-02-14 04:32:11 +00:00
2010-04-19 08:39:58 +00:00
#
# GNU doesn't have path length limitation
#
i f e q ( $( OS_ARCH ) , G N U )
OS_CPPFLAGS += -DPATH_MAX= 1024 -DMAXPATHLEN= 1024
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
2011-08-25 09:31:52 +00:00
i f n e q ( , $( filter ml %,$ ( AS ) ) )
ASOUTOPTION = -Fo# eol
e l s e
ASOUTOPTION = -o # eol
e n d i f
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
2008-02-21 21:02:06 +00:00
e n d i f
1998-03-28 02:44:41 +00:00
################################################################################
2013-05-17 17:54:56 +00:00
# Regenerate the build backend if it is out of date. We only check this once
# per traversal, hence the ifdef and the export. This rule needs to come before
# other rules for the default target or else it may not run in time.
i f n d e f M O Z B U I L D _ B A C K E N D _ C H E C K E D
2013-05-21 06:26:20 +00:00
2013-05-23 17:10:39 +00:00
# Since Makefile is listed as a global dependency, this has the
# unfortunate side-effect of invalidating all targets if it is executed.
# So e.g. if you are in /dom/bindings and /foo/moz.build changes,
# /dom/bindings will get invalidated. The upside is if the current
# Makefile/backend.mk is updated as a result of backend regeneration, we
# actually pick up the changes. This should reduce the amount of
# required clobbers and is thus the lesser evil.
Makefile : $( DEPTH ) /backend .RecursiveMakeBackend .built
@$( TOUCH) $@
2013-05-21 06:26:20 +00:00
$(DEPTH)/backend.RecursiveMakeBackend.built :
@echo "Build configuration changed. Regenerating backend."
@cd $( DEPTH) && $( PYTHON) ./config.status
i n c l u d e $( DEPTH ) / b a c k e n d . R e c u r s i v e M a k e B a c k e n d . b u i l t . p p
default :: $( DEPTH ) /backend .RecursiveMakeBackend .built
2013-05-17 17:54:56 +00:00
export MOZBUILD_BACKEND_CHECKED = 1
e n d i f
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 ::
2013-05-23 23:28:09 +00:00
@echo " BUILDSTATUS TIERS $( TIERS) "
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 ) ) )
2013-06-18 19:22:56 +00:00
$( foreach dir,$( STATIC_DIRS) ,$( call SUBMAKE,,$( dir) ,1) )
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
2011-08-25 23:37:25 +00:00
alldep ::
2001-11-30 22:53:10 +00:00
$( 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
2013-05-23 23:28:09 +00:00
# This function is called and evaluated to produce the rule to build the
# specified tier. Each tier begins by building the "static" directories.
# The BUILDSTATUS echo commands are used to faciliate easier parsing
# of build output. Build drivers are encouraged to filter these lines
# from the user.
d e f i n e C R E A T E _ T I E R _ R U L E
tier_$(1) ::
@echo " BUILDSTATUS TIER_START $( 1) "
2013-05-23 23:28:11 +00:00
@printf "BUILDSTATUS SUBTIERS"
i f n e q ( , $( tier_ $ ( 1) _staticdirs ) )
@printf " static"
e n d i f
i f n e q ( , $( tier_ $ ( 1) _dirs ) )
@printf " export libs tools"
e n d i f
@printf "\n"
2013-05-23 23:28:09 +00:00
@echo " BUILDSTATUS STATICDIRS $$ ( $$ @_staticdirs) "
@echo " BUILDSTATUS DIRS $$ ( $$ @_dirs) "
2013-05-23 23:28:11 +00:00
i f n e q ( , $( tier_ $ ( 1) _staticdirs ) )
2013-05-23 23:28:09 +00:00
@echo " BUILDSTATUS SUBTIER_START $( 1) static "
2013-06-18 19:22:56 +00:00
$$ ( foreach dir,$$ ( $$ @_staticdirs) ,$$ ( call TIER_DIR_SUBMAKE,,$$ ( dir) ,1) )
2013-05-23 23:28:09 +00:00
@echo " BUILDSTATUS SUBTIER_FINISH $( 1) static "
2013-05-23 23:28:11 +00:00
e n d i f
i f n e q ( , $( tier_ $ ( 1) _dirs ) )
2013-05-23 23:28:09 +00:00
@echo " BUILDSTATUS SUBTIER_START $( 1) export "
$$ ( MAKE) export_$$ @
@echo " BUILDSTATUS SUBTIER_FINISH $( 1) export "
@echo " BUILDSTATUS SUBTIER_START $( 1) libs "
$$ ( MAKE) libs_$$ @
@echo " BUILDSTATUS SUBTIER_FINISH $( 1) libs "
@echo " BUILDSTATUS SUBTIER_START $( 1) tools "
$$ ( MAKE) tools_$$ @
@echo " BUILDSTATUS SUBTIER_FINISH $( 1) tools "
@echo " BUILDSTATUS TIER_FINISH $( 1) "
2013-05-23 23:28:11 +00:00
e n d i f
2013-05-23 23:28:09 +00:00
e n d e f
$( foreach tier ,$ ( TIERS ) ,$ ( eval $ ( call CREATE_TIER_RULE ,$ ( tier ) ) ) )
2006-08-25 10:45:39 +00:00
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
2011-07-07 15:29:41 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / m a k e f i l e s / t a r g e t _ e x p o r t . m k
i n c l u d e $( topsrcdir ) / c o n f i g / m a k e f i l e s / t a r g e t _ t o o l s . m k
2005-01-12 11:23:43 +00:00
2011-02-25 14:05:08 +00:00
i f n e q ( , $( filter -out %.$ ( LIB_SUFFIX ) ,$ ( SHARED_LIBRARY_LIBS ) ) )
$( error SHARED_LIBRARY_LIBS must contain .$ ( LIB_SUFFIX ) files only )
e n d i f
2009-08-16 21:54:45 +00:00
2011-02-25 14:05:08 +00:00
HOST_LIBS_DEPS = $( filter %.$( LIB_SUFFIX) ,$( HOST_LIBS) )
2009-08-16 21:54:45 +00:00
2010-10-28 18:28:21 +00:00
# Dependencies which, if modified, should cause everything to rebuild
2012-06-20 11:27:43 +00:00
GLOBAL_DEPS += Makefile $( DEPTH) /config/autoconf.mk $( topsrcdir) /config/config.mk
i f n d e f N O _ M A K E F I L E _ R U L E
GLOBAL_DEPS += Makefile.in
e n d i f
2008-11-28 02:26:44 +00:00
2000-03-31 01:24:48 +00:00
##############################################
2011-07-07 15:29:41 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / m a k e f i l e s / t a r g e t _ l i b s . m k
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
2010-07-26 19:21:55 +00:00
i f e q ( $( OS_ARCH ) _ $( GNU_CC ) , 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 \
2011-11-04 21:26:53 +00:00
$( PROGRAM:$( BIN_SUFFIX) = ) $( DIST) /bin
2009-01-08 18:52:38 +00:00
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 \
2011-11-04 21:26:53 +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_
2011-08-16 07:41:55 +00:00
e n d i f # MOZ_PROFILE_USE
2011-06-13 15:58:34 +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
# Clean up profiling data during PROFILE_GENERATE phase
export ::
i f e q ( $( OS_ARCH ) _ $( GNU_CC ) , W I N N T _ )
2011-08-29 05:33:48 +00:00
$( foreach pgd,$( wildcard *.pgd) ,pgomgr -clear $( pgd) ; )
2011-06-13 15:58:34 +00:00
e l s e
i f d e f G N U _ C C
-$( RM) *.gcda
e n d i f
e n d i f
e n d i f
2011-08-29 05:34:12 +00:00
i f n e q ( , $( MOZ_PROFILE_GENERATE ) $( MOZ_PROFILE_USE ) )
i f d e f G N U _ C C
# Force rebuilding libraries and programs in both passes because each
# pass uses different object files.
$(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY) : FORCE
e n d i f
e n d i f
2008-02-20 23:29:11 +00:00
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 )
2011-04-03 07:16:49 +00:00
-$( RM) $( ALL_TRASH)
-$( RM) -r $( 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) ) )
2011-08-25 23:37:25 +00:00
-$( RM) -r $( ALL_TRASH_DIRS)
2011-04-03 07:16:49 +00:00
-$( RM) $( 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 )
2011-04-03 07:16:49 +00:00
-$( RM) $( PROGRAM:.exe= .map)
2001-06-16 23:47:49 +00:00
e n d i f
1999-06-03 22:23:06 +00:00
1998-03-28 02:44:41 +00:00
alltags :
2011-04-03 07:16:49 +00:00
$( RM) 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
#
2012-06-08 06:59:02 +00:00
$(PROGRAM) : $( PROGOBJS ) $( EXTRA_DEPS ) $( EXE_DEF_FILE ) $( RESFILE ) $( GLOBAL_DEPS )
2011-04-03 07:16:49 +00:00
@$( RM) $@ .manifest
2001-12-09 07:08:58 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( OS_ARCH ) )
2011-12-28 07:24:02 +00:00
$( EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$( LINK_PDBFILE) $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( MOZ_GLUE_PROGRAM_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 \
2010-02-13 21:00:19 +00:00
echo " Embedding manifest from $( srcdir) / $@ .manifest and $@ .manifest " ; \
2006-03-21 14:49:45 +00:00
mt.exe -NOLOGO -MANIFEST " $( win_srcdir) / $@ .manifest " $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
else \
2010-02-13 21:00:19 +00:00
echo " Embedding manifest from $@ .manifest " ; \
2006-03-21 14:49:45 +00:00
mt.exe -NOLOGO -MANIFEST $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
fi ; \
2010-02-13 21:00:19 +00:00
elif test -f " $( srcdir) / $@ .manifest " ; then \
echo " Embedding manifest from $( srcdir) / $@ .manifest " ; \
mt.exe -NOLOGO -MANIFEST " $( win_srcdir) / $@ .manifest " -OUTPUTRESOURCE:$@ \; 1; \
2006-01-23 17:16:17 +00:00
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
2013-07-15 09:48:39 +00:00
$( EXPAND_CCC) -o $@ $( CXXFLAGS) $( PROGOBJS) $( RESFILE) $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( WRAP_LDFLAGS) $( LIBS_DIR) $( LIBS) $( MOZ_GLUE_PROGRAM_LDFLAGS) $( OS_LIBS) $( EXTRA_LIBS) $( BIN_FLAGS) $( EXE_DEF_FILE) $( STLPORT_LIBS)
2011-04-16 15:57:51 +00:00
@$( call CHECK_STDCXX,$@ )
2001-12-09 07:08:58 +00:00
e n d i f # WINNT && !GNU_CC
2005-04-22 19:06:27 +00:00
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-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 )
2006-01-24 17:25:42 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( HOST_OS_ARCH ) )
2012-02-21 07:19:23 +00:00
$( HOST_LD) -NOLOGO -OUT:$@ -PDB:$( HOST_PDBFILE) $( HOST_OBJS) $( WIN32_EXE_LDFLAGS) $( HOST_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 \
2010-04-13 08:48:19 +00:00
echo " Embedding manifest from $( srcdir) / $@ .manifest and $@ .manifest " ; \
2009-08-03 22:01:55 +00:00
mt.exe -NOLOGO -MANIFEST " $( win_srcdir) / $@ .manifest " $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
else \
2010-04-13 08:48:19 +00:00
echo " Embedding manifest from $@ .manifest " ; \
2009-08-03 22:01:55 +00:00
mt.exe -NOLOGO -MANIFEST $@ .manifest -OUTPUTRESOURCE:$@ \; 1; \
fi ; \
2010-04-13 08:48:19 +00:00
elif test -f " $( srcdir) / $@ .manifest " ; then \
echo " Embedding manifest from $( srcdir) / $@ .manifest " ; \
mt.exe -NOLOGO -MANIFEST " $( win_srcdir) / $@ .manifest " -OUTPUTRESOURCE:$@ \; 1; \
2006-01-23 17:16:17 +00:00
fi
e n d i f # MSVC with manifest tool
2002-11-15 03:41:17 +00:00
e l s e
2011-01-24 08:56:40 +00:00
i f e q ( $( HOST_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)
2011-01-24 08:56:40 +00:00
e n d i f # HOST_CPP_PROG_LINK
2002-11-15 03:41:17 +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.
#
2012-06-08 06:59:02 +00:00
$(SIMPLE_PROGRAMS) : %$( BIN_SUFFIX ) : %.$( OBJ_SUFFIX ) $( EXTRA_DEPS ) $( GLOBAL_DEPS )
2001-12-09 07:08:58 +00:00
i f e q ( _ W I N N T , $( GNU_CC ) _ $( OS_ARCH ) )
2011-12-28 07:24:02 +00:00
$( EXPAND_LD) -nologo -out:$@ -pdb:$( LINK_PDBFILE) $< $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( MOZ_GLUE_PROGRAM_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
2013-07-15 09:48:39 +00:00
$( EXPAND_CCC) $( CXXFLAGS) -o $@ $< $( WIN32_EXE_LDFLAGS) $( LDFLAGS) $( WRAP_LDFLAGS) $( LIBS_DIR) $( LIBS) $( MOZ_GLUE_PROGRAM_LDFLAGS) $( OS_LIBS) $( EXTRA_LIBS) $( BIN_FLAGS) $( STLPORT_LIBS)
2011-04-16 15:57:51 +00:00
@$( call CHECK_STDCXX,$@ )
2001-12-09 07:08:58 +00:00
e n d i f # WINNT && !GNU_CC
2005-04-22 19:06:27 +00:00
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 )
2006-01-24 17:25:42 +00:00
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
2000-03-31 07:18:52 +00:00
2007-10-10 23:03:14 +00:00
i f d e f D T R A C E _ P R O B E _ O B J
EXTRA_DEPS += $( DTRACE_PROBE_OBJ)
2010-09-20 19:43:52 +00:00
OBJS += $( DTRACE_PROBE_OBJ)
2007-10-10 23:03:14 +00:00
e n d i f
2001-12-18 09:14:29 +00:00
2012-06-08 06:59:02 +00:00
$(filter %.$(LIB_SUFFIX),$(LIBRARY)) : $( OBJS ) $( LOBJS ) $( EXTRA_DEPS ) $( GLOBAL_DEPS )
2011-04-03 07:16:49 +00:00
$( RM) $( LIBRARY)
2011-02-25 14:05:08 +00:00
$( EXPAND_AR) $( AR_FLAGS) $( OBJS) $( LOBJS) $( SHARED_LIBRARY_LIBS)
1998-03-28 02:44:41 +00:00
$( RANLIB) $@
2011-02-25 14:05:08 +00:00
2012-06-08 06:59:02 +00:00
$(filter-out %.$(LIB_SUFFIX),$(LIBRARY)) : $( filter %.$ ( LIB_SUFFIX ) ,$ ( LIBRARY ) ) $( OBJS ) $( LOBJS ) $( EXTRA_DEPS ) $( GLOBAL_DEPS )
2011-09-03 06:19:06 +00:00
# When we only build a library descriptor, blow out any existing library
$( if $( filter %.$( LIB_SUFFIX) ,$( LIBRARY) ) ,,$( RM) $( REAL_LIBRARY) $( EXPORT_LIBRARY:%= %/$( REAL_LIBRARY) ) )
2012-06-08 06:59:02 +00:00
$( EXPAND_LIBS_GEN) -o $@ $( OBJS) $( LOBJS) $( SHARED_LIBRARY_LIBS)
1999-10-08 05:18:46 +00:00
2011-04-19 04:11:40 +00:00
i f e q ( $( OS_ARCH ) , W I N N T )
2012-10-09 08:17:26 +00:00
# Import libraries are created by the rules creating shared libraries.
# The rules to copy them to $(DIST)/lib depend on $(IMPORT_LIBRARY),
# but make will happily consider the import library before it is refreshed
# when rebuilding the corresponding shared library. Defining an empty recipe
# for import libraries forces make to wait for the shared library recipe to
# have run before considering other targets that depend on the import library.
# See bug 795204.
$(IMPORT_LIBRARY) : $( SHARED_LIBRARY ) ;
2002-04-19 02:42:28 +00:00
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 )
2011-04-03 07:16:49 +00:00
$( RM) $@
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 >> $@
2010-11-09 10:13:03 +00:00
2000-03-31 01:24:48 +00:00
$( ADD_TO_DEF_FILE)
2001-07-01 12:11:13 +00:00
2006-03-08 18:47:19 +00:00
$(IMPORT_LIBRARY) : $( SHARED_LIBRARY )
2011-04-03 07:16:49 +00:00
$( RM) $@
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
2011-04-03 07:16:49 +00:00
$( RM) $@
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) $@
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
2011-08-17 22:14:52 +00:00
NON_DTRACE_OBJS := $( filter-out $( DTRACE_PROBE_OBJ) ,$( OBJS) )
$(DTRACE_PROBE_OBJ) : $( NON_DTRACE_OBJS )
dtrace -G -C -s $( MOZILLA_DTRACE_SRC) -o $( DTRACE_PROBE_OBJ) $( NON_DTRACE_OBJS)
2007-10-19 22:24:32 +00:00
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.
2012-06-08 06:59:02 +00:00
$(SHARED_LIBRARY) : $( OBJS ) $( LOBJS ) $( DEF_FILE ) $( RESFILE ) $( LIBRARY ) $( EXTRA_DEPS ) $( GLOBAL_DEPS )
2013-04-21 06:41:13 +00:00
$( info $( notdir $@ ) )
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
2011-04-03 07:16:49 +00:00
$( RM) $@
2003-09-16 22:36:02 +00:00
e n d i f
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-11-02 06:36:49 +00:00
i f n d e f X P _ M A C O S X
2011-02-25 14:05:08 +00:00
dtrace -G -C -s $( MOZILLA_DTRACE_SRC) -o $( DTRACE_PROBE_OBJ) $( shell $( EXPAND_LIBS) $( MOZILLA_PROBE_LIBS) )
e n d i f
2013-07-15 09:48:39 +00:00
$( EXPAND_MKSHLIB) $( SHLIB_LDSTARTFILE) $( OBJS) $( LOBJS) $( SUB_SHLOBJS) $( DTRACE_PROBE_OBJ) $( MOZILLA_PROBE_LIBS) $( RESFILE) $( LDFLAGS) $( WRAP_LDFLAGS) $( SHARED_LIBRARY_LIBS) $( EXTRA_DSO_LDOPTS) $( MOZ_GLUE_LDFLAGS) $( OS_LIBS) $( EXTRA_LIBS) $( DEF_FILE) $( SHLIB_LDENDFILE) $( if $( LIB_IS_C_ONLY) ,,$( STLPORT_LIBS) )
2011-04-03 07:16:49 +00:00
@$( RM) $( DTRACE_PROBE_OBJ)
2008-08-26 21:34:36 +00:00
e l s e # ! DTRACE_LIB_DEPENDENT
2013-07-15 09:48:39 +00:00
$( EXPAND_MKSHLIB) $( SHLIB_LDSTARTFILE) $( OBJS) $( LOBJS) $( SUB_SHLOBJS) $( RESFILE) $( LDFLAGS) $( WRAP_LDFLAGS) $( SHARED_LIBRARY_LIBS) $( EXTRA_DSO_LDOPTS) $( MOZ_GLUE_LDFLAGS) $( OS_LIBS) $( EXTRA_LIBS) $( DEF_FILE) $( SHLIB_LDENDFILE) $( if $( LIB_IS_C_ONLY) ,,$( STLPORT_LIBS) )
2007-10-19 22:24:32 +00:00
e n d i f # DTRACE_LIB_DEPENDENT
2011-04-16 15:57:51 +00:00
@$( call CHECK_STDCXX,$@ )
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
2011-04-03 07:16:49 +00:00
@$( RM) 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
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) ; \
2013-04-09 22:10:25 +00:00
$( PYTHON) $( topsrcdir) /build/unix/add_phony_targets.py $( _MDDEPFILE) ; \
2007-08-17 23:07:39 +00:00
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) ; \
2013-04-09 22:10:25 +00:00
$( PYTHON) $( topsrcdir) /build/unix/add_phony_targets.py $( _MDDEPFILE) ; \
2007-08-17 23:07:39 +00:00
f i
e n d e f
e n d i f # Sun Studio on Solaris
2001-05-22 07:52:30 +00:00
2013-07-02 21:40:17 +00:00
# The object file is in the current directory, and the source file can be any
# relative path. This macro adds the dependency obj: src for each source file.
# This dependency must be first for the $< flag to work correctly, and the
# rules that have commands for these targets must not list any other
# prerequisites, or they will override the $< variable.
d e f i n e s r c _ o b j d e p
$(basename $(notdir $1)).$(OBJ_SUFFIX) : $1 $( call mkdir_deps ,$ ( MDDEPDIR ) )
e n d e f
$( foreach f ,$ ( CSRCS ) $ ( SSRCS ) $ ( CPPSRCS ) $ ( CMSRCS ) $ ( CMMSRCS ) $ ( ASFILES ) ,$ ( eval $ ( call src_objdep ,$ ( f ) ) ) )
2013-04-09 22:10:25 +00:00
$(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS) : $( GLOBAL_DEPS )
2012-03-31 07:24:39 +00:00
2002-11-15 07:24:44 +00:00
# Rules for building native targets must come first because of the host_ prefix
2012-05-15 05:44:32 +00:00
$(HOST_COBJS) : host_ %.$( OBJ_SUFFIX ) : %.c
2011-12-08 18:14:06 +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)
2012-05-15 05:44:32 +00:00
$(HOST_CPPOBJS) : host_ %.$( OBJ_SUFFIX ) : %.cpp
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2007-03-26 18:17:02 +00:00
$( ELOG) $( HOST_CXX) $( HOST_OUTOPTION) $@ -c $( HOST_CXXFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2002-11-15 07:24:44 +00:00
2012-05-15 05:44:32 +00:00
$(HOST_CCOBJS) : host_ %.$( OBJ_SUFFIX ) : %.cc
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2007-04-27 11:47:10 +00:00
$( ELOG) $( HOST_CXX) $( HOST_OUTOPTION) $@ -c $( HOST_CXXFLAGS) $( INCLUDES) $( NSPR_CFLAGS) $( _VPATH_SRCS)
2012-05-15 05:44:32 +00:00
$(HOST_CMOBJS) : host_ %.$( OBJ_SUFFIX ) : %.m
2011-12-08 18:14:06 +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
2012-05-15 05:44:32 +00:00
$(HOST_CMMOBJS) : host_ %.$( OBJ_SUFFIX ) : %.mm
2011-12-08 18:14:06 +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
2013-07-02 21:40:17 +00:00
$(COBJS) :
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CC)
2012-09-20 13:46:04 +00:00
$( ELOG) $( CC) $( OUTOPTION) $@ -c $( COMPILE_CFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
1998-03-28 02:44:41 +00:00
2010-07-23 17:56:19 +00:00
# DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
2011-08-25 23:37:25 +00:00
# 'moc' only knows about #defines it gets on the command line (-D...), not in
2010-07-23 17:56:19 +00:00
# included headers like mozilla-config.h
2012-03-31 07:24:39 +00:00
moc_%.cpp : %.h
2011-11-17 06:28:33 +00:00
$( ELOG) $( MOC) $( DEFINES) $( ACDEFINES) $< $( OUTOPTION) $@
1999-08-09 14:55:56 +00:00
2012-03-31 07:24:39 +00:00
moc_%.cc : %.cc
2010-07-23 17:56:19 +00:00
$( ELOG) $( MOC) $( DEFINES) $( ACDEFINES) $( _VPATH_SRCS:.cc= .h) $( OUTOPTION) $@
2010-02-18 21:48:50 +00:00
2012-03-31 07:24:39 +00:00
qrc_%.cpp : %.qrc
2011-11-17 06:28:33 +00:00
$( ELOG) $( RCC) -name $* $< $( OUTOPTION) $@
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.
2013-07-02 21:40:17 +00:00
$(ASOBJS) :
2011-08-25 09:31:52 +00:00
$( AS) $( ASOUTOPTION) $@ $( 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
2013-07-02 21:40:17 +00:00
$(SOBJS) :
2012-09-20 13:46:04 +00:00
$( AS) -o $@ $( ASFLAGS) $( LOCAL_INCLUDES) $( TARGET_LOCAL_INCLUDES) -c $<
1998-03-28 02:44:41 +00:00
2013-07-02 21:40:17 +00:00
$(CPPOBJS) :
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CXX)
2012-09-20 13:46:04 +00:00
$( ELOG) $( CCC) $( OUTOPTION) $@ -c $( COMPILE_CXXFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
1998-03-28 02:44:41 +00:00
2013-07-02 21:40:17 +00:00
$(CMMOBJS) :
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CXX)
2012-09-20 13:46:04 +00:00
$( ELOG) $( CCC) -o $@ -c $( COMPILE_CXXFLAGS) $( COMPILE_CMMFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
2001-10-31 01:20:39 +00:00
2013-07-02 21:40:17 +00:00
$(CMOBJS) :
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2007-08-17 23:07:39 +00:00
@$( MAKE_DEPS_AUTO_CC)
2012-09-20 13:46:04 +00:00
$( ELOG) $( CC) -o $@ -c $( COMPILE_CFLAGS) $( COMPILE_CMFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
2004-06-18 00:56:48 +00:00
2012-09-11 07:43:32 +00:00
%.s : %.cpp $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CCC) -S $( COMPILE_CXXFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
2003-03-08 05:18:43 +00:00
2012-09-11 07:43:32 +00:00
%.s : %.cc $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CCC) -S $( COMPILE_CXXFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
2007-07-11 17:26:11 +00:00
2012-09-11 07:43:32 +00:00
%.s : %.c $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CC) -S $( COMPILE_CFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS)
2003-03-08 05:18:43 +00:00
2012-09-11 07:43:32 +00:00
%.i : %.cpp $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CCC) -C -E $( COMPILE_CXXFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS) > $* .i
1998-03-28 02:44:41 +00:00
2012-09-11 07:43:32 +00:00
%.i : %.cc $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CCC) -C -E $( COMPILE_CXXFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS) > $* .i
2007-07-11 17:26:11 +00:00
2012-09-11 07:43:32 +00:00
%.i : %.c $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CC) -C -E $( COMPILE_CFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS) > $* .i
1998-03-28 02:44:41 +00:00
2012-09-11 07:43:32 +00:00
%.i : %.mm $( call mkdir_deps ,$ ( MDDEPDIR ) )
2012-09-20 13:46:04 +00:00
$( CCC) -C -E $( COMPILE_CXXFLAGS) $( COMPILE_CMMFLAGS) $( TARGET_LOCAL_INCLUDES) $( _VPATH_SRCS) > $* .i
2008-03-13 11:12:10 +00:00
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
1999-03-22 20:43:05 +00:00
# Cancel these implicit rules
#
% : %, v
% : RCS /%, v
2013-06-24 17:14:12 +00:00
% : RCS /%
1999-03-22 20:43:05 +00:00
% : s .%
% : SCCS /s .%
2006-09-27 15:23:31 +00:00
###############################################################################
# Java rules
###############################################################################
2011-04-19 04:11:40 +00:00
i f n e q ( , $( filter OS 2 WINNT ,$ ( OS_ARCH ) ) )
2006-09-27 15:23:31 +00:00
SEP := ;
e l s e
SEP := :
e n d i f
EMPTY :=
SPACE := $( EMPTY) $( EMPTY)
2011-01-25 20:14:30 +00:00
# MSYS has its 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.
2011-04-19 04:11:40 +00:00
i f e q ( $( HOST_OS_ARCH ) , W I N N T )
2007-05-02 17:02:45 +00:00
# We use 'pwd -W' to get DOS form of the path. However, since the given path
2010-10-28 18:28:21 +00:00
# could be a file or a non-existent path, we cannot call 'pwd -W' directly
2007-05-02 17:02:45 +00:00
# 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 l s e
normalizepath = $( 1)
e n d i f
2013-01-25 20:22:13 +00:00
i f n e q ( , $( value JAVAFILES ) $( value RESFILES ) )
include $( topsrcdir) /config/makefiles/java-build.mk
e n d i f
2007-03-07 22:44:16 +00:00
_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 )
2011-01-25 20:14:30 +00:00
$( 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
###############################################################################
2013-02-25 20:47:11 +00:00
# Update Files Managed by Build Backend
1999-01-29 20:00:50 +00:00
###############################################################################
2005-02-07 14:55:07 +00:00
2012-06-20 11:27:43 +00:00
i f n d e f N O _ M A K E F I L E _ R U L E
2002-08-31 04:03:52 +00:00
Makefile : Makefile .in
2012-08-05 10:42:57 +00:00
@$( PYTHON) $( DEPTH) /config.status -n --file= Makefile
2012-08-05 10:43:00 +00:00
@$( TOUCH) $@
2012-06-20 11:27:43 +00:00
e n d i f
1999-08-24 21:45:06 +00:00
2012-06-20 11:27:43 +00:00
i f n d e f N O _ S U B M A K E F I L E S _ R U L E
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
2012-10-18 12:44:12 +00:00
$( PYTHON) $( DEPTH) $( addprefix /,$( subsrcdir) ) /config.status -n --file= " $@ "
@$( TOUCH) " $@ "
1999-09-14 23:09:37 +00:00
e n d i f
2012-06-20 11:27:43 +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
2012-08-30 18:29:38 +00:00
( cd $( topsrcdir) && $( AUTOCONF) ) && $( PYTHON) $( DEPTH) /config.status -n --recheck
2000-04-03 00:56:31 +00:00
e n d i f
2011-08-29 11:44:46 +00:00
$(DEPTH)/config/autoconf.mk : $( topsrcdir ) /config /autoconf .mk .in
2012-08-05 10:42:57 +00:00
$( PYTHON) $( DEPTH) /config.status -n --file= $( DEPTH) /config/autoconf.mk
2012-08-04 06:47:28 +00:00
$( TOUCH) $@
2011-08-29 11:44:46 +00:00
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
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 ) )
2012-08-29 06:55:57 +00:00
EXPORTS_FILES := $( EXPORTS)
EXPORTS_DEST := $( DIST) /include
EXPORTS_TARGET := export
INSTALL_TARGETS += EXPORTS
2009-05-18 18:15:05 +00:00
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
2012-08-29 06:55:57 +00:00
EXPORTS_$(namespace)_FILES := $$ ( EXPORTS_$( namespace) )
EXPORTS_$(namespace)_DEST := $$ ( DIST) /include/$( namespace)
EXPORTS_$(namespace)_TARGET := export
INSTALL_TARGETS += EXPORTS_$( 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
2012-12-05 22:36:15 +00:00
# The default location for PREF_JS_EXPORTS is the gre prefs directory.
2004-01-16 19:22:43 +00:00
PREF_DIR = defaults/pref
2012-12-05 22:36:15 +00:00
# If DIST_SUBDIR is defined it indicates that app and gre dirs are
# different and that we are building app related resources. Hence,
# PREF_DIR should point to the app prefs location.
i f n e q ( , $( DIST_SUBDIR ) $( XPI_NAME ) $( LIBXUL_SDK ) )
PREF_DIR = defaults/preferences
2005-03-28 19:36:24 +00:00
e n d i f
2004-01-16 19:22:43 +00:00
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 ) )
2013-02-20 15:52:16 +00:00
PREF_PPFLAGS += --line-endings= crlf
e n d i f
i f n e q ( $( PREF_JS_EXPORTS ) , )
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
2012-07-23 05:42:22 +00:00
PREF_JS_EXPORTS_PATH := $( FINAL_TARGET) /$( PREF_DIR)
PREF_JS_EXPORTS_FLAGS := $( PREF_PPFLAGS)
PP_TARGETS += PREF_JS_EXPORTS
2004-01-16 19:22:43 +00:00
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 ) , )
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
2012-08-29 06:55:57 +00:00
AUTOCFG_JS_EXPORTS_FILES := $( AUTOCFG_JS_EXPORTS)
AUTOCFG_JS_EXPORTS_DEST := $( FINAL_TARGET) /defaults/autoconfig
AUTOCFG_JS_EXPORTS_TARGET := export
INSTALL_TARGETS += AUTOCFG_JS_EXPORTS
2001-12-31 09:04:25 +00:00
e n d i f
2011-08-25 23:37:25 +00:00
e n d i f
2012-05-16 18:46:28 +00:00
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
2012-06-01 15:13:07 +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
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
2011-08-25 23:37:25 +00:00
# warn against overriding existing .h file.
1999-06-20 08:59:31 +00:00
2011-07-19 21:46:25 +00:00
XPIDL_DEPS = \
2012-05-14 15:19:39 +00:00
$( LIBXUL_DIST) /sdk/bin/header.py \
$( LIBXUL_DIST) /sdk/bin/typelib.py \
$( LIBXUL_DIST) /sdk/bin/xpidl.py \
2011-07-19 21:46:25 +00:00
$( NULL)
2012-04-03 20:08:16 +00:00
xpidl-preqs = \
$( call mkdir_deps,$( XPIDL_GEN_DIR) ) \
$( call mkdir_deps,$( MDDEPDIR) ) \
$( NULL)
$(XPIDL_GEN_DIR)/%.h : %.idl $( XPIDL_DEPS ) $( xpidl -preqs )
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2011-07-25 17:20:43 +00:00
$( PYTHON_PATH) \
2012-04-06 18:06:52 +00:00
$( PLY_INCLUDE) \
2012-05-14 15:19:39 +00:00
$( LIBXUL_DIST) /sdk/bin/header.py $( XPIDL_FLAGS) $( _VPATH_SRCS) -d $( MDDEPDIR) /$( @F) .pp -o $@
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
# 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.
2012-04-03 20:08:16 +00:00
$(XPIDL_GEN_DIR)/%.xpt : %.idl $( XPIDL_DEPS ) $( xpidl -preqs )
2011-12-08 18:14:06 +00:00
$( REPORT_BUILD)
2011-08-10 00:48:41 +00:00
$( PYTHON_PATH) \
2012-04-06 18:06:52 +00:00
$( PLY_INCLUDE) \
2011-08-10 00:48:41 +00:00
-I$( topsrcdir) /xpcom/typelib/xpt/tools \
2012-05-14 15:19:39 +00:00
$( LIBXUL_DIST) /sdk/bin/typelib.py $( XPIDL_FLAGS) $( _VPATH_SRCS) -d $( MDDEPDIR) /$( @F) .pp -o $@
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 ) ) )
2013-03-19 17:21:01 +00:00
XPT_PY = $( filter %/xpt.py,$( XPIDL_LINK) )
2012-11-14 20:46:15 +00:00
xpidl-idl2xpt = $( patsubst %.idl,$( XPIDL_GEN_DIR) /%.xpt,$( XPIDLSRCS) )
xpidl-module-deps = $( xpidl-idl2xpt) $( GLOBAL_DEPS) $( XPT_PY)
$(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt : $( xpidl -module -deps )
2013-03-19 17:21:01 +00:00
$( XPIDL_LINK) $@ $( xpidl-idl2xpt)
2012-11-14 20:46:15 +00:00
$(XPT_PY) :
$( MAKE) -C $( DEPTH) /xpcom/typelib/xpt/tools libs
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-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
2012-08-29 06:55:57 +00:00
XPIDL_MODULE_FILES := $( XPIDL_GEN_DIR) /$( XPIDL_MODULE) .xpt
XPIDL_MODULE_DEST := $( FINAL_TARGET) /components
INSTALL_TARGETS += XPIDL_MODULE
2010-06-30 16:42:24 +00:00
i f n d e f N O _ I N T E R F A C E S _ M A N I F E S T
2012-07-23 05:42:22 +00:00
libs :: $( call mkdir_deps ,$ ( FINAL_TARGET ) /components )
2010-06-29 22:16:48 +00:00
@$( PYTHON) $( MOZILLA_DIR) /config/buildlist.py $( FINAL_TARGET) /components/interfaces.manifest " interfaces $( XPIDL_MODULE) .xpt "
2010-07-22 14:38:59 +00:00
@$( PYTHON) $( MOZILLA_DIR) /config/buildlist.py $( FINAL_TARGET) /chrome.manifest "manifest components/interfaces.manifest"
2001-12-31 09:04:25 +00:00
e n d i f
2010-06-30 16:42:24 +00:00
e n d i f
2002-04-25 02:52:44 +00:00
2002-02-25 23:20:01 +00:00
GARBAGE_DIRS += $( XPIDL_GEN_DIR)
2012-08-29 06:55:57 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
XPIDL_HEADERS_FILES := $( patsubst %.idl,$( XPIDL_GEN_DIR) /%.h, $( XPIDLSRCS) )
XPIDL_HEADERS_DEST := $( DIST) /include
XPIDL_HEADERS_TARGET := export
INSTALL_TARGETS += XPIDL_HEADERS
2002-02-25 23:20:01 +00:00
2012-08-29 06:55:57 +00:00
XPIDLSRCS_FILES := $( XPIDLSRCS)
XPIDLSRCS_DEST := $( IDL_DIR)
2012-09-06 12:46:41 +00:00
XPIDLSRCS_TARGET := export
2012-08-29 06:55:57 +00:00
INSTALL_TARGETS += XPIDLSRCS
2012-06-01 15:13:07 +00:00
e n d i f
2012-08-29 06:55:57 +00:00
e n d i f #} XPIDLSRCS
2002-06-11 22:26:27 +00:00
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
2010-06-22 16:59:15 +00:00
i f n e q ( , $( filter %.js ,$ ( EXTRA_COMPONENTS ) $ ( EXTRA_PP_COMPONENTS ) ) )
i f e q ( , $( filter %.manifest ,$ ( EXTRA_COMPONENTS ) $ ( EXTRA_PP_COMPONENTS ) ) )
2010-06-25 12:27:10 +00:00
i f n d e f N O _ J S _ M A N I F E S T
2010-09-20 03:15:01 +00:00
$(error .js component without matching .manifest. See https : //developer .mozilla .org /en /XPCOM /XPCOM_changes_in_Gecko_ 2.0)
2010-06-22 16:59:15 +00:00
e n d i f
e n d i f
2010-06-25 12:27:10 +00:00
e n d i f
2010-06-22 16:59:15 +00:00
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
2012-08-29 06:55:57 +00:00
EXTRA_COMPONENTS_FILES := $( EXTRA_COMPONENTS)
EXTRA_COMPONENTS_DEST := $( FINAL_TARGET) /components
INSTALL_TARGETS += EXTRA_COMPONENTS
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
i f n d e f N O _ D I S T _ I N S T A L L
2012-07-23 05:42:22 +00:00
EXTRA_PP_COMPONENTS_PATH := $( FINAL_TARGET) /components
PP_TARGETS += EXTRA_PP_COMPONENTS
2005-01-12 11:23:43 +00:00
e n d i f
2010-07-22 14:38:59 +00:00
e n d i f
2005-01-12 11:23:43 +00:00
2010-07-22 14:38:59 +00:00
EXTRA_MANIFESTS = $( filter %.manifest,$( EXTRA_COMPONENTS) $( EXTRA_PP_COMPONENTS) )
i f n e q ( , $( EXTRA_MANIFESTS ) )
2012-07-23 05:42:22 +00:00
libs :: $( call mkdir_deps ,$ ( FINAL_TARGET ) )
2010-07-22 14:38:59 +00:00
$( PYTHON) $( MOZILLA_DIR) /config/buildlist.py $( FINAL_TARGET) /chrome.manifest $( patsubst %,"manifest components/%" ,$( notdir $( EXTRA_MANIFESTS) ) )
2005-01-12 11:23:43 +00:00
e n d i f
2007-06-10 22:14:53 +00:00
################################################################################
2013-06-17 17:59:49 +00:00
# Copy each element of EXTRA_JS_MODULES to
# $(FINAL_TARGET)/$(JS_MODULES_PATH). JS_MODULES_PATH defaults to "modules"
# if it is undefined.
JS_MODULES_PATH ?= modules
FINAL_JS_MODULES_PATH := $( FINAL_TARGET) /$( JS_MODULES_PATH)
2012-08-04 07:43:58 +00:00
2007-06-10 22:14:53 +00:00
i f d e f E X T R A _ J S _ M O D U L E S
i f n d e f N O _ D I S T _ I N S T A L L
2012-08-29 06:55:57 +00:00
EXTRA_JS_MODULES_FILES := $( EXTRA_JS_MODULES)
2013-06-17 17:59:49 +00:00
EXTRA_JS_MODULES_DEST := $( FINAL_JS_MODULES_PATH)
2012-08-29 06:55:57 +00:00
INSTALL_TARGETS += EXTRA_JS_MODULES
2007-06-10 22:14:53 +00:00
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
i f n d e f N O _ D I S T _ I N S T A L L
2013-06-17 17:59:49 +00:00
EXTRA_PP_JS_MODULES_PATH := $( FINAL_JS_MODULES_PATH)
2012-07-23 05:42:22 +00:00
PP_TARGETS += EXTRA_PP_JS_MODULES
2007-06-10 22:14:53 +00:00
e n d i f
e n d i f
2012-05-10 17:10:11 +00:00
################################################################################
# Copy testing-only JS modules to appropriate destination.
#
# For each file defined in TESTING_JS_MODULES, copy it to
# objdir/_tests/modules/. If TESTING_JS_MODULE_DIR is defined, that path
# wlll be appended to the output directory.
2012-09-10 18:46:03 +00:00
i f d e f E N A B L E _ T E S T S
2012-05-10 17:10:11 +00:00
i f d e f T E S T I N G _ J S _ M O D U L E S
testmodulesdir = $( DEPTH) /_tests/modules/$( TESTING_JS_MODULE_DIR)
GENERATED_DIRS += $( testmodulesdir)
i f n d e f N O _ D I S T _ I N S T A L L
2012-08-29 06:55:57 +00:00
TESTING_JS_MODULES_FILES := $( TESTING_JS_MODULES)
TESTING_JS_MODULES_DEST := $( testmodulesdir)
INSTALL_TARGETS += TESTING_JS_MODULES
2012-05-10 17:10:11 +00:00
e n d i f
2012-09-10 18:46:03 +00:00
e n d i f
2012-05-10 17:10:11 +00:00
e n d i f
2009-05-21 18:12:46 +00:00
################################################################################
# SDK
i f n e q ( , $( SDK_LIBRARY ) )
i f n d e f N O _ D I S T _ I N S T A L L
2012-08-29 06:55:57 +00:00
SDK_LIBRARY_FILES := $( SDK_LIBRARY)
SDK_LIBRARY_DEST := $( SDK_LIB_DIR)
INSTALL_TARGETS += SDK_LIBRARY
2009-05-21 18:12:46 +00:00
e n d i f
e n d i f # SDK_LIBRARY
2011-04-14 09:23:13 +00:00
i f n e q ( , $( strip $ ( SDK_BINARY ) ) )
2009-05-21 18:12:46 +00:00
i f n d e f N O _ D I S T _ I N S T A L L
2012-08-29 06:55:57 +00:00
SDK_BINARY_FILES := $( SDK_BINARY)
SDK_BINARY_DEST := $( SDK_BIN_DIR)
INSTALL_TARGETS += SDK_BINARY
2009-05-21 18:12:46 +00:00
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
2012-05-15 16:20:30 +00:00
$(FINAL_TARGET)/chrome : $( call mkdir_deps ,$ ( FINAL_TARGET ) /chrome )
2008-10-31 00:03:02 +00:00
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
2013-02-06 21:21:32 +00:00
i f d e f X P I _ N A M E
2013-02-07 16:22:11 +00:00
i f d e f X P I _ R O O T _ A P P I D
# For add-on packaging we may specify that an application
2013-02-06 21:21:32 +00:00
# sub-dir should be added to the root chrome manifest with
# a specific application id.
2013-02-07 16:22:11 +00:00
MAKE_JARS_FLAGS += --root-manifest-entry-appid= " $( XPI_ROOT_APPID) "
e n d i f
2013-02-06 21:21:32 +00:00
# if DIST_SUBDIR is defined but XPI_ROOT_APPID is not there's
# no way langpacks will get packaged right, so error out.
i f n e q ( , $( DIST_SUBDIR ) )
i f n d e f X P I _ R O O T _ A P P I D
$( error XPI_ROOT_APPID is not defined - langpacks will break .)
e n d i f
e n d i f
e n d i f
2011-10-27 12:53:20 +00:00
libs realchrome :: $( CHROME_DEPS ) $( FINAL_TARGET ) /chrome
2008-11-26 19:43:59 +00:00
$( PYTHON) $( MOZILLA_DIR) /config/JarMaker.py \
$( QUIET) -j $( FINAL_TARGET) /chrome \
$( MAKE_JARS_FLAGS) $( XULPPFLAGS) $( DEFINES) $( ACDEFINES) \
$( JAR_MANIFEST)
2013-02-06 21:21:32 +00:00
2008-11-26 19:43:59 +00:00
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 ) , )
2012-07-23 05:42:22 +00:00
DIST_FILES_PATH := $( FINAL_TARGET)
DIST_FILES_FLAGS := $( XULAPP_DEFINES)
PP_TARGETS += DIST_FILES
2005-03-28 19:36:24 +00:00
e n d i f
i f n e q ( $( DIST_CHROME_FILES ) , )
2012-07-23 05:42:22 +00:00
DIST_CHROME_FILES_PATH := $( FINAL_TARGET) /chrome
DIST_CHROME_FILES_FLAGS := $( XULAPP_DEFINES)
PP_TARGETS += DIST_CHROME_FILES
2005-03-28 19:36:24 +00:00
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 ::
2013-03-08 08:32:55 +00:00
$( RM) -r " $( DIST) /bin $( DIST_SUBDIR:%= /%) /extensions/ $( INSTALL_EXTENSION_ID) "
$( NSINSTALL) -D " $( DIST) /bin $( DIST_SUBDIR:%= /%) /extensions/ $( INSTALL_EXTENSION_ID) "
$( call copy_dir,$( FINAL_TARGET) ,$( DIST) /bin$( DIST_SUBDIR:%= /%) /extensions/$( INSTALL_EXTENSION_ID) )
2005-06-01 11:59:09 +00:00
e n d i f
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.
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 ) ) )
2013-05-23 05:28:08 +00:00
MDDEPEND_FILES := $( strip $( wildcard $( foreach file,$( sort $( OBJS) $( PROGOBJS) $( HOST_OBJS) $( HOST_PROGOBJS) $( TARGETS) $( XPIDLSRCS:.idl= .h) $( XPIDLSRCS:.idl= .xpt) ) ,$( MDDEPDIR) /$( notdir $( file) ) .pp) $( addprefix $( MDDEPDIR) /,$( EXTRA_MDDEPEND_FILES) ) ) )
1999-09-09 09:24:58 +00:00
2001-04-05 01:18:34 +00:00
i f n e q ( , $( MDDEPEND_FILES ) )
2013-04-09 22:10:25 +00:00
i f d e f . P Y M A K E
i n c l u d e d e p s $( MDDEPEND_FILES )
e l s e
i n c l u d e $( MDDEPEND_FILES )
e n d i f
1999-03-09 01:31:26 +00:00
e n d i f
2001-04-05 01:18:34 +00:00
1999-03-10 00:03:12 +00:00
e n d i f
2013-05-09 17:05:33 +00:00
i f n e q ( , $( filter export ,$ ( MAKECMDGOALS ) ) )
MDDEPEND_FILES := $( strip $( wildcard $( addprefix $( MDDEPDIR) /,$( EXTRA_EXPORT_MDDEPEND_FILES) ) ) )
i f n e q ( , $( MDDEPEND_FILES ) )
i f d e f . P Y M A K E
i n c l u d e d e p s $( MDDEPEND_FILES )
e l s e
i n c l u d e $( MDDEPEND_FILES )
e n d i f
e n d i f
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 )
#
# 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
2012-08-07 07:29:59 +00:00
################################################################################
# Install/copy rules
#
# The INSTALL_TARGETS variable contains a list of all install target
2012-08-29 06:55:57 +00:00
# categories. Each category defines a list of files and executables, and an
# install destination,
2012-08-07 07:29:59 +00:00
#
# FOO_FILES := foo bar
# FOO_EXECUTABLES := baz
# FOO_DEST := target_path
# INSTALL_TARGETS += FOO
2012-08-29 06:55:57 +00:00
#
# Additionally, a FOO_TARGET variable may be added to indicate the target for
# which the files and executables are installed. Default is "libs".
# If we're using binary nsinstall and it's not built yet, fallback to python nsinstall.
i f n e q ( , $( filter $ ( CONFIG_TOOLS ) /nsinstall $ ( HOST_BIN_SUFFIX ) ,$ ( install_cmd ) ) )
2013-01-23 09:13:04 +00:00
i f e q ( , $( wildcard $ ( CONFIG_TOOLS ) /nsinstall $ ( HOST_BIN_SUFFIX ) ) )
nsinstall_is_usable = $( if $( wildcard $( CONFIG_TOOLS) /nsinstall$( HOST_BIN_SUFFIX) ) ,yes)
2012-08-29 06:55:57 +00:00
d e f i n e i n s t a l l _ c m d _ o v e r r i d e
$(1) : install_cmd = $$( if $ $ ( nsinstall_is_usable ) ,$ $ ( INSTALL ) ,$ $ ( NSINSTALL_PY ) ) $$( 1)
e n d e f
e n d i f
2013-01-23 09:13:04 +00:00
e n d i f
2012-08-29 06:55:57 +00:00
2012-08-07 07:29:59 +00:00
d e f i n e i n s t a l l _ f i l e _ t e m p l a t e
2012-08-29 06:55:57 +00:00
$(or $(3),libs) :: $( 2) /$( notdir $ ( 1) )
$( call install_cmd_override ,$ ( 2) /$ ( notdir $ ( 1) ) )
2013-03-04 18:34:02 +00:00
$(2)/$(notdir $(1)) : $( 1)
2012-12-11 15:36:40 +00:00
$$ ( call install_cmd,$( 4) " $$ < " " $$ {@D} " )
2012-08-07 07:29:59 +00:00
e n d e f
$( foreach category ,$ ( INSTALL_TARGETS ) ,\
$( if $( $( category) _DEST) ,,$( error Missing $( category) _DEST) ) \
$( foreach file,$( $( category) _FILES) ,\
2012-08-29 06:55:57 +00:00
$( eval $( call install_file_template,$( file) ,$( $( category) _DEST) ,$( $( category) _TARGET) ,$( IFLAGS1) ) ) \
2012-08-07 07:29:59 +00:00
) \
$( foreach file,$( $( category) _EXECUTABLES) ,\
2012-08-29 06:55:57 +00:00
$( eval $( call install_file_template,$( file) ,$( $( category) _DEST) ,$( $( category) _TARGET) ,$( IFLAGS2) ) ) \
2012-08-07 07:29:59 +00:00
) \
)
2012-07-23 05:42:22 +00:00
################################################################################
# Preprocessing rules
#
# The PP_TARGETS variable contains a list of all preprocessing target
2012-12-03 00:49:32 +00:00
# categories. Each category has associated variables listing input files, the
# output directory, extra preprocessor flags, and so on. For example:
2012-07-23 05:42:22 +00:00
#
2012-12-03 00:49:32 +00:00
# FOO := input-file
# FOO_PATH := target-directory
# FOO_FLAGS := -Dsome_flag
# PP_TARGETS += FOO
2012-08-29 06:55:57 +00:00
#
2012-12-03 00:49:32 +00:00
# If PP_TARGETS lists a category name <C> (like FOO, above), then we consult the
# following make variables to see what to do:
#
# - <C> lists input files to be preprocessed with config/Preprocessor.py. We
# search VPATH for the names given here. If an input file name ends in '.in',
# that suffix is omitted from the output file name.
#
# - <C>_PATH names the directory in which to place the preprocessed output
# files. We create this directory if it does not already exist. Setting
# this variable is optional; if unset, we install the files in $(CURDIR).
#
# - <C>_FLAGS lists flags to pass to Preprocessor.py, in addition to the usual
# bunch. Setting this variable is optional.
#
# - <C>_TARGET names the 'make' target that should depend on creating the output
# files. Setting this variable is optional; if unset, we preprocess the
# files for the 'libs' target.
2012-07-23 05:42:22 +00:00
# preprocess_file_template defines preprocessing rules.
2012-12-03 00:49:32 +00:00
# $(call preprocess_file_template, source_file, output_file,
# makefile_target, extra_flags)
2012-07-23 05:42:22 +00:00
d e f i n e p r e p r o c e s s _ f i l e _ t e m p l a t e
2013-03-04 18:34:02 +00:00
$(2) : $( 1) $$( GLOBAL_DEPS )
2012-12-11 15:36:40 +00:00
$$ ( RM) " $$ @ "
2013-03-04 18:34:02 +00:00
$$ ( PYTHON) $$ ( topsrcdir) /config/Preprocessor.py $( 4) $$ ( DEFINES) $$ ( ACDEFINES) $$ ( XULPPFLAGS) " $$ < " -o " $$ @ "
2012-12-03 00:49:32 +00:00
$(3) :: $( 2)
2012-07-23 05:42:22 +00:00
e n d e f
2012-12-03 00:49:32 +00:00
$( foreach category ,$ ( PP_TARGETS ) , \
$( foreach file,$( $( category) ) , \
$( eval $( call preprocess_file_template, \
$( file) , \
$( or $( $( category) _PATH) ,$( CURDIR) ) /$( notdir $( file:.in= ) ) , \
$( or $( $( category) _TARGET) ,libs) , \
$( $( category) _FLAGS) ) ) \
) \
2012-07-23 05:42:22 +00:00
)
2013-05-17 17:54:53 +00:00
# Pull in non-recursive targets if this is a partial tree build.
i f n d e f T O P L E V E L _ B U I L D
i n c l u d e $( topsrcdir ) / c o n f i g / m a k e f i l e s / n o n r e c u r s i v e . m k
e n d i f
1998-03-28 02:44:41 +00:00
################################################################################
# Special gmake rules.
################################################################################
2007-07-25 13:56:04 +00:00
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 :
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
2012-05-16 18:46:28 +00:00
i f n d e f I N C L U D E D _ D E B U G M A K E _ M K #{
## Only parse when an echo* or show* target is requested
ifneq ( ,$( call isTargetStem,echo,show) )
include $( topsrcdir) /config/makefiles/debugmake.mk
endif #}
e n d i f #}
2000-04-21 01:14:45 +00:00
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 \
SHORT_LIBNAME \
TIERS \
2010-07-22 14:38:59 +00:00
EXTRA_COMPONENTS \
EXTRA_PP_COMPONENTS \
2012-07-26 16:38:03 +00:00
MOCHITEST_FILES \
MOCHITEST_FILES_PARTS \
MOCHITEST_CHROME_FILES \
MOCHITEST_BROWSER_FILES \
MOCHITEST_BROWSER_FILES_PARTS \
MOCHITEST_A11Y_FILES \
2013-07-19 23:59:23 +00:00
MOCHITEST_METRO_FILES \
2013-03-19 19:34:59 +00:00
MOCHITEST_ROBOCOP_FILES \
2012-07-26 16:38:03 +00:00
MOCHITEST_WEBAPPRT_CHROME_FILES \
2009-05-18 18:15:05 +00:00
$( 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) ) .) ) )
2012-04-03 20:08:16 +00:00
libs export ::
2009-05-18 18:15:05 +00:00
$( CHECK_FROZEN_VARIABLES)
2010-07-02 23:59:17 +00:00
2013-02-11 13:10:10 +00:00
PURGECACHES_DIRS ?= $( DIST) /bin
i f d e f M O Z _ W E B A P P _ R U N T I M E
PURGECACHES_DIRS += $( DIST) /bin/webapprt
e n d i f
PURGECACHES_FILES = $( addsuffix /.purgecaches,$( PURGECACHES_DIRS) )
default all :: $( PURGECACHES_FILES )
$(PURGECACHES_FILES) :
if test -d $( @D) ; then touch $@ ; fi
2012-04-02 17:06:06 +00:00
2013-05-05 08:16:25 +00:00
.DEFAULT_GOAL := $( or $( OVERRIDE_DEFAULT_GOAL) ,default)
2012-04-02 17:06:06 +00:00
#############################################################################
# Derived targets and dependencies
2012-06-27 15:31:38 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / m a k e f i l e s / a u t o t a r g e t s . m k
2012-04-02 17:06:06 +00:00
i f n e q ( $( NULL ) , $( AUTO_DEPS ) )
default all libs tools export:: $( AUTO_DEPS)
e n d i f