1 # vim:set ts=8 sw=8 sts=8 noet:
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is mozilla.org code.
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1998
21 # the Initial Developer. All Rights Reserved.
24 # Chase Phillips <chase@mozilla.org>
25 # Benjamin Smedberg <benjamin@smedbergs.us>
26 # Jeff Walden <jwalden+code@mit.edu>
28 # Alternatively, the contents of this file may be used under the terms of
29 # either of the GNU General Public License Version 2 or later (the "GPL"),
30 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 # in which case the provisions of the GPL or the LGPL are applicable instead
32 # of those above. If you wish to allow use of your version of this file only
33 # under the terms of either the GPL or the LGPL, and not to allow others to
34 # use your version of this file under the terms of the MPL, indicate your
35 # decision by deleting the provisions above and replace them with the notice
36 # and other provisions required by the GPL or the LGPL. If you do not delete
37 # the provisions above, a recipient may use your version of this file under
38 # the terms of any one of the MPL, the GPL or the LGPL.
40 # ***** END LICENSE BLOCK *****
43 $(error topsrcdir was not set
))
47 MOZILLA_DIR
= $(topsrcdir
)
50 ifndef INCLUDED_CONFIG_MK
51 include $(topsrcdir
)/config
/config.mk
54 ifndef INCLUDED_VERSION_MK
55 include $(topsrcdir
)/config
/version.mk
59 XPIDLSRCS
+= $(SDK_XPIDLSRCS
)
62 EXPORTS
+= $(SDK_HEADERS
)
65 REPORT_BUILD
= @echo
$(notdir $<)
73 # Don't copy xulrunner files at install time, when using system xulrunner
78 # ELOG prints out failed command when building silently (gmake -s).
79 ifneq (,$(findstring -s
,$(MAKEFLAGS
)))
80 ELOG
:= $(EXEC
) sh
$(BUILD_TOOLS
)/print-failed-commands.sh
85 ifeq (,$(filter-out WINNT WINCE
,$(OS_ARCH
)))
87 _LIBNAME_RELATIVE_PATHS
=1
91 ifeq (,$(filter-out WINNT WINCE
,$(OS_ARCH
)))
92 _VPATH_SRCS
= $(abspath
$<)
97 # Add $(DIST)/lib to VPATH so that -lfoo dependencies are followed
100 VPATH
+= $(LIBXUL_SDK
)/lib
103 # EXPAND_LIBNAME - $(call EXPAND_LIBNAME,foo)
104 # expands to foo.lib on platforms with import libs and -lfoo otherwise
106 # EXPAND_LIBNAME_PATH - $(call EXPAND_LIBNAME_PATH,foo,dir)
107 # expands to dir/foo.lib on platforms with import libs and
108 # -Ldir -lfoo otherwise
110 # EXPAND_MOZLIBNAME - $(call EXPAND_MOZLIBNAME,foo)
111 # expands to $(DIST)/lib/foo.lib on platforms with import libs and
114 ifdef _LIBNAME_RELATIVE_PATHS
115 EXPAND_LIBNAME
= $(foreach lib
,$(1),$(LIB_PREFIX
)$(lib
).
$(LIB_SUFFIX
))
116 EXPAND_LIBNAME_PATH
= $(foreach lib
,$(1),$(2)/$(LIB_PREFIX
)$(lib
).
$(LIB_SUFFIX
))
117 EXPAND_MOZLIBNAME
= $(foreach lib
,$(1),$(DIST
)/lib
/$(LIB_PREFIX
)$(lib
).
$(LIB_SUFFIX
))
119 EXPAND_LIBNAME
= $(addprefix -l
,$(1))
120 EXPAND_LIBNAME_PATH
= -L
$(2) $(addprefix -l
,$(1))
121 EXPAND_MOZLIBNAME
= $(addprefix -l
,$(1))
125 # If a lib.fake is present, replace it with @lib.fake, otherwise just pass
126 # the library name through unchanged.
127 EXPAND_FAKELIBS
= $(foreach f
,$(1),$(if
$(wildcard $(f
).fake
),@
$(wildcard $(f
).fake
),$(f
)))
129 # Also override EXPAND_LIBNAME_PATH and EXPAND_MOZLIBNAME on non-RELATIVE_PATH
130 # platforms, so we can shortcut linking -lfoo if we have foo.a.fake
131 ifndef _LIBNAME_RELATIVE_PATHS
132 EXPAND_LIBNAME_PATH
= $(if
$(wildcard $(2)/$(LIB_PREFIX
)$(1).
$(LIB_SUFFIX
).fake
),@
$(2)/$(LIB_PREFIX
)$(1).
$(LIB_SUFFIX
).fake
,-L
$(2) $(addprefix -l
,$(1)))
133 EXPAND_MOZLIBNAME
= $(if
$(wildcard $(DIST
)/lib
/$(LIB_PREFIX
)$(1).
$(LIB_SUFFIX
).fake
),@
$(DIST
)/lib
/$(LIB_PREFIX
)$(1).
$(LIB_SUFFIX
).fake
,$(addprefix -l
,$(1)))
140 EXTRA_DSO_LIBS
:= $(call EXPAND_MOZLIBNAME
,$(EXTRA_DSO_LIBS
))
143 ################################################################################
144 # Testing frameworks support
145 ################################################################################
151 #$(error Must define MODULE when defining XPCSHELL_TESTS.)
154 testxpcobjdir
= $(DEPTH
)/_tests
/xpcshell
156 # Test file installation
157 ifneq (,$(filter WINNT os2-emx
,$(HOST_OS_ARCH
)))
158 # Windows and OS/2 nsinstall can't recursively copy directories, so use nsinstall.py
159 TEST_INSTALLER
= $(PYTHON
) $(topsrcdir
)/config
/nsinstall.py
161 TEST_INSTALLER
= $(INSTALL
)
164 define _INSTALL_TESTS
165 $(TEST_INSTALLER
) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir
)/$(relativesrcdir
)/$(dir)
167 endef # do not remove the blank line!
169 SOLO_FILE ?
= $(error Specify a
test filename in SOLO_FILE when using check-interactive or check-one
)
172 $(foreach dir,$(XPCSHELL_TESTS
),$(_INSTALL_TESTS
))
173 $(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py \
174 $(testxpcobjdir
)/all-test-dirs.list \
175 $(addprefix $(relativesrcdir
)/,$(XPCSHELL_TESTS
))
177 testxpcsrcdir
= $(topsrcdir
)/testing
/xpcshell
179 # Execute all tests in the $(XPCSHELL_TESTS) directories.
180 # See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
182 $(PYTHON
) -u
$(topsrcdir
)/config
/pythonpath.py \
183 -I
$(topsrcdir
)/build \
184 $(testxpcsrcdir
)/runxpcshelltests.py \
185 --symbols-path
=$(DIST
)/crashreporter-symbols \
187 $(DIST
)/bin
/xpcshell \
188 $(foreach dir,$(XPCSHELL_TESTS
),$(testxpcobjdir
)/$(relativesrcdir
)/$(dir))
190 # Execute a single test, specified in $(SOLO_FILE), but don't automatically
191 # start the test. Instead, present the xpcshell prompt so the user can
192 # attach a debugger and then start the test.
194 $(PYTHON
) -u
$(topsrcdir
)/config
/pythonpath.py \
195 -I
$(topsrcdir
)/build \
196 $(testxpcsrcdir
)/runxpcshelltests.py \
197 --symbols-path
=$(DIST
)/crashreporter-symbols \
198 --test-path
=$(SOLO_FILE
) \
199 --profile-name
=$(MOZ_APP_NAME
) \
201 $(DIST
)/bin
/xpcshell \
202 $(foreach dir,$(XPCSHELL_TESTS
),$(testxpcobjdir
)/$(relativesrcdir
)/$(dir))
204 # Execute a single test, specified in $(SOLO_FILE)
206 $(PYTHON
) -u
$(topsrcdir
)/config
/pythonpath.py \
207 -I
$(topsrcdir
)/build \
208 $(testxpcsrcdir
)/runxpcshelltests.py \
209 --symbols-path
=$(DIST
)/crashreporter-symbols \
210 --test-path
=$(SOLO_FILE
) \
211 --profile-name
=$(MOZ_APP_NAME
) \
214 $(DIST
)/bin
/xpcshell \
215 $(foreach dir,$(XPCSHELL_TESTS
),$(testxpcobjdir
)/$(relativesrcdir
)/$(dir))
217 endif # XPCSHELL_TESTS
221 # Compile the tests to $(DIST)/bin. Make lots of niceties available by default
222 # through TestHarness.h, by modifying the list of includes and the libs against
224 CPPSRCS
+= $(CPP_UNIT_TESTS
)
225 SIMPLE_PROGRAMS
+= $(CPP_UNIT_TESTS
:.
cpp=$(BIN_SUFFIX
))
226 INCLUDES
+= -I
$(DIST
)/include/testing
227 LIBS
+= $(XPCOM_GLUE_LDOPTS
) $(NSPR_LIBS
)
229 # ...and run them the usual way
232 for f in
$(subst .
cpp,$(BIN_SUFFIX
),$(CPP_UNIT_TESTS
)); do \
233 XPCOM_DEBUG_BREAK
=stack-and-abort
$(RUN_TEST_PROGRAM
) $(DIST
)/bin
/$$f; \
236 endif # CPP_UNIT_TESTS
238 .PHONY
: check xpcshell-tests check-interactive check-one
246 # If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library.
247 # Otherwise, build a shared library.
251 ifdef STATIC_LIBRARY_NAME
252 LIBRARY
:= $(LIB_PREFIX
)$(STATIC_LIBRARY_NAME
).
$(LIB_SUFFIX
)
254 ifndef SUPPRESS_FAKELIB
255 FAKE_LIBRARY
= $(LIBRARY
).fake
256 endif # SUPPRESS_FAKELIB
258 endif # STATIC_LIBRARY_NAME
262 ifdef HOST_LIBRARY_NAME
263 HOST_LIBRARY
:= $(LIB_PREFIX
)$(HOST_LIBRARY_NAME
).
$(LIB_SUFFIX
)
268 ifneq (_1
,$(FORCE_SHARED_LIB
)_
$(BUILD_STATIC_LIBS
))
272 MKSHLIB
= $(MKCSHLIB
)
275 ifneq (,$(filter OS2 WINNT WINCE
,$(OS_ARCH
)))
276 IMPORT_LIBRARY
:= $(LIB_PREFIX
)$(SHARED_LIBRARY_NAME
).
$(IMPORT_LIB_SUFFIX
)
279 ifeq (OS2
,$(OS_ARCH
))
281 SHARED_LIBRARY_NAME
:= $(SHORT_LIBNAME
)
286 SHARED_LIBRARY
:= $(SHARED_LIBRARY_NAME
)
288 SHARED_LIBRARY
:= $(DLL_PREFIX
)$(SHARED_LIBRARY_NAME
)$(DLL_SUFFIX
)
291 ifeq ($(OS_ARCH
),OS2
)
292 DEF_FILE
:= $(SHARED_LIBRARY
:.dll
=.def
)
295 ifdef MOZ_ENABLE_LIBXUL
300 endif # FORCE_SHARED_LIB && !BUILD_STATIC_LIBS
303 ifeq (,$(BUILD_STATIC_LIBS
)$(FORCE_STATIC_LIB
))
307 ifeq (_1
,$(FORCE_SHARED_LIB
)_
$(BUILD_STATIC_LIBS
))
308 SHARED_LIBRARY
:= $(NULL
)
310 IMPORT_LIBRARY
:= $(NULL
)
313 ifdef FORCE_STATIC_LIB
314 ifndef FORCE_SHARED_LIB
315 SHARED_LIBRARY
:= $(NULL
)
317 IMPORT_LIBRARY
:= $(NULL
)
321 ifdef FORCE_SHARED_LIB
322 ifndef FORCE_STATIC_LIB
327 ifdef JAVA_LIBRARY_NAME
328 JAVA_LIBRARY
:= $(JAVA_LIBRARY_NAME
).jar
331 ifeq (,$(filter-out WINNT WINCE
,$(OS_ARCH
)))
335 # Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
336 # directory. For parallel builds, this PDB file is shared and locked by
337 # MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
338 # without SP1, don't do parallel builds.
340 # The final PDB for libraries and programs is created by the linker and uses
341 # a different name from the single PDB file created by the compiler. See
345 ifdef SIMPLE_PROGRAMS
346 COMPILE_PDBFILE
= $(basename $(@F
)).pdb
348 COMPILE_PDBFILE
= generated.pdb
351 LINK_PDBFILE
= $(basename $(@F
)).pdb
353 CODFILE
=$(basename $(@F
)).cod
357 ifdef SHARED_LIBRARY_NAME
358 MAPFILE
=$(SHARED_LIBRARY_NAME
).map
360 MAPFILE
=$(basename $(@F
)).map
361 endif # SHARED_LIBRARY_NAME
365 OS_LDFLAGS
+= -DEF
:$(call normalizepath
,$(DEFFILE
))
366 EXTRA_DEPS
+= $(DEFFILE
)
370 OS_LDFLAGS
+= -MAP
:$(MAPFILE
)
375 ifdef ENABLE_CXX_EXCEPTIONS
376 CXXFLAGS
+= $(MOZ_EXCEPTIONS_FLAGS_ON
) -DMOZ_CPP_EXCEPTIONS
=1
377 endif # ENABLE_CXX_EXCEPTIONS
380 ifeq ($(SOLARIS_SUNPRO_CXX
),1)
381 ifeq (86,$(findstring 86,$(OS_TEST
)))
382 OS_LDFLAGS
+= -M
$(topsrcdir
)/config
/solaris_ia32.map
384 endif # Solaris Sun Studio C++
386 ifeq (,$(filter-out WINNT WINCE
,$(HOST_OS_ARCH
)))
387 HOST_PDBFILE
=$(basename $(@F
)).pdb
391 TARGETS
= $(LIBRARY
) $(SHARED_LIBRARY
) $(PROGRAM
) $(SIMPLE_PROGRAMS
) $(HOST_LIBRARY
) $(HOST_PROGRAM
) $(HOST_SIMPLE_PROGRAMS
) $(JAVA_LIBRARY
)
397 $(addsuffix .
$(OBJ_SUFFIX
), $(JMC_GEN
)) \
398 $(CSRCS
:.c
=.
$(OBJ_SUFFIX
)) \
399 $(SSRCS
:.S
=.
$(OBJ_SUFFIX
)) \
400 $(patsubst %.
cc,%.
$(OBJ_SUFFIX
),$(CPPSRCS
:.
cpp=.
$(OBJ_SUFFIX
))) \
401 $(CMSRCS
:.m
=.
$(OBJ_SUFFIX
)) \
402 $(CMMSRCS
:.mm
=.
$(OBJ_SUFFIX
)) \
403 $(ASFILES
:.
$(ASM_SUFFIX
)=.
$(OBJ_SUFFIX
))
404 OBJS
= $(strip $(_OBJS
))
409 $(addprefix host_
,$(HOST_CSRCS
:.c
=.
$(OBJ_SUFFIX
))) \
410 $(addprefix host_
,$(patsubst %.
cc,%.
$(OBJ_SUFFIX
),$(HOST_CPPSRCS
:.
cpp=.
$(OBJ_SUFFIX
)))) \
411 $(addprefix host_
,$(HOST_CMSRCS
:.m
=.
$(OBJ_SUFFIX
))) \
412 $(addprefix host_
,$(HOST_CMMSRCS
:.mm
=.
$(OBJ_SUFFIX
)))
413 HOST_OBJS
= $(strip $(_HOST_OBJS
))
416 LIBOBJS
:= $(addprefix \", $(OBJS
))
417 LIBOBJS
:= $(addsuffix \", $(LIBOBJS
))
420 ifneq (,$(OBJS
)$(XPIDLSRCS
)$(SIMPLE_PROGRAMS
))
421 MDDEPFILES
= $(addprefix $(MDDEPDIR
)/,$(OBJS
:.
$(OBJ_SUFFIX
)=.pp
))
423 MDDEPFILES
+= $(addprefix $(MDDEPDIR
)/,$(XPIDLSRCS
:.idl
=.xpt
))
429 $(GARBAGE
) $(TARGETS
) $(OBJS
) $(PROGOBJS
) LOGS TAGS a.out \
430 $(filter-out $(ASFILES
),$(OBJS
:.
$(OBJ_SUFFIX
)=.s
)) $(OBJS
:.
$(OBJ_SUFFIX
)=.ii
) \
431 $(OBJS
:.
$(OBJ_SUFFIX
)=.i
) \
432 $(HOST_PROGOBJS
) $(HOST_OBJS
) $(IMPORT_LIBRARY
) $(DEF_FILE
)\
433 $(EXE_DEF_FILE
) so_locations _gen _stubs
$(wildcard *.res
) $(wildcard *.RES
) \
434 $(wildcard *.pdb
) $(CODFILE
) $(MAPFILE
) $(IMPORT_LIBRARY
) \
435 $(SHARED_LIBRARY
:$(DLL_SUFFIX
)=.exp
) $(wildcard *.ilk
) \
436 $(PROGRAM
:$(BIN_SUFFIX
)=.exp
) $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.exp
) \
437 $(PROGRAM
:$(BIN_SUFFIX
)=.lib
) $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.lib
) \
438 $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.
$(OBJ_SUFFIX
)) \
439 $(wildcard gts_tmp_
*) $(LIBRARY
:%.a
=.
%.timestamp
)
441 $(GARBAGE_DIRS
) /no-such-file
444 GARBAGE
+= $(MOCSRCS
)
447 ifdef SIMPLE_PROGRAMS
448 GARBAGE
+= $(SIMPLE_PROGRAMS
:%=%.
$(OBJ_SUFFIX
))
451 ifdef HOST_SIMPLE_PROGRAMS
452 GARBAGE
+= $(HOST_SIMPLE_PROGRAMS
:%=%.
$(OBJ_SUFFIX
))
456 # the Solaris WorkShop template repository cache. it occasionally can get
457 # out of sync, so targets like clobber should kill it.
459 ifeq ($(SOLARIS_SUNPRO_CXX
),1)
460 GARBAGE_DIRS
+= SunWS_cache
463 ifeq ($(OS_ARCH
),OpenVMS
)
464 GARBAGE
+= $(wildcard *.
*_defines
)
466 VMS_SYMVEC_FILE
= $(SHARED_LIBRARY
:$(DLL_SUFFIX
)=_symvec.opt
)
468 VMS_SYMVEC_FILE_MODULE
= $(topsrcdir
)/build
/unix
/vms
/$(notdir $(SHARED_LIBRARY
:$(DLL_SUFFIX
)=_dbg_symvec.opt
))
470 VMS_SYMVEC_FILE_MODULE
= $(topsrcdir
)/build
/unix
/vms
/$(notdir $(SHARED_LIBRARY
:$(DLL_SUFFIX
)=_symvec.opt
))
472 VMS_SYMVEC_FILE_COMP
= $(topsrcdir
)/build
/unix
/vms
/component_symvec.opt
473 GARBAGE
+= $(VMS_SYMVEC_FILE
)
475 DSO_LDOPTS
:= $(filter-out -auto_symvec
,$(DSO_LDOPTS
)) $(VMS_SYMVEC_FILE
)
480 XPIDL_GEN_DIR
= _xpidlgen
482 ifdef MOZ_UPDATE_XTERM
483 # Its good not to have a newline at the end of the titlebar string because it
484 # makes the make -s output easier to read. Echo -n does not work on all
485 # platforms, but we can trick sed into doing it.
486 UPDATE_TITLE
= sed
-e
"s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR
)/config
/xterm.str
;
489 define SUBMAKE
# $(call SUBMAKE,target,directory)
491 +@
$(MAKE
) $(if
$(2),-C
$(2)) $(1)
493 endef # The extra line is important here! don't delete it
495 ifneq (,$(strip $(DIRS
)))
497 $(foreach dir,$(DIRS
),$(call SUBMAKE
,$@
,$(dir)))
500 # we only use this for the makefiles target and other stuff that doesn't matter
501 ifneq (,$(strip $(PARALLEL_DIRS
)))
502 LOOP_OVER_PARALLEL_DIRS
= \
503 $(foreach dir,$(PARALLEL_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
506 ifneq (,$(strip $(STATIC_DIRS
)))
507 LOOP_OVER_STATIC_DIRS
= \
508 $(foreach dir,$(STATIC_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
511 ifneq (,$(strip $(TOOL_DIRS
)))
512 LOOP_OVER_TOOL_DIRS
= \
513 $(foreach dir,$(TOOL_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
517 # create a bunch of fake targets for order-only processing
518 PARALLEL_DIRS_export
= $(addsuffix _export
,$(PARALLEL_DIRS
))
519 PARALLEL_DIRS_libs
= $(addsuffix _libs
,$(PARALLEL_DIRS
))
520 PARALLEL_DIRS_tools
= $(addsuffix _tools
,$(PARALLEL_DIRS
))
522 .PHONY
: $(PARALLEL_DIRS_export
) $(PARALLEL_DIRS_libs
) $(PARALLEL_DIRS_tools
)
526 # Now we can differentiate between objects used to build a library, and
527 # objects used to build an executable in the same directory.
534 HOST_PROGOBJS
= $(HOST_OBJS
)
537 # MAKE_DIRS: List of directories to build while looping over directories.
538 # A Makefile that needs $(MDDEPDIR) created but doesn't set any of these
539 # variables we know to check can just set NEED_MDDEPDIR explicitly.
540 ifneq (,$(OBJS
)$(XPIDLSRCS
)$(SIMPLE_PROGRAMS
)$(NEED_MDDEPDIR
))
541 MAKE_DIRS
+= $(CURDIR
)/$(MDDEPDIR
)
542 GARBAGE_DIRS
+= $(MDDEPDIR
)
546 # Tags: emacs (etags), vi (ctags)
547 # TAG_PROGRAM := ctags -L -
549 TAG_PROGRAM
= xargs etags
-a
552 # Turn on C++ linking if we have any .cpp or .mm files
553 # (moved this from config.mk so that config.mk can be included
554 # before the CPPSRCS are defined)
556 ifneq ($(CPPSRCS
)$(CMMSRCS
),)
561 # Make sure to wrap static libs inside linker specific flags to turn on & off
562 # inclusion of all symbols inside the static libs
564 ifndef NO_LD_ARCHIVE_FLAGS
565 ifdef SHARED_LIBRARY_LIBS
566 EXTRA_DSO_LDOPTS
:= $(MKSHLIB_FORCE_ALL
) $(call EXPAND_FAKELIBS
,$(SHARED_LIBRARY_LIBS
)) $(MKSHLIB_UNFORCE_ALL
) $(EXTRA_DSO_LDOPTS
)
571 # This will strip out symbols that the component should not be
572 # exporting from the .dynsym section.
575 EXTRA_DSO_LDOPTS
+= $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
)
579 # Enforce the requirement that MODULE_NAME must be set
580 # for components in static builds
584 ifndef FORCE_SHARED_LIB
586 $(error MODULE_NAME is required for components which may be used in static builds
)
593 # MacOS X specific stuff
596 ifeq ($(OS_ARCH
),Darwin
)
599 EXTRA_DSO_LDOPTS
+= -bundle
601 EXTRA_DSO_LDOPTS
+= -dynamiclib
-install_name @executable_path
/$(SHARED_LIBRARY
) -compatibility_version
1 -current_version
1 -single_module
607 # On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be
608 # fatal symbol name clashes between components.
610 ifeq ($(OS_ARCH
),NetBSD
)
611 ifeq ($(DLL_SUFFIX
),.so
.1.0)
613 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
618 ifeq ($(OS_ARCH
),FreeBSD
)
620 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
624 ifeq ($(OS_ARCH
),NetBSD
)
625 ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips
,$(OS_TEST
)))
626 ifeq ($(MODULE
),layout
)
627 OS_CFLAGS
+= -Wa
,-xgot
628 OS_CXXFLAGS
+= -Wa
,-xgot
634 # HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
635 # which uses internal symbols first
637 ifeq ($(OS_ARCH
),HP-UX
)
639 ifeq ($(GNU_CC
)$(GNU_CXX
),)
640 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
641 ifneq ($(HAS_EXTRAEXPORTS
),1)
642 MKSHLIB
+= -Wl
,+eNSGetModule
-Wl
,+eerrno
643 MKCSHLIB
+= +eNSGetModule
+eerrno
644 ifneq ($(OS_TEST
),ia64
)
645 MKSHLIB
+= -Wl
,+e_shlInit
646 MKCSHLIB
+= +e_shlInit
648 endif # !HAS_EXTRAEXPORTS
649 endif # non-gnu compilers
653 ifeq ($(OS_ARCH
),AIX
)
655 ifneq ($(HAS_EXTRAEXPORTS
),1)
656 MKSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
657 MKCSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
658 endif # HAS_EXTRAEXPORTS
663 # OSF1: add -B symbolic flag for components
665 ifeq ($(OS_ARCH
),OSF1
)
667 ifeq ($(GNU_CC
)$(GNU_CXX
),)
668 EXTRA_DSO_LDOPTS
+= -B symbolic
674 # Linux: add -Bsymbolic flag for components
676 ifeq ($(OS_ARCH
),Linux
)
678 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
683 # GNU doesn't have path length limitation
686 ifeq ($(OS_ARCH
),GNU
)
687 OS_CPPFLAGS
+= -DPATH_MAX
=1024 -DMAXPATHLEN
=1024
693 ifeq ($(OS_ARCH
),WINNT
)
696 DSO_LDOPTS
+= -Wl
,--out-implib
-Wl
,$(IMPORT_LIBRARY
)
709 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
713 endif # WINNT && !GNU_CC
714 ifneq (,$(filter WINCE
,$(OS_ARCH
)))
718 ifeq ($(OS_ARCH
), WINCE
)
720 HOST_OUTOPTION
= -Fo
# eol
723 ifeq (,$(CROSS_COMPILE
))
724 HOST_OUTOPTION
= $(OUTOPTION
)
726 HOST_OUTOPTION
= -o
# eol
730 ################################################################################
732 # SUBMAKEFILES: List of Makefiles for next level down.
733 # This is used to update or create the Makefiles before invoking them.
734 SUBMAKEFILES
+= $(addsuffix /Makefile
, $(DIRS
) $(TOOL_DIRS
) $(PARALLEL_DIRS
))
736 # The root makefile doesn't want to do a plain export/libs, because
737 # of the tiers and because of libxul. Suppress the default rules in favor
738 # of something else. Makefiles which use this var *must* provide a sensible
739 # default rule before including rules.mk
740 ifndef SUPPRESS_DEFAULT_RULES
743 $(foreach tier
,$(TIERS
),$(call SUBMAKE
,tier_
$(tier
)))
747 ifneq (,$(strip $(STATIC_DIRS
)))
748 $(foreach dir,$(STATIC_DIRS
),$(call SUBMAKE
,,$(dir)))
762 endif # SUPPRESS_DEFAULT_RULES
764 ifeq ($(filter s
,$(MAKEFLAGS
)),)
772 MAKE_TIER_SUBMAKEFILES
= +$(if
$(tier_
$*_dirs
),$(MAKE
) $(addsuffix /Makefile
,$(tier_
$*_dirs
)))
776 @
$(MAKE_TIER_SUBMAKEFILES
)
777 $(foreach dir,$(tier_
$*_dirs
),$(call SUBMAKE
,export,$(dir)))
781 @
$(MAKE_TIER_SUBMAKEFILES
)
782 $(foreach dir,$(tier_
$*_dirs
),$(call SUBMAKE
,libs
,$(dir)))
786 @
$(MAKE_TIER_SUBMAKEFILES
)
787 $(foreach dir,$(tier_
$*_dirs
),$(call SUBMAKE
,tools
,$(dir)))
789 $(foreach tier
,$(TIERS
),tier_
$(tier
))::
790 @
$(ECHO
) "$@: $($@_staticdirs) $($@_dirs)"
791 $(foreach dir,$($@_staticdirs
),$(call SUBMAKE
,,$(dir)))
796 # Do everything from scratch
801 # Add dummy depend target for tinderboxes
804 # Target to only regenerate makefiles
805 makefiles
: $(SUBMAKEFILES
)
806 ifneq (,$(DIRS
)$(TOOL_DIRS
)$(PARALLEL_DIRS
))
807 $(LOOP_OVER_PARALLEL_DIRS
)
809 $(LOOP_OVER_TOOL_DIRS
)
813 export:: $(PARALLEL_DIRS_export
)
815 $(PARALLEL_DIRS_export
): %_export
: %/Makefile
816 +@
$(call SUBMAKE
,export,$*)
819 export:: $(SUBMAKEFILES
) $(MAKE_DIRS
) $(if
$(XPIDLSRCS
),$(IDL_DIR
))
821 $(LOOP_OVER_TOOL_DIRS
)
824 tools
:: $(PARALLEL_DIRS_tools
)
826 $(PARALLEL_DIRS_tools
): %_tools
: %/Makefile
827 +@
$(call SUBMAKE
,tools
,$*)
830 tools
:: $(SUBMAKEFILES
) $(MAKE_DIRS
)
832 ifneq (,$(strip $(TOOL_DIRS
)))
833 $(foreach dir,$(TOOL_DIRS
),$(call SUBMAKE
,libs
,$(dir)))
837 # Rule to create list of libraries for final link
843 ifdef BUILD_STATIC_LIBS
844 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_LINK_COMPS
) $(STATIC_LIBRARY_NAME
)
846 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_LINK_COMP_NAMES
) $(MODULE_NAME
)
848 endif # BUILD_STATIC_LIBS
850 $(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_LINK_LIBS
) $(STATIC_LIBRARY_NAME
)
852 endif # EXPORT_LIBRARY
855 # Create dependencies on static (and shared EXTRA_DSO_LIBS) libraries
856 LIBS_DEPS
= $(filter %.
$(LIB_SUFFIX
), $(LIBS
))
857 HOST_LIBS_DEPS
= $(filter %.
$(LIB_SUFFIX
), $(HOST_LIBS
))
858 DSO_LDOPTS_DEPS
= $(EXTRA_DSO_LIBS
) $(filter %.
$(LIB_SUFFIX
), $(EXTRA_DSO_LDOPTS
))
860 ifndef _LIBNAME_RELATIVE_PATHS
862 LIBS_DEPS
+= $(filter -l
%, $(LIBS
))
863 HOST_LIBS_DEPS
+= $(filter -l
%, $(HOST_LIBS
))
864 DSO_LDOPTS_DEPS
+= $(filter -l
%, $(EXTRA_DSO_LDOPTS
))
866 _LIBDIRS
= $(patsubst -L
%,%,$(filter -L
%, $(LIBS
) $(HOST_LIBS
) $(EXTRA_DSO_LDOPTS
)))
868 vpath
$(LIB_PREFIX
)%.
$(LIB_SUFFIX
) $(_LIBDIRS
)
869 ifdef IMPORT_LIB_SUFFIX
870 vpath
$(LIB_PREFIX
)%.
$(IMPORT_LIB_SUFFIX
) $(_LIBDIRS
)
871 endif # IMPORT_LIB_SUFFIX
872 vpath
$(DLL_PREFIX
)%$(DLL_SUFFIX
) $(_LIBDIRS
)
875 endif # _LIBNAME_RELATIVE_PATHS
877 # Dependancies which, if modified, should cause everything to rebuild
878 GLOBAL_DEPS
+= Makefile Makefile.in
$(DEPTH
)/config
/autoconf.mk
$(topsrcdir
)/config
/config.mk
880 ##############################################
882 libs
:: $(PARALLEL_DIRS_libs
)
884 $(PARALLEL_DIRS_libs
): %_libs
: %/Makefile
885 +@
$(call SUBMAKE
,libs
,$*)
888 libs
:: $(SUBMAKEFILES
) $(MAKE_DIRS
) $(HOST_LIBRARY
) $(LIBRARY
) $(SHARED_LIBRARY
) $(IMPORT_LIBRARY
) $(HOST_PROGRAM
) $(PROGRAM
) $(HOST_SIMPLE_PROGRAMS
) $(SIMPLE_PROGRAMS
) $(JAVA_LIBRARY
)
889 ifndef NO_DIST_INSTALL
891 ifdef EXPORT_LIBRARY
# Stage libs that will be linked into a static build
893 $(INSTALL
) $(IFLAGS1
) $(LIBRARY
) $(FAKE_LIBRARY
) $(DEPTH
)/staticlib
/components
895 $(INSTALL
) $(IFLAGS1
) $(LIBRARY
) $(FAKE_LIBRARY
) $(DEPTH
)/staticlib
897 endif # EXPORT_LIBRARY
900 $(error Shipping static component libs makes no sense.
)
902 $(INSTALL
) $(IFLAGS1
) $(LIBRARY
) $(DIST
)/lib
908 $(INSTALL
) $(IFLAGS2
) $(SHARED_LIBRARY
) $(FINAL_TARGET
)/components
909 $(ELF_DYNSTR_GC
) $(FINAL_TARGET
)/components
/$(SHARED_LIBRARY
)
910 ifndef NO_COMPONENTS_MANIFEST
911 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/chrome.manifest
"manifest components/components.manifest"
912 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/components
/components.manifest
"binary-component $(SHARED_LIBRARY)"
914 ifdef BEOS_ADDON_WORKAROUND
915 ( cd
$(FINAL_TARGET
)/components
&& $(CC
) -nostart
-o
$(SHARED_LIBRARY
).stub
$(SHARED_LIBRARY
) )
917 else # ! IS_COMPONENT
918 ifneq (,$(filter OS2 WINNT WINCE
,$(OS_ARCH
)))
919 $(INSTALL
) $(IFLAGS2
) $(IMPORT_LIBRARY
) $(DIST
)/lib
921 $(INSTALL
) $(IFLAGS2
) $(SHARED_LIBRARY
) $(DIST
)/lib
923 $(INSTALL
) $(IFLAGS2
) $(SHARED_LIBRARY
) $(FINAL_TARGET
)
924 ifdef BEOS_ADDON_WORKAROUND
925 ( cd
$(FINAL_TARGET
) && $(CC
) -nostart
-o
$(SHARED_LIBRARY
).stub
$(SHARED_LIBRARY
) )
928 endif # SHARED_LIBRARY
930 $(INSTALL
) $(IFLAGS2
) $(PROGRAM
) $(FINAL_TARGET
)
932 ifdef SIMPLE_PROGRAMS
933 $(INSTALL
) $(IFLAGS2
) $(SIMPLE_PROGRAMS
) $(FINAL_TARGET
)
936 $(INSTALL
) $(IFLAGS2
) $(HOST_PROGRAM
) $(DIST
)/host
/bin
938 ifdef HOST_SIMPLE_PROGRAMS
939 $(INSTALL
) $(IFLAGS2
) $(HOST_SIMPLE_PROGRAMS
) $(DIST
)/host
/bin
942 $(INSTALL
) $(IFLAGS1
) $(HOST_LIBRARY
) $(DIST
)/host
/lib
946 $(INSTALL
) $(IFLAGS1
) $(JAVA_LIBRARY
) $(FINAL_TARGET
)/components
948 $(INSTALL
) $(IFLAGS1
) $(JAVA_LIBRARY
) $(FINAL_TARGET
)
951 endif # !NO_DIST_INSTALL
954 ##############################################
956 ifndef NO_PROFILE_GUIDED_OPTIMIZE
957 ifdef MOZ_PROFILE_USE
958 ifeq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
959 # When building with PGO, we have to make sure to re-link
960 # in the MOZ_PROFILE_USE phase if we linked in the
961 # MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
962 # file in the link rule in the GENERATE phase to indicate
963 # that we need a relink.
965 $(SHARED_LIBRARY
): pgo.relink
968 $(PROGRAM
): pgo.relink
971 # In the second pass, we need to merge the pgc files into the pgd file.
972 # The compiler would do this for us automatically if they were in the right
973 # place, but they're in dist/bin.
974 ifneq (,$(SHARED_LIBRARY
)$(PROGRAM
))
977 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
978 $(PROGRAM
:$(BIN_SUFFIX
)=) $(DIST
)/bin
981 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
982 $(SHARED_LIBRARY_NAME
) $(DIST
)/bin
984 endif # SHARED_LIBRARY || PROGRAM
986 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
987 endif # NO_PROFILE_GUIDED_OPTIMIZE
989 ##############################################
992 $(MAKE
) -C
$(topsrcdir
) -f client.mk checkout
994 clean clobber realclean clobber_all
:: $(SUBMAKEFILES
)
996 -rm -rf
$(ALL_TRASH_DIRS
)
997 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(STATIC_DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
999 distclean:: $(SUBMAKEFILES
)
1000 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(STATIC_DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
1001 -rm -rf
$(ALL_TRASH_DIRS
)
1002 -rm -f
$(ALL_TRASH
) \
1003 Makefile .HSancillary \
1004 $(wildcard *.
$(OBJ_SUFFIX
)) $(wildcard *.ho
) $(wildcard host_
*.o
*) \
1005 $(wildcard *.
$(LIB_SUFFIX
)) $(wildcard *$(DLL_SUFFIX
)) \
1006 $(wildcard *.
$(IMPORT_LIB_SUFFIX
))
1007 ifeq ($(OS_ARCH
),OS2
)
1008 -rm -f
$(PROGRAM
:.exe
=.map
)
1013 find
$(topsrcdir
) -name
dist -prune
-o \
( -name
'*.[hc]' -o
-name
'*.cp' -o
-name
'*.cpp' -o
-name
'*.idl' \
) -print |
$(TAG_PROGRAM
)
1017 # creates OBJS, links with LIBS to create Foo
1019 $(PROGRAM
): $(PROGOBJS
) $(LIBS_DEPS
) $(EXTRA_DEPS
) $(EXE_DEF_FILE
) $(RESFILE
) $(GLOBAL_DEPS
)
1021 ifeq (WINCE
,$(OS_ARCH
))
1022 $(LD
) -NOLOGO
-OUT
:$@
$(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(PROGOBJS
) $(RESFILE
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1024 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
1025 $(LD
) -NOLOGO
-OUT
:$@
-PDB
:$(LINK_PDBFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(PROGOBJS
) $(RESFILE
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1026 ifdef MSMANIFEST_TOOL
1027 @if
test -f
$@.manifest
; then \
1028 if
test -f
"$(srcdir)/$@.manifest"; then \
1029 echo
"Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
1030 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1032 echo
"Embedding manifest from $@.manifest"; \
1033 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1035 elif
test -f
"$(srcdir)/$@.manifest"; then \
1036 echo
"Embedding manifest from $(srcdir)/$@.manifest"; \
1037 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE
:$@\
;1; \
1039 endif # MSVC with manifest tool
1040 ifdef MOZ_PROFILE_GENERATE
1041 # touch it a few seconds into the future to work around FAT's
1042 # 2-second granularity
1043 touch
-t
`date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
1045 else # !WINNT || GNU_CC
1046 ifeq ($(CPP_PROG_LINK
),1)
1047 $(CCC
) -o
$@
$(CXXFLAGS
) $(WRAP_MALLOC_CFLAGS
) $(PROGOBJS
) $(RESFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(LIBS_DIR
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)) $(BIN_FLAGS
) $(call EXPAND_FAKELIBS
,$(WRAP_MALLOC_LIB
)) $(EXE_DEF_FILE
)
1048 else # ! CPP_PROG_LINK
1049 $(CC
) -o
$@
$(CFLAGS
) $(PROGOBJS
) $(RESFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(LIBS_DIR
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)) $(BIN_FLAGS
) $(EXE_DEF_FILE
)
1050 endif # CPP_PROG_LINK
1051 endif # WINNT && !GNU_CC
1057 ifdef MOZ_POST_PROGRAM_COMMAND
1058 $(MOZ_POST_PROGRAM_COMMAND
) $@
1060 ifeq ($(OS_ARCH
),BeOS
)
1061 ifdef BEOS_PROGRAM_RESOURCE
1062 xres
-o
$@
$(BEOS_PROGRAM_RESOURCE
)
1067 $(HOST_PROGRAM
): $(HOST_PROGOBJS
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
1068 ifeq (WINCE
,$(OS_ARCH
))
1069 $(HOST_LD
) -NOLOGO
-OUT
:$@
$(HOST_OBJS
) $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1071 ifeq (_WINNT
,$(GNU_CC
)_
$(HOST_OS_ARCH
))
1072 $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $(HOST_OBJS
) $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1073 ifdef MSMANIFEST_TOOL
1074 @if
test -f
$@.manifest
; then \
1075 if
test -f
"$(srcdir)/$@.manifest"; then \
1076 echo
"Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
1077 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1079 echo
"Embedding manifest from $@.manifest"; \
1080 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1082 elif
test -f
"$(srcdir)/$@.manifest"; then \
1083 echo
"Embedding manifest from $(srcdir)/$@.manifest"; \
1084 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE
:$@\
;1; \
1086 endif # MSVC with manifest tool
1088 ifeq ($(CPP_PROG_LINK
),1)
1089 $(HOST_CXX
) -o
$@
$(HOST_CXXFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1091 $(HOST_CC
) -o
$@
$(HOST_CFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1092 endif # CPP_PROG_LINK
1097 # This is an attempt to support generation of multiple binaries
1098 # in one directory, it assumes everything to compile Foo is in
1099 # Foo.o (from either Foo.c or Foo.cpp).
1101 # SIMPLE_PROGRAMS = Foo Bar
1102 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
1104 $(SIMPLE_PROGRAMS
): %$(BIN_SUFFIX
): %.
$(OBJ_SUFFIX
) $(LIBS_DEPS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
1105 ifeq (WINCE
,$(OS_ARCH
))
1106 $(LD
) -nologo
-entry
:mainACRTStartup
-out
:$@
$< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1108 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
1109 $(LD
) -nologo
-out
:$@
-pdb
:$(LINK_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1110 ifdef MSMANIFEST_TOOL
1111 @if
test -f
$@.manifest
; then \
1112 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1113 rm -f
$@.manifest
; \
1115 endif # MSVC with manifest tool
1117 ifeq ($(CPP_PROG_LINK
),1)
1118 $(CCC
) $(WRAP_MALLOC_CFLAGS
) $(CXXFLAGS
) -o
$@
$< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(LIBS_DIR
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
) $(WRAP_MALLOC_LIB
)) $(BIN_FLAGS
)
1120 $(CC
) $(WRAP_MALLOC_CFLAGS
) $(CFLAGS
) $(OUTOPTION
)$@
$< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(LIBS_DIR
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
) $(WRAP_MALLOC_LIB
)) $(BIN_FLAGS
)
1121 endif # CPP_PROG_LINK
1122 endif # WINNT && !GNU_CC
1128 ifdef MOZ_POST_PROGRAM_COMMAND
1129 $(MOZ_POST_PROGRAM_COMMAND
) $@
1132 $(HOST_SIMPLE_PROGRAMS
): host_
%$(HOST_BIN_SUFFIX
): host_
%.
$(OBJ_SUFFIX
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
1133 ifeq (WINCE
,$(OS_ARCH
))
1134 $(HOST_LD
) -NOLOGO
-OUT
:$@
$(WIN32_EXE_LDFLAGS
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1136 ifeq (WINNT_
,$(HOST_OS_ARCH
)_
$(GNU_CC
))
1137 $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1139 ifneq (,$(HOST_CPPSRCS
)$(USE_HOST_CXX
))
1140 $(HOST_CXX
) $(HOST_OUTOPTION
)$@
$(HOST_CXXFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1142 $(HOST_CC
) $(HOST_OUTOPTION
)$@
$(HOST_CFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1148 # Purify target. Solaris/sparc only to start.
1149 # Purify does not recognize "egcs" or "c++" so we go with
1150 # "gcc" and "g++" for now.
1153 ifeq ($(CPP_PROG_LINK
),1)
1154 $(PURIFY
) $(CCC
) -o
$^.pure
$(CXXFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1156 $(PURIFY
) $(CC
) -o
$^.pure
$(CFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1158 ifndef NO_DIST_INSTALL
1159 $(INSTALL
) $(IFLAGS2
) $^.pure
$(FINAL_TARGET
)
1162 quantify
: $(PROGRAM
)
1163 ifeq ($(CPP_PROG_LINK
),1)
1164 $(QUANTIFY
) $(CCC
) -o
$^.quantify
$(CXXFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1166 $(QUANTIFY
) $(CC
) -o
$^.quantify
$(CFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1168 ifndef NO_DIST_INSTALL
1169 $(INSTALL
) $(IFLAGS2
) $^.quantify
$(FINAL_TARGET
)
1173 # This allows us to create static versions of the shared libraries
1174 # that are built using other static libraries. Confused...?
1176 ifdef SHARED_LIBRARY_LIBS
1177 ifeq (,$(GNU_LD
)$(filter-out OS2 WINNT WINCE
, $(OS_ARCH
)))
1178 ifneq (,$(BUILD_STATIC_LIBS
)$(FORCE_STATIC_LIB
))
1179 LOBJS
+= $(SHARED_LIBRARY_LIBS
)
1182 NONFAKE_SHARED_LIBRARY_LIBS
= $(filter-out %.fake
,$(call EXPAND_FAKELIBS
,$(SHARED_LIBRARY_LIBS
)))
1183 ifeq (,$(NONFAKE_SHARED_LIBRARY_LIBS
))
1184 # All of our SHARED_LIBRARY_LIBS have fake equivalents. Score!
1185 # Just pass the original object files around.
1186 # For shared libraries, these are already included in EXTRA_DSO_LDOPTS
1188 ifndef SHARED_LIBRARY
1189 LOBJS
+= $(shell cat
$(addsuffix .fake
,$(SHARED_LIBRARY_LIBS
)))
1193 ifneq (,$(filter OSF1 BSD_OS FreeBSD NetBSD OpenBSD SunOS Darwin
,$(OS_ARCH
)))
1194 CLEANUP1
:= | egrep
-v
'(________64ELEL_|__.SYMDEF)'
1195 CLEANUP2
:= rm -f ________64ELEL_ __.SYMDEF
1199 SUB_LOBJS
= $(shell for lib in
$(SHARED_LIBRARY_LIBS
); do
$(AR_LIST
) $${lib} $(CLEANUP1
); done
;)
1200 endif # EXPAND_FAKELIBS
1201 endif # SHARED_LIBARY_LIBS
1203 ifdef MOZILLA_PROBE_LIBS
1204 PROBE_LOBJS
= $(shell for lib in
$(MOZILLA_PROBE_LIBS
); do
$(AR_LIST
) $${lib} $(CLEANUP1
); done
;)
1206 ifdef DTRACE_PROBE_OBJ
1207 EXTRA_DEPS
+= $(DTRACE_PROBE_OBJ
)
1210 $(LIBRARY
): $(OBJS
) $(LOBJS
) $(SHARED_LIBRARY_LIBS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
1212 ifndef SKIP_SUB_LOBJS
1213 ifneq (,$(GNU_LD
)$(filter-out OS2 WINNT WINCE
, $(OS_ARCH
)))
1214 ifdef SHARED_LIBRARY_LIBS
1216 @for lib in
$(SHARED_LIBRARY_LIBS
); do
$(AR_EXTRACT
) $${lib}; $(CLEANUP2
); done
1219 endif # SKIP_SUB_LOBJS
1220 $(AR
) $(AR_FLAGS
) $(OBJS
) $(LOBJS
) $(SUB_LOBJS
)
1223 # Don't clean these up if we're building a fake lib, because then
1224 # we'll reference nonexistent object files in our fake lib.
1225 @
rm -f foodummyfilefoo
$(SUB_LOBJS
)
1227 # Also produce a .fake file that just contains the names of the object files.
1228 # This can be used as a response file to the linker later instead of
1229 # linking the actual static library.
1231 ifndef SUPPRESS_FAKELIB
1232 ifeq (WINNT_
,$(HOST_OS_ARCH
)_
$(.PYMAKE
))
1233 echo
"$(strip $(foreach f,$(OBJS) $(SEPARATE_OBJS) $(LOBJS) $(SUB_LOBJS),$(subst \,\\,$(call core_winabspath,$(f))))) " > $@.fake
1235 echo
"$(strip $(foreach f,$(OBJS) $(SEPARATE_OBJS) $(LOBJS) $(SUB_LOBJS),$(call core_abspath,$(f)))) " > $@.fake
1240 ifeq (,$(filter-out WINNT WINCE
, $(OS_ARCH
)))
1241 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
)
1244 ifeq ($(OS_ARCH
),OS2
)
1245 $(DEF_FILE
): $(OBJS
) $(SHARED_LIBRARY_LIBS
)
1247 echo LIBRARY
$(SHARED_LIBRARY_NAME
) INITINSTANCE TERMINSTANCE
> $@
1249 echo CODE LOADONCALL MOVEABLE DISCARDABLE
>> $@
1250 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED
>> $@
1252 ifeq ($(IS_COMPONENT
),1)
1253 ifeq ($(HAS_EXTRAEXPORTS
),1)
1254 ifndef MOZ_OS2_USE_DECLSPEC
1255 $(FILTER
) $(OBJS
) $(SHARED_LIBRARY_LIBS
) >> $@
1258 echo _NSModule
>> $@
1261 ifndef MOZ_OS2_USE_DECLSPEC
1262 $(FILTER
) $(OBJS
) $(SHARED_LIBRARY_LIBS
) >> $@
1267 ifdef MOZ_OS2_USE_DECLSPEC
1268 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
)
1270 $(IMPORT_LIBRARY
): $(DEF_FILE
)
1277 $(HOST_LIBRARY
): $(HOST_OBJS
) Makefile
1279 $(HOST_AR
) $(HOST_AR_FLAGS
) $(HOST_OBJS
)
1282 ifdef NO_LD_ARCHIVE_FLAGS
1283 SUB_SHLOBJS
= $(SUB_LOBJS
)
1288 ifdef DTRACE_PROBE_OBJ
1289 ifndef DTRACE_LIB_DEPENDENT
1290 $(DTRACE_PROBE_OBJ
): $(OBJS
)
1291 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(OBJS
)
1297 # On Darwin (Mac OS X), dwarf2 debugging uses debug info left in .o files,
1298 # so instead of deleting .o files after repacking them into a dylib, we make
1299 # symlinks back to the originals. The symlinks are a no-op for stabs debugging,
1300 # so no need to conditionalize on OS version or debugging format.
1302 $(SHARED_LIBRARY
): $(OBJS
) $(LOBJS
) $(DEF_FILE
) $(RESFILE
) $(SHARED_LIBRARY_LIBS
) $(LIBRARY
) $(EXTRA_DEPS
) $(DSO_LDOPTS_DEPS
) $(GLOBAL_DEPS
)
1303 ifndef INCREMENTAL_LINKER
1306 ifeq ($(OS_ARCH
),OpenVMS
)
1307 @if
test ! -f
$(VMS_SYMVEC_FILE
); then \
1308 if
test -f
$(VMS_SYMVEC_FILE_MODULE
); then \
1309 echo Creating specific component options file
$(VMS_SYMVEC_FILE
); \
1310 cp
$(VMS_SYMVEC_FILE_MODULE
) $(VMS_SYMVEC_FILE
); \
1314 @if
test ! -f
$(VMS_SYMVEC_FILE
); then \
1315 echo Creating generic component options file
$(VMS_SYMVEC_FILE
); \
1316 cp
$(VMS_SYMVEC_FILE_COMP
) $(VMS_SYMVEC_FILE
); \
1320 ifdef NO_LD_ARCHIVE_FLAGS
1321 ifdef SHARED_LIBRARY_LIBS
1322 @
rm -f
$(SUB_SHLOBJS
)
1323 @for lib in
$(SHARED_LIBRARY_LIBS
); do
$(AR_EXTRACT
) $${lib}; $(CLEANUP2
); done
1324 ifeq ($(OS_ARCH
),Darwin
)
1325 @echo Making symlinks to the original object files in the archive libraries
$(SHARED_LIBRARY_LIBS
)
1326 @for lib in
$(SHARED_LIBRARY_LIBS
); do \
1327 libdir=`echo $$lib|sed -e 's,/[^/]*\.a,,'`; \
1328 ofiles
=`$(AR_LIST) $${lib}`; \
1329 for ofile in
$$ofiles; do \
1330 if
[ -f
$$libdir/$$ofile ]; then \
1332 ln
-s
$$libdir/$$ofile $$ofile; \
1337 endif # SHARED_LIBRARY_LIBS
1338 endif # NO_LD_ARCHIVE_FLAGS
1339 ifdef DTRACE_LIB_DEPENDENT
1340 @
rm -f
$(PROBE_LOBJS
)
1341 @for lib in
$(MOZILLA_PROBE_LIBS
); do
$(AR_EXTRACT
) $${lib}; $(CLEANUP2
); done
1343 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(PROBE_LOBJS
)
1345 @for lib in
$(MOZILLA_PROBE_LIBS
); do \
1346 ofiles
=`$(AR_LIST) $${lib}`; \
1347 $(AR_DELETE
) $${lib} $$ofiles; \
1349 $(MKSHLIB
) $(SHLIB_LDSTARTFILE
) $(OBJS
) $(LOBJS
) $(SUB_SHLOBJS
) $(DTRACE_PROBE_OBJ
) $(PROBE_LOBJS
) $(RESFILE
) $(LDFLAGS
) $(EXTRA_DSO_LDOPTS
) $(call EXPAND_FAKELIBS
,$(OS_LIBS
) $(EXTRA_LIBS
)) $(DEF_FILE
) $(SHLIB_LDENDFILE
)
1350 @
rm -f
$(PROBE_LOBJS
)
1351 @
rm -f
$(DTRACE_PROBE_OBJ
)
1352 @for lib in
$(MOZILLA_PROBE_LIBS
); do \
1353 if
[ -L
$${lib} ]; then
rm -f
`readlink $${lib}`; fi
; \
1355 @
rm -f
$(MOZILLA_PROBE_LIBS
)
1357 else # ! DTRACE_LIB_DEPENDENT
1358 $(MKSHLIB
) $(SHLIB_LDSTARTFILE
) $(OBJS
) $(DTRACE_PROBE_OBJ
) $(LOBJS
) $(SUB_SHLOBJS
) $(RESFILE
) $(LDFLAGS
) $(EXTRA_DSO_LDOPTS
) $(call EXPAND_FAKELIBS
,$(OS_LIBS
) $(EXTRA_LIBS
)) $(DEF_FILE
) $(SHLIB_LDENDFILE
)
1359 endif # DTRACE_LIB_DEPENDENT
1361 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
1362 ifdef MSMANIFEST_TOOL
1363 ifdef EMBED_MANIFEST_AT
1364 @if
test -f
$@.manifest
; then \
1365 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;$(EMBED_MANIFEST_AT
); \
1366 rm -f
$@.manifest
; \
1368 endif # EMBED_MANIFEST_AT
1369 endif # MSVC with manifest tool
1370 ifdef MOZ_PROFILE_GENERATE
1371 touch
-t
`date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
1373 endif # WINNT && !GCC
1374 ifneq ($(OS_ARCH
),Darwin
)
1375 @
rm -f
$(SUB_SHLOBJS
)
1377 @
rm -f foodummyfilefoo
$(DELETE_AFTER_LINK
)
1382 ifdef MOZ_POST_DSO_LIB_COMMAND
1383 $(MOZ_POST_DSO_LIB_COMMAND
) $@
1387 ifdef COMPILER_DEPEND
1388 ifeq ($(SOLARIS_SUNPRO_CC
),1)
1389 _MDDEPFILE
= $(MDDEPDIR
)/$(@F
).pp
1391 define MAKE_DEPS_AUTO_CC
1392 if
test -d
$(@D
); then \
1393 echo
"Building deps for $< using Sun Studio cc"; \
1394 $(CC
) $(COMPILE_CFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
1397 define MAKE_DEPS_AUTO_CXX
1398 if
test -d
$(@D
); then \
1399 echo
"Building deps for $< using Sun Studio CC"; \
1400 $(CXX
) $(COMPILE_CXXFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
1403 endif # Sun Studio on Solaris
1404 else # COMPILER_DEPEND
1406 # Generate dependencies on the fly
1408 _MDDEPFILE
= $(MDDEPDIR
)/$(@F
).pp
1410 define MAKE_DEPS_AUTO
1411 if
test -d
$(@D
); then \
1412 echo
"Building deps for $<"; \
1413 $(MKDEPEND
) -o
'.$(OBJ_SUFFIX)' -f-
$(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $(INCLUDES
) $< 2>/dev
/null | sed
-e
"s|^[^ ]*/||" > $(_MDDEPFILE
) ; \
1417 MAKE_DEPS_AUTO_CC
= $(MAKE_DEPS_AUTO
)
1418 MAKE_DEPS_AUTO_CXX
= $(MAKE_DEPS_AUTO
)
1420 endif # COMPILER_DEPEND
1422 endif # MOZ_AUTO_DEPS
1424 # Rules for building native targets must come first because of the host_ prefix
1425 host_
%.
$(OBJ_SUFFIX
): %.c
$(GLOBAL_DEPS
)
1427 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1429 host_
%.
$(OBJ_SUFFIX
): %.
cpp $(GLOBAL_DEPS
)
1431 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1433 host_
%.
$(OBJ_SUFFIX
): %.
cc $(GLOBAL_DEPS
)
1435 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1437 host_
%.
$(OBJ_SUFFIX
): %.m
$(GLOBAL_DEPS
)
1439 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(HOST_CMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1441 host_
%.
$(OBJ_SUFFIX
): %.mm
$(GLOBAL_DEPS
)
1443 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(HOST_CMMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1445 %:: %.c
$(GLOBAL_DEPS
)
1447 @
$(MAKE_DEPS_AUTO_CC
)
1448 $(ELOG
) $(CC
) $(CFLAGS
) $(LDFLAGS
) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1450 %.
$(OBJ_SUFFIX
): %.c
$(GLOBAL_DEPS
)
1452 @
$(MAKE_DEPS_AUTO_CC
)
1453 $(ELOG
) $(CC
) $(OUTOPTION
)$@
-c
$(COMPILE_CFLAGS
) $(_VPATH_SRCS
)
1455 # DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
1456 # 'moc' only knows about #defines it gets on the command line (-D...), not in
1457 # included headers like mozilla-config.h
1458 moc_
%.
cpp: %.h
$(GLOBAL_DEPS
)
1459 $(MOC
) $(DEFINES
) $(ACDEFINES
) $< $(OUTOPTION
)$@
1461 moc_
%.
cc: %.
cc $(GLOBAL_DEPS
)
1463 $(ELOG
) $(MOC
) $(DEFINES
) $(ACDEFINES
) $(_VPATH_SRCS
:.
cc=.h
) $(OUTOPTION
)$@
1466 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
1468 %.
$(OBJ_SUFFIX
): %.
$(ASM_SUFFIX
) $(GLOBAL_DEPS
)
1469 $(AS
) -o
$@
$(ASFLAGS
) $(AS_DASH_C_FLAG
) $(_VPATH_SRCS
)
1472 %.
$(OBJ_SUFFIX
): %.S
$(GLOBAL_DEPS
)
1473 $(AS
) -o
$@
$(ASFLAGS
) -c
$<
1475 %:: %.
cpp $(GLOBAL_DEPS
)
1476 @
$(MAKE_DEPS_AUTO_CXX
)
1477 $(CCC
) $(OUTOPTION
)$@
$(CXXFLAGS
) $(_VPATH_SRCS
) $(LDFLAGS
)
1480 # Please keep the next two rules in sync.
1482 %.
$(OBJ_SUFFIX
): %.
cc $(GLOBAL_DEPS
)
1484 @
$(MAKE_DEPS_AUTO_CXX
)
1485 $(ELOG
) $(CCC
) $(OUTOPTION
)$@
-c
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1487 %.
$(OBJ_SUFFIX
): %.
cpp $(GLOBAL_DEPS
)
1489 @
$(MAKE_DEPS_AUTO_CXX
)
1490 ifdef STRICT_CPLUSPLUS_SUFFIX
1491 echo
"#line 1 \"$*.cpp\"" | cat
- $*.
cpp > t_
$*.
cc
1492 $(ELOG
) $(CCC
) -o
$@
-c
$(COMPILE_CXXFLAGS
) t_
$*.
cc
1495 $(ELOG
) $(CCC
) $(OUTOPTION
)$@
-c
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1496 endif #STRICT_CPLUSPLUS_SUFFIX
1498 $(OBJ_PREFIX
)%.
$(OBJ_SUFFIX
): %.mm
$(GLOBAL_DEPS
)
1500 @
$(MAKE_DEPS_AUTO_CXX
)
1501 $(ELOG
) $(CCC
) -o
$@
-c
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(_VPATH_SRCS
)
1503 $(OBJ_PREFIX
)%.
$(OBJ_SUFFIX
): %.m
$(GLOBAL_DEPS
)
1505 @
$(MAKE_DEPS_AUTO_CC
)
1506 $(ELOG
) $(CC
) -o
$@
-c
$(COMPILE_CFLAGS
) $(COMPILE_CMFLAGS
) $(_VPATH_SRCS
)
1509 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1512 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1515 $(CC
) -S
$(COMPILE_CFLAGS
) $(_VPATH_SRCS
)
1518 $(CCC
) -C
-E
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
) > $*.i
1521 $(CCC
) -C
-E
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
) > $*.i
1524 $(CC
) -C
-E
$(COMPILE_CFLAGS
) $(_VPATH_SRCS
) > $*.i
1527 $(CCC
) -C
-E
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(_VPATH_SRCS
) > $*.i
1530 @echo Creating Resource file
: $@
1531 ifeq ($(OS_ARCH
),OS2
)
1532 $(RC
) $(RCFLAGS
:-D
%=-d
%) -i
$(subst /,\
,$(srcdir)) -r
$< $@
1535 $(RC
) $(RCFLAGS
) $(filter-out -U
%,$(DEFINES
)) $(INCLUDES
:-I
%=--include-dir
%) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1537 $(RC
) $(RCFLAGS
) -r
$(DEFINES
) $(INCLUDES
) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1541 # need 3 separate lines for OS/2
1548 rm -f
$@
; cp
$< $@
; chmod
+x
$@
1550 # Cancel these implicit rules
1560 ###############################################################################
1562 ###############################################################################
1563 ifneq (,$(filter OS2 WINNT WINCE
,$(OS_ARCH
)))
1570 SPACE
:= $(EMPTY
) $(EMPTY
)
1572 # Cygwin and MSYS have their own special path form, but javac expects the source
1573 # and class paths to be in the DOS form (i.e. e:/builds/...). This function
1574 # does the appropriate conversion on Windows, but is a noop on other systems.
1575 ifeq (,$(filter-out WINNT WINCE
, $(HOST_OS_ARCH
)))
1576 ifdef CYGWIN_WRAPPER
1577 normalizepath
= $(foreach p
,$(1),$(shell cygpath
-m
$(p
)))
1580 # We use 'pwd -W' to get DOS form of the path. However, since the given path
1581 # could be a file or a nonexistent path, we cannot call 'pwd -W' directly
1582 # on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
1583 # on it, then merge with the rest of the path.
1584 root-path
= $(shell echo
$(1) | sed
-e
"s|\(/[^/]*\)/\?\(.*\)|\1|")
1585 non-root-path
= $(shell echo
$(1) | sed
-e
"s|\(/[^/]*\)/\?\(.*\)|\2|")
1586 normalizepath
= $(foreach p
,$(1),$(if
$(filter /%,$(1)),$(patsubst %/,%,$(shell cd
$(call root-path
,$(1)) && pwd
-W
))/$(call non-root-path
,$(1)),$(1)))
1589 normalizepath
= $(1)
1592 _srcdir
= $(call normalizepath
,$(srcdir))
1593 ifdef JAVA_SOURCEPATH
1594 SP
= $(subst $(SPACE
),$(SEP
),$(call normalizepath
,$(strip $(JAVA_SOURCEPATH
))))
1595 _JAVA_SOURCEPATH
= ".$(SEP)$(_srcdir)$(SEP)$(SP)"
1597 _JAVA_SOURCEPATH
= ".$(SEP)$(_srcdir)"
1600 ifdef JAVA_CLASSPATH
1601 CP
= $(subst $(SPACE
),$(SEP
),$(call normalizepath
,$(strip $(JAVA_CLASSPATH
))))
1602 _JAVA_CLASSPATH
= ".$(SEP)$(CP)"
1611 $(_JAVA_DIR
)/%.class
: %.java
$(GLOBAL_DEPS
) $(_JAVA_DIR
)
1612 $(CYGWIN_WRAPPER
) $(JAVAC
) $(JAVAC_FLAGS
) -classpath
$(_JAVA_CLASSPATH
) \
1613 -sourcepath
$(_JAVA_SOURCEPATH
) -d
$(_JAVA_DIR
) $(_VPATH_SRCS
)
1615 $(JAVA_LIBRARY
): $(addprefix $(_JAVA_DIR
)/,$(JAVA_SRCS
:.java
=.class
)) $(GLOBAL_DEPS
)
1616 $(JAR
) cf
$@
-C
$(_JAVA_DIR
) .
1618 GARBAGE_DIRS
+= $(_JAVA_DIR
)
1620 ###############################################################################
1622 ###############################################################################
1624 # In GNU make 3.80, makefiles must use the /cygdrive syntax, even if we're
1625 # processing them with AS perl. See bug 232003
1627 CYGWIN_TOPSRCDIR
= -nowrap
-p
$(topsrcdir
) -wrap
1630 # Note: Passing depth to make-makefile is optional.
1631 # It saves the script some work, though.
1632 Makefile
: Makefile.in
1633 @
$(PERL
) $(AUTOCONF_TOOLS
)/make-makefile
-t
$(topsrcdir
) -d
$(DEPTH
) $(CYGWIN_TOPSRCDIR
)
1636 # VPATH does not work on some machines in this case, so add $(srcdir)
1637 $(SUBMAKEFILES
): % : $(srcdir)/%.in
1638 $(PERL
) $(AUTOCONF_TOOLS
)/make-makefile
-t
$(topsrcdir
) -d
$(DEPTH
) $(CYGWIN_TOPSRCDIR
) $@
1641 ifdef AUTOUPDATE_CONFIGURE
1642 $(topsrcdir
)/configure
: $(topsrcdir
)/configure.in
1643 (cd
$(topsrcdir
) && $(AUTOCONF
)) && (cd
$(DEPTH
) && .
/config.status
--recheck
)
1646 ###############################################################################
1647 # Bunch of things that extend the 'export' rule (in order):
1648 ###############################################################################
1650 ################################################################################
1651 # Copy each element of EXPORTS to $(DIST)/include
1654 ifneq ($(XPIDLSRCS
),)
1660 ifneq ($(XPI_NAME
),)
1664 export:: $(FINAL_TARGET
)
1667 ifndef NO_DIST_INSTALL
1670 $(INSTALL
) $(IFLAGS1
) $^
$(DIST
)/include
1672 endif # NO_DIST_INSTALL
1674 define EXPORT_NAMESPACE_RULE
1675 ifndef NO_DIST_INSTALL
1676 export:: $(EXPORTS_
$(namespace
))
1677 $(INSTALL
) $(IFLAGS1
) $$^
$(DIST
)/include/$(namespace
)
1678 endif # NO_DIST_INSTALL
1681 $(foreach namespace
,$(EXPORTS_NAMESPACES
),$(eval
$(EXPORT_NAMESPACE_RULE
)))
1683 ################################################################################
1684 # Copy each element of PREF_JS_EXPORTS
1689 ifneq (,$(XPI_NAME
)$(LIBXUL_SDK
))
1690 PREF_DIR
= defaults
/preferences
1692 PREF_DIR
= defaults
/pref
1696 ifneq ($(PREF_JS_EXPORTS
),)
1697 # on win32, pref files need CRLF line endings... see bug 206029
1698 ifeq (WINNT
,$(OS_ARCH
))
1699 PREF_PPFLAGS
= --line-endings
=crlf
1702 ifndef NO_DIST_INSTALL
1703 $(FINAL_TARGET
)/$(PREF_DIR
):
1706 libs
:: $(FINAL_TARGET
)/$(PREF_DIR
) $(PREF_JS_EXPORTS
)
1708 for i in
$(PREF_JS_EXPORTS
); do \
1709 dest
=$(FINAL_TARGET
)/$(PREF_DIR
)/`basename $$i`; \
1711 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$(PREF_PPFLAGS
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $$i > $$dest; \
1716 ################################################################################
1717 # Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
1719 ifneq ($(AUTOCFG_JS_EXPORTS
),)
1720 $(FINAL_TARGET
)/defaults
/autoconfig
::
1723 ifndef NO_DIST_INSTALL
1724 export:: $(AUTOCFG_JS_EXPORTS
) $(FINAL_TARGET
)/defaults
/autoconfig
1725 $(INSTALL
) $(IFLAGS1
) $^
1729 ################################################################################
1730 # Export the elements of $(XPIDLSRCS)
1731 # generating .h and .xpt files and moving them to the appropriate places.
1733 ifneq ($(XPIDLSRCS
),)
1735 export:: $(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.h
, $(XPIDLSRCS
))
1738 XPIDL_MODULE
= $(MODULE
)
1741 ifeq ($(XPIDL_MODULE
),) # we need $(XPIDL_MODULE) to make $(XPIDL_MODULE).xpt
1744 @echo
"*** Error processing XPIDLSRCS:"
1745 @echo
"Please define MODULE or XPIDL_MODULE when defining XPIDLSRCS,"
1746 @echo
"so we have a module name to use when creating MODULE.xpt."
1747 @echo
; sleep
2; false
1753 # generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
1754 # warn against overriding existing .h file.
1755 $(XPIDL_GEN_DIR
)/.done
:
1756 @if
test ! -d
$(XPIDL_GEN_DIR
); then echo Creating
$(XPIDL_GEN_DIR
)/.done
; rm -rf
$(XPIDL_GEN_DIR
); mkdir
$(XPIDL_GEN_DIR
); fi
1759 # don't depend on $(XPIDL_GEN_DIR), because the modification date changes
1760 # with any addition to the directory, regenerating all .h files -> everything.
1762 $(XPIDL_GEN_DIR
)/%.h
: %.idl
$(XPIDL_COMPILE
) $(XPIDL_GEN_DIR
)/.done
1764 $(ELOG
) $(XPIDL_COMPILE
) -m header
-w
$(XPIDL_FLAGS
) -o
$(XPIDL_GEN_DIR
)/$* $(_VPATH_SRCS
)
1765 @if
test -n
"$(findstring $*.h, $(EXPORTS))"; \
1766 then echo
"*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true
; fi
1769 # generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
1770 # into $(XPIDL_MODULE).xpt and export it to $(FINAL_TARGET)/components.
1771 $(XPIDL_GEN_DIR
)/%.xpt
: %.idl
$(XPIDL_COMPILE
) $(XPIDL_GEN_DIR
)/.done
1773 $(ELOG
) $(XPIDL_COMPILE
) -m typelib
-w
$(XPIDL_FLAGS
) -e
$@
-d
$(MDDEPDIR
)/$*.pp
$(_VPATH_SRCS
)
1775 # no need to link together if XPIDLSRCS contains only XPIDL_MODULE
1776 ifneq ($(XPIDL_MODULE
).idl
,$(strip $(XPIDLSRCS
)))
1777 $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
: $(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.xpt
,$(XPIDLSRCS
)) $(GLOBAL_DEPS
) $(XPIDL_LINK
)
1778 $(XPIDL_LINK
) $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
$(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.xpt
,$(XPIDLSRCS
))
1779 endif # XPIDL_MODULE.xpt != XPIDLSRCS
1781 libs
:: $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
1782 ifndef NO_DIST_INSTALL
1783 $(INSTALL
) $(IFLAGS1
) $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
$(FINAL_TARGET
)/components
1784 ifndef NO_INTERFACES_MANIFEST
1785 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/components
/interfaces.manifest
"interfaces $(XPIDL_MODULE).xpt"
1786 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/chrome.manifest
"manifest components/interfaces.manifest"
1792 GARBAGE_DIRS
+= $(XPIDL_GEN_DIR
)
1796 ifneq ($(XPIDLSRCS
),)
1797 # export .idl files to $(IDL_DIR)
1798 ifndef NO_DIST_INSTALL
1799 export:: $(XPIDLSRCS
) $(IDL_DIR
)
1800 $(INSTALL
) $(IFLAGS1
) $^
1802 export:: $(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.h
, $(XPIDLSRCS
)) $(DIST
)/include
1803 $(INSTALL
) $(IFLAGS1
) $^
1804 endif # NO_DIST_INSTALL
1811 # General rules for exporting idl files.
1813 # WORK-AROUND ONLY, for mozilla/tools/module-deps/bootstrap.pl build.
1814 # Bug to fix idl dependency problems w/o this extra build pass is
1815 # http://bugzilla.mozilla.org/show_bug.cgi?id=145777
1820 export-idl
:: $(SUBMAKEFILES
) $(MAKE_DIRS
)
1822 ifneq ($(XPIDLSRCS
),)
1823 ifndef NO_DIST_INSTALL
1824 export-idl
:: $(XPIDLSRCS
) $(IDL_DIR
)
1825 $(INSTALL
) $(IFLAGS1
) $^
1828 $(LOOP_OVER_PARALLEL_DIRS
)
1830 $(LOOP_OVER_TOOL_DIRS
)
1833 ifneq ($(XPIDLSRCS
),)
1835 JAVA_XPIDLSRCS
= $(XPIDLSRCS
)
1837 # A single IDL file can contain multiple interfaces, which result in multiple
1838 # Java interface files. So use hidden dependency files.
1839 JAVADEPFILES
= $(addprefix $(JAVA_GEN_DIR
)/.
,$(JAVA_XPIDLSRCS
:.idl
=.java.pp
))
1843 GARBAGE_DIRS
+= $(JAVA_GEN_DIR
)
1845 # generate .java files into _javagen/[package name dirs]
1846 _JAVA_GEN_DIR
= $(JAVA_GEN_DIR
)/$(JAVA_IFACES_PKG_NAME
)
1850 $(JAVA_GEN_DIR
)/.
%.java.pp
: %.idl
$(XPIDL_COMPILE
) $(_JAVA_GEN_DIR
)
1852 $(ELOG
) $(XPIDL_COMPILE
) -m java
-w
$(XPIDL_FLAGS
) -I
$(srcdir) -I
$(IDL_DIR
) -o
$(_JAVA_GEN_DIR
)/$* $(_VPATH_SRCS
)
1855 # "Install" generated Java interfaces. We segregate them based on the XPI_NAME.
1856 # If XPI_NAME is not set, install into the "default" directory.
1857 ifneq ($(XPI_NAME
),)
1858 JAVA_INSTALL_DIR
= $(JAVA_DIST_DIR
)/$(XPI_NAME
)
1860 JAVA_INSTALL_DIR
= $(JAVA_DIST_DIR
)/default
1863 $(JAVA_INSTALL_DIR
):
1866 export:: $(JAVA_DIST_DIR
) $(JAVADEPFILES
) $(JAVA_INSTALL_DIR
)
1867 (cd
$(JAVA_GEN_DIR
) && tar $(TAR_CREATE_FLAGS
) - .
) |
(cd
$(JAVA_INSTALL_DIR
) && tar -xf
-)
1870 endif # MOZ_JAVAXPCOM
1872 ################################################################################
1873 # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
1874 ifneq (,$(filter %.js
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1875 ifeq (,$(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1876 ifndef NO_JS_MANIFEST
1877 $(error .js component without matching .manifest
)
1882 ifdef EXTRA_COMPONENTS
1883 libs
:: $(EXTRA_COMPONENTS
)
1884 ifndef NO_DIST_INSTALL
1885 $(INSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/components
1890 ifdef EXTRA_PP_COMPONENTS
1891 libs
:: $(EXTRA_PP_COMPONENTS
)
1892 ifndef NO_DIST_INSTALL
1894 $(NSINSTALL
) -D
$(FINAL_TARGET
)/components
; \
1896 fname
=`basename $$i`; \
1897 dest
=$(FINAL_TARGET
)/components
/$${fname}; \
1899 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $$i > $$dest; \
1904 EXTRA_MANIFESTS
= $(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
))
1905 ifneq (,$(EXTRA_MANIFESTS
))
1907 $(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/chrome.manifest
$(patsubst %,"manifest components/%",$(notdir $(EXTRA_MANIFESTS
)))
1910 ################################################################################
1911 # Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
1912 ifdef EXTRA_JS_MODULES
1913 libs
:: $(EXTRA_JS_MODULES
)
1914 ifndef NO_DIST_INSTALL
1915 $(INSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/modules
1920 ifdef EXTRA_PP_JS_MODULES
1921 libs
:: $(EXTRA_PP_JS_MODULES
)
1922 ifndef NO_DIST_INSTALL
1924 $(NSINSTALL
) -D
$(FINAL_TARGET
)/modules
; \
1926 dest
=$(FINAL_TARGET
)/modules
/`basename $$i`; \
1928 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $$i > $$dest; \
1934 ################################################################################
1937 ifneq (,$(SDK_LIBRARY
))
1941 ifndef NO_DIST_INSTALL
1942 libs
:: $(SDK_LIBRARY
) $(SDK_LIB_DIR
)
1943 $(INSTALL
) $(IFLAGS2
) $^
1948 ifneq (,$(SDK_BINARY
))
1952 ifndef NO_DIST_INSTALL
1953 libs
:: $(SDK_BINARY
) $(SDK_BIN_DIR
)
1954 $(INSTALL
) $(IFLAGS2
) $^
1959 ################################################################################
1962 JAR_MANIFEST
:= $(srcdir)/jar.mn
1966 $(LOOP_OVER_PARALLEL_DIRS
)
1968 $(LOOP_OVER_TOOL_DIRS
)
1970 $(FINAL_TARGET
)/chrome
:
1973 libs realchrome
:: $(CHROME_DEPS
) $(FINAL_TARGET
)/chrome
1974 ifneq (,$(wildcard $(JAR_MANIFEST
)))
1975 ifndef NO_DIST_INSTALL
1976 $(PYTHON
) $(MOZILLA_DIR
)/config
/JarMaker.py \
1977 $(QUIET
) -j
$(FINAL_TARGET
)/chrome \
1978 $(MAKE_JARS_FLAGS
) $(XULPPFLAGS
) $(DEFINES
) $(ACDEFINES
) \
1983 ifneq ($(DIST_FILES
),)
1987 libs
:: $(DIST_FILES
) $(DIST
)/bin
1989 for f in
$(DIST_FILES
); do \
1990 dest
=$(FINAL_TARGET
)/`basename $$f`; \
1992 $(PYTHON
) $(MOZILLA_DIR
)/config
/Preprocessor.py \
1993 $(XULAPP_DEFINES
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) \
1994 $(srcdir)/$$f > $$dest; \
1998 ifneq ($(DIST_CHROME_FILES
),)
1999 libs
:: $(DIST_CHROME_FILES
)
2001 for f in
$(DIST_CHROME_FILES
); do \
2002 dest
=$(FINAL_TARGET
)/chrome
/`basename $$f`; \
2004 $(PYTHON
) $(MOZILLA_DIR
)/config
/Preprocessor.py \
2005 $(XULAPP_DEFINES
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) \
2006 $(srcdir)/$$f > $$dest; \
2010 ifneq ($(XPI_PKGNAME
),)
2014 @echo
"Stripping $(XPI_PKGNAME) package directory..."
2015 @echo
$(FINAL_TARGET
)
2016 @cd
$(FINAL_TARGET
) && find .
! -type d \
2026 ! -name
"*.properties" \
2037 $(PLATFORM_EXCLUDE_LIST
) \
2038 -exec
$(STRIP
) $(STRIP_FLAGS
) {} >/dev
/null
2>&1 \
;
2041 @echo
"Packaging $(XPI_PKGNAME).xpi..."
2042 cd
$(FINAL_TARGET
) && $(ZIP
) -qr ..
/$(XPI_PKGNAME
).xpi
*
2045 ifdef INSTALL_EXTENSION_ID
2047 $(error XPI_NAME must be set for INSTALL_EXTENSION_ID
)
2051 $(RM
) -rf
"$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)"
2052 $(NSINSTALL
) -D
"$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)"
2053 cd
$(FINAL_TARGET
) && tar $(TAR_CREATE_FLAGS
) - . |
(cd
"../../bin/extensions/$(INSTALL_EXTENSION_ID)" && tar -xf
-)
2057 ifneq (,$(filter flat symlink
,$(MOZ_CHROME_FILE_FORMAT
)))
2058 _JAR_REGCHROME_DISABLE_JAR
=1
2060 _JAR_REGCHROME_DISABLE_JAR
=0
2063 REGCHROME
= $(PERL
) -I
$(MOZILLA_DIR
)/config
$(MOZILLA_DIR
)/config
/add-chrome.pl \
2064 $(if
$(filter gtk2
,$(MOZ_WIDGET_TOOLKIT
)),-x
) \
2065 $(if
$(CROSS_COMPILE
),-o
$(OS_ARCH
)) $(FINAL_TARGET
)/chrome
/installed-chrome.txt \
2066 $(_JAR_REGCHROME_DISABLE_JAR
)
2068 REGCHROME_INSTALL
= $(PERL
) -I
$(MOZILLA_DIR
)/config
$(MOZILLA_DIR
)/config
/add-chrome.pl \
2069 $(if
$(filter gtk2
,$(MOZ_WIDGET_TOOLKIT
)),-x
) \
2070 $(if
$(CROSS_COMPILE
),-o
$(OS_ARCH
)) $(DESTDIR
)$(mozappdir
)/chrome
/installed-chrome.txt \
2071 $(_JAR_REGCHROME_DISABLE_JAR
)
2074 #############################################################################
2076 #############################################################################
2077 ifdef COMPILER_DEPEND
2079 @echo
"$(MAKE): No need to run depend target.\
2080 Using compiler-based depend." 1>&2
2081 ifeq ($(GNU_CC
)$(GNU_CXX
),)
2083 @echo
"`echo '$(MAKE):'|sed 's/./ /g'`"\
2084 '(Compiler-based depend was turned on by "--enable-md".)' 1>&2
2087 @space
="`echo '$(MAKE): '|sed 's/./ /g'`";\
2088 echo
"$$space"'Since you are using a GNU compiler,\
2089 it is on by default.' 1>&2; \
2090 echo
"$$space"'To turn it off, pass --disable-md to configure.' 1>&2
2093 else # ! COMPILER_DEPEND
2095 ifndef MOZ_AUTO_DEPS
2097 define MAKE_DEPS_NOAUTO
2098 $(MKDEPEND
) -w1024
-o
'.$(OBJ_SUFFIX)' -f-
$(DEFINES
) $(ACDEFINES
) $(INCLUDES
) $< 2>/dev
/null | sed
-e
"s|^[^ ]*/||" > $@
2101 $(MDDEPDIR
)/%.pp
: %.c
2103 @
$(MAKE_DEPS_NOAUTO
)
2105 $(MDDEPDIR
)/%.pp
: %.
cpp
2107 @
$(MAKE_DEPS_NOAUTO
)
2109 $(MDDEPDIR
)/%.pp
: %.s
2111 @
$(MAKE_DEPS_NOAUTO
)
2113 ifneq (,$(OBJS
)$(XPIDLSRCS
)$(SIMPLE_PROGRAMS
))
2114 depend
:: $(SUBMAKEFILES
) $(MAKE_DIRS
) $(MDDEPFILES
)
2116 depend
:: $(SUBMAKEFILES
)
2118 $(LOOP_OVER_PARALLEL_DIRS
)
2120 $(LOOP_OVER_TOOL_DIRS
)
2122 dependclean
:: $(SUBMAKEFILES
)
2124 $(LOOP_OVER_PARALLEL_DIRS
)
2126 $(LOOP_OVER_TOOL_DIRS
)
2128 endif # MOZ_AUTO_DEPS
2130 endif # COMPILER_DEPEND
2133 #############################################################################
2134 # MDDEPDIR is the subdirectory where all the dependency files are placed.
2135 # This uses a make rule (instead of a macro) to support parallel
2136 # builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
2137 # processes could simultaneously try to create the same directory.
2139 # We use $(CURDIR) in the rule's target to ensure that we don't find
2140 # a dependency directory in the source tree via VPATH (perhaps from
2141 # a previous build in the source tree) and thus neglect to create a
2142 # dependency directory in the object directory, where we really need
2145 $(CURDIR
)/$(MDDEPDIR
):
2146 @if
test ! -d
$@
; then echo Creating
$@
; rm -rf
$@
; mkdir
$@
; else true
; fi
2148 ifneq (,$(filter-out all chrome default
export realchrome tools
clean clobber clobber_all
distclean realclean,$(MAKECMDGOALS
)))
2149 ifneq (,$(OBJS
)$(XPIDLSRCS
)$(SIMPLE_PROGRAMS
))
2150 MDDEPEND_FILES
:= $(strip $(wildcard $(MDDEPDIR
)/*.pp
))
2152 ifneq (,$(MDDEPEND_FILES
))
2153 # The script mddepend.pl checks the dependencies and writes to stdout
2154 # one rule to force out-of-date objects. For example,
2155 # foo.o boo.o: FORCE
2156 # The script has an advantage over including the *.pp files directly
2157 # because it handles the case when header files are removed from the build.
2158 # 'make' would complain that there is no way to build missing headers.
2159 ALL_PP_RESULTS
= $(shell $(PERL
) $(BUILD_TOOLS
)/mddepend.pl
- $(MDDEPEND_FILES
))
2160 $(eval
$(ALL_PP_RESULTS
))
2165 #############################################################################
2167 -include $(topsrcdir
)/$(MOZ_BUILD_APP
)/app-rules.mk
2168 -include $(MY_RULES
)
2171 # Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
2175 ifneq ($(CSRCS
)$(CPPSRCS
)$(HEADERS
),)
2177 TAGS
:: $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
2178 $(ETAGS
) $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
2182 ################################################################################
2183 # Special gmake rules.
2184 ################################################################################
2188 # Disallow parallel builds with MSVC < 8
2190 ifneq (,$(filter 1200 1300 1310,$(_MSC_VER
)))
2195 # Re-define the list of default suffixes, so gmake won't have to churn through
2196 # hundreds of built-in suffix rules for stuff we don't need.
2201 # Fake targets. Always run these rules, even if a file/directory with that
2202 # name already exists.
2204 .PHONY
: all alltags boot checkout chrome realchrome
clean clobber clobber_all
export install libs makefiles
realclean run_apprunner tools
$(DIRS
) $(TOOL_DIRS
) FORCE
2206 # Used as a dependency to force targets to rebuild
2209 # Delete target if error occurs when building target
2212 # Properly set LIBPATTERNS for the platform
2213 .LIBPATTERNS
= $(if
$(IMPORT_LIB_SUFFIX
),$(LIB_PREFIX
)%.
$(IMPORT_LIB_SUFFIX
)) $(LIB_PREFIX
)%.
$(LIB_SUFFIX
) $(DLL_PREFIX
)%$(DLL_SUFFIX
)
2217 TAGS
: $(SUBMAKEFILES
) $(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
2218 -etags
$(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
2219 $(LOOP_OVER_PARALLEL_DIRS
)
2229 @
$(foreach tier
,$(TIERS
),echo
'$(tier):'; echo
' dirs: $(tier_$(tier)_dirs)'; echo
' staticdirs: $(tier_$(tier)_staticdirs)'; )
2241 @
$(topsrcdir
)/build
/unix
/print-depth-path.sh
2244 @
$(topsrcdir
)/build
/package
/rpm
/print-module-name.sh
2246 echo-module-filelist
:
2247 @
$(topsrcdir
)/build
/package
/rpm
/print-module-filelist.sh
2250 ifneq (,$(filter $(PROGRAM
) $(HOST_PROGRAM
) $(SIMPLE_PROGRAMS
) $(HOST_LIBRARY
) $(LIBRARY
) $(SHARED_LIBRARY
),$(TARGETS
)))
2251 @echo
--------------------------------------------------------------------------------
2252 @echo
"PROGRAM = $(PROGRAM)"
2253 @echo
"SIMPLE_PROGRAMS = $(SIMPLE_PROGRAMS)"
2254 @echo
"LIBRARY = $(LIBRARY)"
2255 @echo
"SHARED_LIBRARY = $(SHARED_LIBRARY)"
2256 @echo
"SHARED_LIBRARY_LIBS = $(SHARED_LIBRARY_LIBS)"
2257 @echo
"LIBS = $(LIBS)"
2258 @echo
"DEF_FILE = $(DEF_FILE)"
2259 @echo
"IMPORT_LIBRARY = $(IMPORT_LIBRARY)"
2260 @echo
"STATIC_LIBS = $(STATIC_LIBS)"
2261 @echo
"SHARED_LIBS = $(SHARED_LIBS)"
2262 @echo
"EXTRA_DSO_LIBS = $(EXTRA_DSO_LIBS)"
2263 @echo
"EXTRA_DSO_LDOPTS = $(EXTRA_DSO_LDOPTS)"
2264 @echo
"DEPENDENT_LIBS = $(DEPENDENT_LIBS)"
2265 @echo
--------------------------------------------------------------------------------
2267 $(LOOP_OVER_PARALLEL_DIRS
)
2271 @echo
"MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)"
2272 @echo
"MOZ_WIDGET_TOOLKIT = $(MOZ_WIDGET_TOOLKIT)"
2274 @echo
"CXX = $(CXX)"
2275 @echo
"CCC = $(CCC)"
2276 @echo
"CPP = $(CPP)"
2279 @echo
"IMPLIB = $(IMPLIB)"
2280 @echo
"FILTER = $(FILTER)"
2281 @echo
"MKSHLIB = $(MKSHLIB)"
2282 @echo
"MKCSHLIB = $(MKCSHLIB)"
2284 @echo
"CFLAGS = $(CFLAGS)"
2285 @echo
"OS_CFLAGS = $(OS_CFLAGS)"
2286 @echo
"COMPILE_CFLAGS = $(COMPILE_CFLAGS)"
2287 @echo
"CXXFLAGS = $(CXXFLAGS)"
2288 @echo
"OS_CXXFLAGS = $(OS_CXXFLAGS)"
2289 @echo
"COMPILE_CXXFLAGS = $(COMPILE_CXXFLAGS)"
2290 @echo
"COMPILE_CMFLAGS = $(COMPILE_CMFLAGS)"
2291 @echo
"COMPILE_CMMFLAGS = $(COMPILE_CMMFLAGS)"
2292 @echo
"LDFLAGS = $(LDFLAGS)"
2293 @echo
"OS_LDFLAGS = $(OS_LDFLAGS)"
2294 @echo
"DSO_LDOPTS = $(DSO_LDOPTS)"
2295 @echo
"OS_INCLUDES = $(OS_INCLUDES)"
2296 @echo
"OS_LIBS = $(OS_LIBS)"
2297 @echo
"EXTRA_LIBS = $(EXTRA_LIBS)"
2298 @echo
"BIN_FLAGS = $(BIN_FLAGS)"
2299 @echo
"INCLUDES = $(INCLUDES)"
2300 @echo
"DEFINES = $(DEFINES)"
2301 @echo
"ACDEFINES = $(ACDEFINES)"
2302 @echo
"BIN_SUFFIX = $(BIN_SUFFIX)"
2303 @echo
"LIB_SUFFIX = $(LIB_SUFFIX)"
2304 @echo
"DLL_SUFFIX = $(DLL_SUFFIX)"
2305 @echo
"IMPORT_LIB_SUFFIX = $(IMPORT_LIB_SUFFIX)"
2306 @echo
"INSTALL = $(INSTALL)"
2309 @echo
"HOST_CC = $(HOST_CC)"
2310 @echo
"HOST_CXX = $(HOST_CXX)"
2311 @echo
"HOST_CFLAGS = $(HOST_CFLAGS)"
2312 @echo
"HOST_LDFLAGS = $(HOST_LDFLAGS)"
2313 @echo
"HOST_LIBS = $(HOST_LIBS)"
2314 @echo
"HOST_EXTRA_LIBS = $(HOST_EXTRA_LIBS)"
2315 @echo
"HOST_EXTRA_DEPS = $(HOST_EXTRA_DEPS)"
2316 @echo
"HOST_PROGRAM = $(HOST_PROGRAM)"
2317 @echo
"HOST_OBJS = $(HOST_OBJS)"
2318 @echo
"HOST_PROGOBJS = $(HOST_PROGOBJS)"
2319 @echo
"HOST_LIBRARY = $(HOST_LIBRARY)"
2322 @echo
"Build Modules = $(BUILD_MODULES)"
2323 @echo
"Module dirs = $(BUILD_MODULE_DIRS)"
2327 $(DOXYGEN
) $(DEPTH
)/config
/doxygen.cfg
2330 check:: $(SUBMAKEFILES
) $(MAKE_DIRS
)
2331 $(LOOP_OVER_PARALLEL_DIRS
)
2333 $(LOOP_OVER_TOOL_DIRS
)
2337 FREEZE_VARIABLES
= \
2349 EXTRA_PP_COMPONENTS \
2352 $(foreach var
,$(FREEZE_VARIABLES
),$(eval
$(var
)_FROZEN
:= '$($(var))'))
2354 CHECK_FROZEN_VARIABLES
= $(foreach var
,$(FREEZE_VARIABLES
), \
2355 $(if
$(subst $($(var
)_FROZEN
),,'$($(var))'),$(error Makefile variable
'$(var)' changed value after including rules.mk. Was
$($(var
)_FROZEN
), now
$($(var
)).
)))
2358 $(CHECK_FROZEN_VARIABLES
)
2361 if
test -d
$(DIST
)/bin
; then touch
$(DIST
)/bin
/.purgecaches
; fi