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
, $(filter-out --%, $(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 ################################################################################
147 testxpcobjdir
= $(DEPTH
)/_tests
/xpcshell
152 ifndef relativesrcdir
153 $(error Must
define relativesrcdir when defining XPCSHELL_TESTS.
)
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
) -ljs_static
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
),)
559 ifneq ($(HOST_CPPSRCS
)$(HOST_CMMSRCS
),)
560 HOST_CPP_PROG_LINK
= 1
564 # Make sure to wrap static libs inside linker specific flags to turn on & off
565 # inclusion of all symbols inside the static libs
567 ifndef NO_LD_ARCHIVE_FLAGS
568 ifdef SHARED_LIBRARY_LIBS
569 EXTRA_DSO_LDOPTS
:= $(MKSHLIB_FORCE_ALL
) $(call EXPAND_FAKELIBS
,$(SHARED_LIBRARY_LIBS
)) $(MKSHLIB_UNFORCE_ALL
) $(EXTRA_DSO_LDOPTS
)
574 # This will strip out symbols that the component should not be
575 # exporting from the .dynsym section.
578 EXTRA_DSO_LDOPTS
+= $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
)
582 # Enforce the requirement that MODULE_NAME must be set
583 # for components in static builds
587 ifndef FORCE_SHARED_LIB
589 $(error MODULE_NAME is required for components which may be used in static builds
)
596 # MacOS X specific stuff
599 ifeq ($(OS_ARCH
),Darwin
)
602 EXTRA_DSO_LDOPTS
+= -bundle
604 EXTRA_DSO_LDOPTS
+= -dynamiclib
-install_name @executable_path
/$(SHARED_LIBRARY
) -compatibility_version
1 -current_version
1 -single_module
610 # On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be
611 # fatal symbol name clashes between components.
613 ifeq ($(OS_ARCH
),NetBSD
)
614 ifeq ($(DLL_SUFFIX
),.so
.1.0)
616 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
621 ifeq ($(OS_ARCH
),FreeBSD
)
623 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
627 ifeq ($(OS_ARCH
),NetBSD
)
628 ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips
,$(OS_TEST
)))
629 ifeq ($(MODULE
),layout
)
630 OS_CFLAGS
+= -Wa
,-xgot
631 OS_CXXFLAGS
+= -Wa
,-xgot
637 # HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
638 # which uses internal symbols first
640 ifeq ($(OS_ARCH
),HP-UX
)
642 ifeq ($(GNU_CC
)$(GNU_CXX
),)
643 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
644 ifneq ($(HAS_EXTRAEXPORTS
),1)
645 MKSHLIB
+= -Wl
,+eNSGetModule
-Wl
,+eerrno
646 MKCSHLIB
+= +eNSGetModule
+eerrno
647 ifneq ($(OS_TEST
),ia64
)
648 MKSHLIB
+= -Wl
,+e_shlInit
649 MKCSHLIB
+= +e_shlInit
651 endif # !HAS_EXTRAEXPORTS
652 endif # non-gnu compilers
656 ifeq ($(OS_ARCH
),AIX
)
658 ifneq ($(HAS_EXTRAEXPORTS
),1)
659 MKSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
660 MKCSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
661 endif # HAS_EXTRAEXPORTS
666 # OSF1: add -B symbolic flag for components
668 ifeq ($(OS_ARCH
),OSF1
)
670 ifeq ($(GNU_CC
)$(GNU_CXX
),)
671 EXTRA_DSO_LDOPTS
+= -B symbolic
677 # Linux: add -Bsymbolic flag for components
679 ifeq ($(OS_ARCH
),Linux
)
681 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
686 # GNU doesn't have path length limitation
689 ifeq ($(OS_ARCH
),GNU
)
690 OS_CPPFLAGS
+= -DPATH_MAX
=1024 -DMAXPATHLEN
=1024
696 ifeq ($(OS_ARCH
),WINNT
)
699 DSO_LDOPTS
+= -Wl
,--out-implib
-Wl
,$(IMPORT_LIBRARY
)
712 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
716 endif # WINNT && !GNU_CC
717 ifneq (,$(filter WINCE
,$(OS_ARCH
)))
721 ifeq ($(OS_ARCH
), WINCE
)
723 HOST_OUTOPTION
= -Fo
# eol
726 ifeq (,$(CROSS_COMPILE
))
727 HOST_OUTOPTION
= $(OUTOPTION
)
729 HOST_OUTOPTION
= -o
# eol
733 ################################################################################
735 # SUBMAKEFILES: List of Makefiles for next level down.
736 # This is used to update or create the Makefiles before invoking them.
737 SUBMAKEFILES
+= $(addsuffix /Makefile
, $(DIRS
) $(TOOL_DIRS
) $(PARALLEL_DIRS
))
739 # The root makefile doesn't want to do a plain export/libs, because
740 # of the tiers and because of libxul. Suppress the default rules in favor
741 # of something else. Makefiles which use this var *must* provide a sensible
742 # default rule before including rules.mk
743 ifndef SUPPRESS_DEFAULT_RULES
746 $(foreach tier
,$(TIERS
),$(call SUBMAKE
,tier_
$(tier
)))
750 ifneq (,$(strip $(STATIC_DIRS
)))
751 $(foreach dir,$(STATIC_DIRS
),$(call SUBMAKE
,,$(dir)))
765 endif # SUPPRESS_DEFAULT_RULES
767 ifeq ($(filter s
,$(MAKEFLAGS
)),)
775 MAKE_TIER_SUBMAKEFILES
= +$(if
$(tier_
$*_dirs
),$(MAKE
) $(addsuffix /Makefile
,$(tier_
$*_dirs
)))
779 @
$(MAKE_TIER_SUBMAKEFILES
)
780 $(foreach dir,$(tier_
$*_dirs
),$(call SUBMAKE
,export,$(dir)))
784 @
$(MAKE_TIER_SUBMAKEFILES
)
785 $(foreach dir,$(tier_
$*_dirs
),$(call SUBMAKE
,libs
,$(dir)))
789 @
$(MAKE_TIER_SUBMAKEFILES
)
790 $(foreach dir,$(tier_
$*_dirs
),$(call SUBMAKE
,tools
,$(dir)))
792 $(foreach tier
,$(TIERS
),tier_
$(tier
))::
793 @
$(ECHO
) "$@: $($@_staticdirs) $($@_dirs)"
794 $(foreach dir,$($@_staticdirs
),$(call SUBMAKE
,,$(dir)))
799 # Do everything from scratch
804 # Add dummy depend target for tinderboxes
807 # Target to only regenerate makefiles
808 makefiles
: $(SUBMAKEFILES
)
809 ifneq (,$(DIRS
)$(TOOL_DIRS
)$(PARALLEL_DIRS
))
810 $(LOOP_OVER_PARALLEL_DIRS
)
812 $(LOOP_OVER_TOOL_DIRS
)
816 export:: $(PARALLEL_DIRS_export
)
818 $(PARALLEL_DIRS_export
): %_export
: %/Makefile
819 +@
$(call SUBMAKE
,export,$*)
822 export:: $(SUBMAKEFILES
) $(MAKE_DIRS
) $(if
$(XPIDLSRCS
),$(IDL_DIR
))
824 $(LOOP_OVER_TOOL_DIRS
)
827 tools
:: $(PARALLEL_DIRS_tools
)
829 $(PARALLEL_DIRS_tools
): %_tools
: %/Makefile
830 +@
$(call SUBMAKE
,tools
,$*)
833 tools
:: $(SUBMAKEFILES
) $(MAKE_DIRS
)
835 ifneq (,$(strip $(TOOL_DIRS
)))
836 $(foreach dir,$(TOOL_DIRS
),$(call SUBMAKE
,libs
,$(dir)))
840 # Rule to create list of libraries for final link
846 ifdef BUILD_STATIC_LIBS
847 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_LINK_COMPS
) $(STATIC_LIBRARY_NAME
)
849 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_LINK_COMP_NAMES
) $(MODULE_NAME
)
851 endif # BUILD_STATIC_LIBS
853 $(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_LINK_LIBS
) $(STATIC_LIBRARY_NAME
)
855 endif # EXPORT_LIBRARY
858 # Create dependencies on static (and shared EXTRA_DSO_LIBS) libraries
859 LIBS_DEPS
= $(filter %.
$(LIB_SUFFIX
), $(LIBS
))
860 HOST_LIBS_DEPS
= $(filter %.
$(LIB_SUFFIX
), $(HOST_LIBS
))
861 DSO_LDOPTS_DEPS
= $(EXTRA_DSO_LIBS
) $(filter %.
$(LIB_SUFFIX
), $(EXTRA_DSO_LDOPTS
))
863 ifndef _LIBNAME_RELATIVE_PATHS
865 LIBS_DEPS
+= $(filter -l
%, $(LIBS
))
866 HOST_LIBS_DEPS
+= $(filter -l
%, $(HOST_LIBS
))
867 DSO_LDOPTS_DEPS
+= $(filter -l
%, $(EXTRA_DSO_LDOPTS
))
869 _LIBDIRS
= $(patsubst -L
%,%,$(filter -L
%, $(LIBS
) $(HOST_LIBS
) $(EXTRA_DSO_LDOPTS
)))
871 vpath
$(LIB_PREFIX
)%.
$(LIB_SUFFIX
) $(_LIBDIRS
)
872 ifdef IMPORT_LIB_SUFFIX
873 vpath
$(LIB_PREFIX
)%.
$(IMPORT_LIB_SUFFIX
) $(_LIBDIRS
)
874 endif # IMPORT_LIB_SUFFIX
875 vpath
$(DLL_PREFIX
)%$(DLL_SUFFIX
) $(_LIBDIRS
)
878 endif # _LIBNAME_RELATIVE_PATHS
880 # Dependencies which, if modified, should cause everything to rebuild
881 GLOBAL_DEPS
+= Makefile Makefile.in
$(DEPTH
)/config
/autoconf.mk
$(topsrcdir
)/config
/config.mk
883 ##############################################
885 libs
:: $(PARALLEL_DIRS_libs
)
887 $(PARALLEL_DIRS_libs
): %_libs
: %/Makefile
888 +@
$(call SUBMAKE
,libs
,$*)
891 libs
:: $(SUBMAKEFILES
) $(MAKE_DIRS
) $(HOST_LIBRARY
) $(LIBRARY
) $(SHARED_LIBRARY
) $(IMPORT_LIBRARY
) $(HOST_PROGRAM
) $(PROGRAM
) $(HOST_SIMPLE_PROGRAMS
) $(SIMPLE_PROGRAMS
) $(JAVA_LIBRARY
)
892 ifndef NO_DIST_INSTALL
894 ifdef EXPORT_LIBRARY
# Stage libs that will be linked into a static build
896 $(INSTALL
) $(IFLAGS1
) $(LIBRARY
) $(FAKE_LIBRARY
) $(DEPTH
)/staticlib
/components
898 $(INSTALL
) $(IFLAGS1
) $(LIBRARY
) $(FAKE_LIBRARY
) $(DEPTH
)/staticlib
900 endif # EXPORT_LIBRARY
903 $(error Shipping static component libs makes no sense.
)
905 $(INSTALL
) $(IFLAGS1
) $(LIBRARY
) $(DIST
)/lib
911 $(INSTALL
) $(IFLAGS2
) $(SHARED_LIBRARY
) $(FINAL_TARGET
)/components
912 $(ELF_DYNSTR_GC
) $(FINAL_TARGET
)/components
/$(SHARED_LIBRARY
)
913 ifndef NO_COMPONENTS_MANIFEST
914 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/chrome.manifest
"manifest components/components.manifest"
915 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/components
/components.manifest
"binary-component $(SHARED_LIBRARY)"
917 ifdef BEOS_ADDON_WORKAROUND
918 ( cd
$(FINAL_TARGET
)/components
&& $(CC
) -nostart
-o
$(SHARED_LIBRARY
).stub
$(SHARED_LIBRARY
) )
920 else # ! IS_COMPONENT
921 ifneq (,$(filter OS2 WINNT WINCE
,$(OS_ARCH
)))
922 $(INSTALL
) $(IFLAGS2
) $(IMPORT_LIBRARY
) $(DIST
)/lib
924 $(INSTALL
) $(IFLAGS2
) $(SHARED_LIBRARY
) $(DIST
)/lib
926 $(INSTALL
) $(IFLAGS2
) $(SHARED_LIBRARY
) $(FINAL_TARGET
)
927 ifdef BEOS_ADDON_WORKAROUND
928 ( cd
$(FINAL_TARGET
) && $(CC
) -nostart
-o
$(SHARED_LIBRARY
).stub
$(SHARED_LIBRARY
) )
931 endif # SHARED_LIBRARY
933 $(INSTALL
) $(IFLAGS2
) $(PROGRAM
) $(FINAL_TARGET
)
935 ifdef SIMPLE_PROGRAMS
936 $(INSTALL
) $(IFLAGS2
) $(SIMPLE_PROGRAMS
) $(FINAL_TARGET
)
939 $(INSTALL
) $(IFLAGS2
) $(HOST_PROGRAM
) $(DIST
)/host
/bin
941 ifdef HOST_SIMPLE_PROGRAMS
942 $(INSTALL
) $(IFLAGS2
) $(HOST_SIMPLE_PROGRAMS
) $(DIST
)/host
/bin
945 $(INSTALL
) $(IFLAGS1
) $(HOST_LIBRARY
) $(DIST
)/host
/lib
949 $(INSTALL
) $(IFLAGS1
) $(JAVA_LIBRARY
) $(FINAL_TARGET
)/components
951 $(INSTALL
) $(IFLAGS1
) $(JAVA_LIBRARY
) $(FINAL_TARGET
)
954 endif # !NO_DIST_INSTALL
957 ##############################################
959 ifndef NO_PROFILE_GUIDED_OPTIMIZE
960 ifdef MOZ_PROFILE_USE
961 ifeq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
962 # When building with PGO, we have to make sure to re-link
963 # in the MOZ_PROFILE_USE phase if we linked in the
964 # MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
965 # file in the link rule in the GENERATE phase to indicate
966 # that we need a relink.
968 $(SHARED_LIBRARY
): pgo.relink
971 $(PROGRAM
): pgo.relink
974 # In the second pass, we need to merge the pgc files into the pgd file.
975 # The compiler would do this for us automatically if they were in the right
976 # place, but they're in dist/bin.
977 ifneq (,$(SHARED_LIBRARY
)$(PROGRAM
))
980 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
981 $(PROGRAM
:$(BIN_SUFFIX
)=) $(DIST
)/$(MOZ_APP_NAME
)
984 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
985 $(SHARED_LIBRARY_NAME
) $(DIST
)/$(MOZ_APP_NAME
)
987 endif # SHARED_LIBRARY || PROGRAM
989 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
990 endif # NO_PROFILE_GUIDED_OPTIMIZE
992 ##############################################
995 $(MAKE
) -C
$(topsrcdir
) -f client.mk checkout
997 clean clobber realclean clobber_all
:: $(SUBMAKEFILES
)
999 -rm -rf
$(ALL_TRASH_DIRS
)
1000 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(STATIC_DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
1002 distclean:: $(SUBMAKEFILES
)
1003 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(STATIC_DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
1004 -rm -rf
$(ALL_TRASH_DIRS
)
1005 -rm -f
$(ALL_TRASH
) \
1006 Makefile .HSancillary \
1007 $(wildcard *.
$(OBJ_SUFFIX
)) $(wildcard *.ho
) $(wildcard host_
*.o
*) \
1008 $(wildcard *.
$(LIB_SUFFIX
)) $(wildcard *$(DLL_SUFFIX
)) \
1009 $(wildcard *.
$(IMPORT_LIB_SUFFIX
))
1010 ifeq ($(OS_ARCH
),OS2
)
1011 -rm -f
$(PROGRAM
:.exe
=.map
)
1016 find
$(topsrcdir
) -name
dist -prune
-o \
( -name
'*.[hc]' -o
-name
'*.cp' -o
-name
'*.cpp' -o
-name
'*.idl' \
) -print |
$(TAG_PROGRAM
)
1020 # creates OBJS, links with LIBS to create Foo
1022 $(PROGRAM
): $(PROGOBJS
) $(LIBS_DEPS
) $(EXTRA_DEPS
) $(EXE_DEF_FILE
) $(RESFILE
) $(GLOBAL_DEPS
)
1024 ifeq (WINCE
,$(OS_ARCH
))
1025 $(LD
) -NOLOGO
-OUT
:$@
$(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(PROGOBJS
) $(RESFILE
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1027 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
1028 $(LD
) -NOLOGO
-OUT
:$@
-PDB
:$(LINK_PDBFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(PROGOBJS
) $(RESFILE
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1029 ifdef MSMANIFEST_TOOL
1030 @if
test -f
$@.manifest
; then \
1031 if
test -f
"$(srcdir)/$@.manifest"; then \
1032 echo
"Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
1033 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1035 echo
"Embedding manifest from $@.manifest"; \
1036 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1038 elif
test -f
"$(srcdir)/$@.manifest"; then \
1039 echo
"Embedding manifest from $(srcdir)/$@.manifest"; \
1040 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE
:$@\
;1; \
1042 endif # MSVC with manifest tool
1043 ifdef MOZ_PROFILE_GENERATE
1044 # touch it a few seconds into the future to work around FAT's
1045 # 2-second granularity
1046 touch
-t
`date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
1048 else # !WINNT || GNU_CC
1049 ifeq ($(CPP_PROG_LINK
),1)
1050 $(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
)
1051 else # ! CPP_PROG_LINK
1052 $(CC
) -o
$@
$(CFLAGS
) $(PROGOBJS
) $(RESFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(LIBS_DIR
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)) $(BIN_FLAGS
) $(EXE_DEF_FILE
)
1053 endif # CPP_PROG_LINK
1054 endif # WINNT && !GNU_CC
1060 ifdef MOZ_POST_PROGRAM_COMMAND
1061 $(MOZ_POST_PROGRAM_COMMAND
) $@
1063 ifeq ($(OS_ARCH
),BeOS
)
1064 ifdef BEOS_PROGRAM_RESOURCE
1065 xres
-o
$@
$(BEOS_PROGRAM_RESOURCE
)
1070 $(HOST_PROGRAM
): $(HOST_PROGOBJS
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
1071 ifeq (WINCE
,$(OS_ARCH
))
1072 $(HOST_LD
) -NOLOGO
-OUT
:$@
$(HOST_OBJS
) $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1074 ifeq (_WINNT
,$(GNU_CC
)_
$(HOST_OS_ARCH
))
1075 $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $(HOST_OBJS
) $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1076 ifdef MSMANIFEST_TOOL
1077 @if
test -f
$@.manifest
; then \
1078 if
test -f
"$(srcdir)/$@.manifest"; then \
1079 echo
"Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
1080 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1082 echo
"Embedding manifest from $@.manifest"; \
1083 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1085 elif
test -f
"$(srcdir)/$@.manifest"; then \
1086 echo
"Embedding manifest from $(srcdir)/$@.manifest"; \
1087 mt.exe
-NOLOGO
-MANIFEST
"$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE
:$@\
;1; \
1089 endif # MSVC with manifest tool
1091 ifeq ($(HOST_CPP_PROG_LINK
),1)
1092 $(HOST_CXX
) -o
$@
$(HOST_CXXFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1094 $(HOST_CC
) -o
$@
$(HOST_CFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1095 endif # HOST_CPP_PROG_LINK
1100 # This is an attempt to support generation of multiple binaries
1101 # in one directory, it assumes everything to compile Foo is in
1102 # Foo.o (from either Foo.c or Foo.cpp).
1104 # SIMPLE_PROGRAMS = Foo Bar
1105 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
1107 $(SIMPLE_PROGRAMS
): %$(BIN_SUFFIX
): %.
$(OBJ_SUFFIX
) $(LIBS_DEPS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
1108 ifeq (WINCE
,$(OS_ARCH
))
1109 $(LD
) -nologo
-entry
:mainACRTStartup
-out
:$@
$< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1111 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
1112 $(LD
) -nologo
-out
:$@
-pdb
:$(LINK_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(call EXPAND_FAKELIBS
,$(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
))
1113 ifdef MSMANIFEST_TOOL
1114 @if
test -f
$@.manifest
; then \
1115 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
1116 rm -f
$@.manifest
; \
1118 endif # MSVC with manifest tool
1120 ifeq ($(CPP_PROG_LINK
),1)
1121 $(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
)
1123 $(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
)
1124 endif # CPP_PROG_LINK
1125 endif # WINNT && !GNU_CC
1131 ifdef MOZ_POST_PROGRAM_COMMAND
1132 $(MOZ_POST_PROGRAM_COMMAND
) $@
1135 $(HOST_SIMPLE_PROGRAMS
): host_
%$(HOST_BIN_SUFFIX
): host_
%.
$(OBJ_SUFFIX
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
1136 ifeq (WINCE
,$(OS_ARCH
))
1137 $(HOST_LD
) -NOLOGO
-OUT
:$@
$(WIN32_EXE_LDFLAGS
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1139 ifeq (WINNT_
,$(HOST_OS_ARCH
)_
$(GNU_CC
))
1140 $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1142 ifneq (,$(HOST_CPPSRCS
)$(USE_HOST_CXX
))
1143 $(HOST_CXX
) $(HOST_OUTOPTION
)$@
$(HOST_CXXFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1145 $(HOST_CC
) $(HOST_OUTOPTION
)$@
$(HOST_CFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
1151 # Purify target. Solaris/sparc only to start.
1152 # Purify does not recognize "egcs" or "c++" so we go with
1153 # "gcc" and "g++" for now.
1156 ifeq ($(CPP_PROG_LINK
),1)
1157 $(PURIFY
) $(CCC
) -o
$^.pure
$(CXXFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1159 $(PURIFY
) $(CC
) -o
$^.pure
$(CFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1161 ifndef NO_DIST_INSTALL
1162 $(INSTALL
) $(IFLAGS2
) $^.pure
$(FINAL_TARGET
)
1165 quantify
: $(PROGRAM
)
1166 ifeq ($(CPP_PROG_LINK
),1)
1167 $(QUANTIFY
) $(CCC
) -o
$^.quantify
$(CXXFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1169 $(QUANTIFY
) $(CC
) -o
$^.quantify
$(CFLAGS
) $(PROGOBJS
) $(LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(OS_LIBS
) $(EXTRA_LIBS
)
1171 ifndef NO_DIST_INSTALL
1172 $(INSTALL
) $(IFLAGS2
) $^.quantify
$(FINAL_TARGET
)
1176 # This allows us to create static versions of the shared libraries
1177 # that are built using other static libraries. Confused...?
1179 ifdef SHARED_LIBRARY_LIBS
1180 ifeq (,$(GNU_LD
)$(filter-out OS2 WINNT WINCE
, $(OS_ARCH
)))
1181 ifneq (,$(BUILD_STATIC_LIBS
)$(FORCE_STATIC_LIB
))
1182 LOBJS
+= $(SHARED_LIBRARY_LIBS
)
1185 NONFAKE_SHARED_LIBRARY_LIBS
= $(filter-out %.fake
,$(call EXPAND_FAKELIBS
,$(SHARED_LIBRARY_LIBS
)))
1186 ifeq (,$(NONFAKE_SHARED_LIBRARY_LIBS
))
1187 # All of our SHARED_LIBRARY_LIBS have fake equivalents. Score!
1188 # Just pass the original object files around.
1189 # For shared libraries, these are already included in EXTRA_DSO_LDOPTS
1191 ifndef SHARED_LIBRARY
1192 LOBJS
+= $(shell cat
$(addsuffix .fake
,$(SHARED_LIBRARY_LIBS
)))
1196 ifneq (,$(filter OSF1 BSD_OS FreeBSD NetBSD OpenBSD SunOS Darwin
,$(OS_ARCH
)))
1197 CLEANUP1
:= | egrep
-v
'(________64ELEL_|__.SYMDEF)'
1198 CLEANUP2
:= rm -f ________64ELEL_ __.SYMDEF
1202 SUB_LOBJS
= $(shell for lib in
$(SHARED_LIBRARY_LIBS
); do
$(AR_LIST
) $${lib} $(CLEANUP1
); done
;)
1203 endif # EXPAND_FAKELIBS
1204 endif # SHARED_LIBRARY_LIBS
1206 ifdef MOZILLA_PROBE_LIBS
1207 PROBE_LOBJS
= $(shell for lib in
$(MOZILLA_PROBE_LIBS
); do
$(AR_LIST
) $${lib} $(CLEANUP1
); done
;)
1209 ifdef DTRACE_PROBE_OBJ
1210 EXTRA_DEPS
+= $(DTRACE_PROBE_OBJ
)
1213 $(LIBRARY
): $(OBJS
) $(LOBJS
) $(SHARED_LIBRARY_LIBS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
1215 ifndef SKIP_SUB_LOBJS
1216 ifneq (,$(GNU_LD
)$(filter-out OS2 WINNT WINCE
, $(OS_ARCH
)))
1217 ifdef SHARED_LIBRARY_LIBS
1219 @for lib in
$(SHARED_LIBRARY_LIBS
); do
$(AR_EXTRACT
) $${lib}; $(CLEANUP2
); done
1222 endif # SKIP_SUB_LOBJS
1223 $(AR
) $(AR_FLAGS
) $(OBJS
) $(LOBJS
) $(SUB_LOBJS
)
1226 # Don't clean these up if we're building a fake lib, because then
1227 # we'll reference nonexistent object files in our fake lib.
1228 @
rm -f foodummyfilefoo
$(SUB_LOBJS
)
1230 # Also produce a .fake file that just contains the names of the object files.
1231 # This can be used as a response file to the linker later instead of
1232 # linking the actual static library.
1234 ifndef SUPPRESS_FAKELIB
1235 ifeq (WINNT_
,$(HOST_OS_ARCH
)_
$(.PYMAKE
))
1236 echo
"$(strip $(foreach f,$(OBJS) $(SEPARATE_OBJS) $(LOBJS) $(SUB_LOBJS),$(subst \,\\,$(call core_winabspath,$(f))))) " > $@.fake
1238 echo
"$(strip $(foreach f,$(OBJS) $(SEPARATE_OBJS) $(LOBJS) $(SUB_LOBJS),$(call core_abspath,$(f)))) " > $@.fake
1243 ifeq (,$(filter-out WINNT WINCE
, $(OS_ARCH
)))
1244 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
)
1247 ifeq ($(OS_ARCH
),OS2
)
1248 $(DEF_FILE
): $(OBJS
) $(SHARED_LIBRARY_LIBS
)
1250 echo LIBRARY
$(SHARED_LIBRARY_NAME
) INITINSTANCE TERMINSTANCE
> $@
1252 echo CODE LOADONCALL MOVEABLE DISCARDABLE
>> $@
1253 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED
>> $@
1258 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
)
1264 $(HOST_LIBRARY
): $(HOST_OBJS
) Makefile
1266 $(HOST_AR
) $(HOST_AR_FLAGS
) $(HOST_OBJS
)
1269 ifdef NO_LD_ARCHIVE_FLAGS
1270 SUB_SHLOBJS
= $(SUB_LOBJS
)
1275 ifdef DTRACE_PROBE_OBJ
1276 ifndef DTRACE_LIB_DEPENDENT
1277 $(DTRACE_PROBE_OBJ
): $(OBJS
)
1278 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(OBJS
)
1284 # On Darwin (Mac OS X), dwarf2 debugging uses debug info left in .o files,
1285 # so instead of deleting .o files after repacking them into a dylib, we make
1286 # symlinks back to the originals. The symlinks are a no-op for stabs debugging,
1287 # so no need to conditionalize on OS version or debugging format.
1289 $(SHARED_LIBRARY
): $(OBJS
) $(LOBJS
) $(DEF_FILE
) $(RESFILE
) $(SHARED_LIBRARY_LIBS
) $(LIBRARY
) $(EXTRA_DEPS
) $(DSO_LDOPTS_DEPS
) $(GLOBAL_DEPS
)
1290 ifndef INCREMENTAL_LINKER
1293 ifeq ($(OS_ARCH
),OpenVMS
)
1294 @if
test ! -f
$(VMS_SYMVEC_FILE
); then \
1295 if
test -f
$(VMS_SYMVEC_FILE_MODULE
); then \
1296 echo Creating specific component options file
$(VMS_SYMVEC_FILE
); \
1297 cp
$(VMS_SYMVEC_FILE_MODULE
) $(VMS_SYMVEC_FILE
); \
1301 @if
test ! -f
$(VMS_SYMVEC_FILE
); then \
1302 echo Creating generic component options file
$(VMS_SYMVEC_FILE
); \
1303 cp
$(VMS_SYMVEC_FILE_COMP
) $(VMS_SYMVEC_FILE
); \
1307 ifdef NO_LD_ARCHIVE_FLAGS
1308 ifdef SHARED_LIBRARY_LIBS
1309 @
rm -f
$(SUB_SHLOBJS
)
1310 @for lib in
$(SHARED_LIBRARY_LIBS
); do
$(AR_EXTRACT
) $${lib}; $(CLEANUP2
); done
1311 ifeq ($(OS_ARCH
),Darwin
)
1312 @echo Making symlinks to the original object files in the archive libraries
$(SHARED_LIBRARY_LIBS
)
1313 @for lib in
$(SHARED_LIBRARY_LIBS
); do \
1314 libdir=`echo $$lib|sed -e 's,/[^/]*\.a,,'`; \
1315 ofiles
=`$(AR_LIST) $${lib}`; \
1316 for ofile in
$$ofiles; do \
1317 if
[ -f
$$libdir/$$ofile ]; then \
1319 ln
-s
$$libdir/$$ofile $$ofile; \
1324 endif # SHARED_LIBRARY_LIBS
1325 endif # NO_LD_ARCHIVE_FLAGS
1326 ifdef DTRACE_LIB_DEPENDENT
1327 @
rm -f
$(PROBE_LOBJS
)
1328 @for lib in
$(MOZILLA_PROBE_LIBS
); do
$(AR_EXTRACT
) $${lib}; $(CLEANUP2
); done
1330 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(PROBE_LOBJS
)
1332 @for lib in
$(MOZILLA_PROBE_LIBS
); do \
1333 ofiles
=`$(AR_LIST) $${lib}`; \
1334 $(AR_DELETE
) $${lib} $$ofiles; \
1336 $(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
)
1337 @
rm -f
$(PROBE_LOBJS
)
1338 @
rm -f
$(DTRACE_PROBE_OBJ
)
1339 @for lib in
$(MOZILLA_PROBE_LIBS
); do \
1340 if
[ -L
$${lib} ]; then
rm -f
`readlink $${lib}`; fi
; \
1342 @
rm -f
$(MOZILLA_PROBE_LIBS
)
1344 else # ! DTRACE_LIB_DEPENDENT
1345 $(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
)
1346 endif # DTRACE_LIB_DEPENDENT
1348 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
1349 ifdef MSMANIFEST_TOOL
1350 ifdef EMBED_MANIFEST_AT
1351 @if
test -f
$@.manifest
; then \
1352 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;$(EMBED_MANIFEST_AT
); \
1353 rm -f
$@.manifest
; \
1355 endif # EMBED_MANIFEST_AT
1356 endif # MSVC with manifest tool
1357 ifdef MOZ_PROFILE_GENERATE
1358 touch
-t
`date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
1360 endif # WINNT && !GCC
1361 ifneq ($(OS_ARCH
),Darwin
)
1362 @
rm -f
$(SUB_SHLOBJS
)
1364 @
rm -f foodummyfilefoo
$(DELETE_AFTER_LINK
)
1369 ifdef MOZ_POST_DSO_LIB_COMMAND
1370 $(MOZ_POST_DSO_LIB_COMMAND
) $@
1374 ifdef COMPILER_DEPEND
1375 ifeq ($(SOLARIS_SUNPRO_CC
),1)
1376 _MDDEPFILE
= $(MDDEPDIR
)/$(@F
).pp
1378 define MAKE_DEPS_AUTO_CC
1379 if
test -d
$(@D
); then \
1380 echo
"Building deps for $< using Sun Studio cc"; \
1381 $(CC
) $(COMPILE_CFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
1384 define MAKE_DEPS_AUTO_CXX
1385 if
test -d
$(@D
); then \
1386 echo
"Building deps for $< using Sun Studio CC"; \
1387 $(CXX
) $(COMPILE_CXXFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
1390 endif # Sun Studio on Solaris
1391 else # COMPILER_DEPEND
1393 # Generate dependencies on the fly
1395 _MDDEPFILE
= $(MDDEPDIR
)/$(@F
).pp
1397 define MAKE_DEPS_AUTO
1398 if
test -d
$(@D
); then \
1399 echo
"Building deps for $<"; \
1400 $(MKDEPEND
) -o
'.$(OBJ_SUFFIX)' -f-
$(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $(INCLUDES
) $< 2>/dev
/null | sed
-e
"s|^[^ ]*/||" > $(_MDDEPFILE
) ; \
1404 MAKE_DEPS_AUTO_CC
= $(MAKE_DEPS_AUTO
)
1405 MAKE_DEPS_AUTO_CXX
= $(MAKE_DEPS_AUTO
)
1407 endif # COMPILER_DEPEND
1409 endif # MOZ_AUTO_DEPS
1411 # Rules for building native targets must come first because of the host_ prefix
1412 host_
%.
$(OBJ_SUFFIX
): %.c
$(GLOBAL_DEPS
)
1414 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1416 host_
%.
$(OBJ_SUFFIX
): %.
cpp $(GLOBAL_DEPS
)
1418 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1420 host_
%.
$(OBJ_SUFFIX
): %.
cc $(GLOBAL_DEPS
)
1422 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1424 host_
%.
$(OBJ_SUFFIX
): %.m
$(GLOBAL_DEPS
)
1426 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(HOST_CMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1428 host_
%.
$(OBJ_SUFFIX
): %.mm
$(GLOBAL_DEPS
)
1430 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(HOST_CMMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
1432 %:: %.c
$(GLOBAL_DEPS
)
1434 @
$(MAKE_DEPS_AUTO_CC
)
1435 $(ELOG
) $(CC
) $(CFLAGS
) $(LDFLAGS
) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1437 %.
$(OBJ_SUFFIX
): %.c
$(GLOBAL_DEPS
)
1439 @
$(MAKE_DEPS_AUTO_CC
)
1440 $(ELOG
) $(CC
) $(OUTOPTION
)$@
-c
$(COMPILE_CFLAGS
) $(_VPATH_SRCS
)
1442 # DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
1443 # 'moc' only knows about #defines it gets on the command line (-D...), not in
1444 # included headers like mozilla-config.h
1445 moc_
%.
cpp: %.h
$(GLOBAL_DEPS
)
1446 $(MOC
) $(DEFINES
) $(ACDEFINES
) $< $(OUTOPTION
)$@
1448 moc_
%.
cc: %.
cc $(GLOBAL_DEPS
)
1450 $(ELOG
) $(MOC
) $(DEFINES
) $(ACDEFINES
) $(_VPATH_SRCS
:.
cc=.h
) $(OUTOPTION
)$@
1453 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
1455 %.
$(OBJ_SUFFIX
): %.
$(ASM_SUFFIX
) $(GLOBAL_DEPS
)
1456 $(AS
) -o
$@
$(ASFLAGS
) $(AS_DASH_C_FLAG
) $(_VPATH_SRCS
)
1459 %.
$(OBJ_SUFFIX
): %.S
$(GLOBAL_DEPS
)
1460 $(AS
) -o
$@
$(ASFLAGS
) -c
$<
1462 %:: %.
cpp $(GLOBAL_DEPS
)
1463 @
$(MAKE_DEPS_AUTO_CXX
)
1464 $(CCC
) $(OUTOPTION
)$@
$(CXXFLAGS
) $(_VPATH_SRCS
) $(LDFLAGS
)
1467 # Please keep the next two rules in sync.
1469 %.
$(OBJ_SUFFIX
): %.
cc $(GLOBAL_DEPS
)
1471 @
$(MAKE_DEPS_AUTO_CXX
)
1472 $(ELOG
) $(CCC
) $(OUTOPTION
)$@
-c
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1474 %.
$(OBJ_SUFFIX
): %.
cpp $(GLOBAL_DEPS
)
1476 @
$(MAKE_DEPS_AUTO_CXX
)
1477 ifdef STRICT_CPLUSPLUS_SUFFIX
1478 echo
"#line 1 \"$*.cpp\"" | cat
- $*.
cpp > t_
$*.
cc
1479 $(ELOG
) $(CCC
) -o
$@
-c
$(COMPILE_CXXFLAGS
) t_
$*.
cc
1482 $(ELOG
) $(CCC
) $(OUTOPTION
)$@
-c
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1483 endif #STRICT_CPLUSPLUS_SUFFIX
1485 $(OBJ_PREFIX
)%.
$(OBJ_SUFFIX
): %.mm
$(GLOBAL_DEPS
)
1487 @
$(MAKE_DEPS_AUTO_CXX
)
1488 $(ELOG
) $(CCC
) -o
$@
-c
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(_VPATH_SRCS
)
1490 $(OBJ_PREFIX
)%.
$(OBJ_SUFFIX
): %.m
$(GLOBAL_DEPS
)
1492 @
$(MAKE_DEPS_AUTO_CC
)
1493 $(ELOG
) $(CC
) -o
$@
-c
$(COMPILE_CFLAGS
) $(COMPILE_CMFLAGS
) $(_VPATH_SRCS
)
1496 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1499 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
)
1502 $(CC
) -S
$(COMPILE_CFLAGS
) $(_VPATH_SRCS
)
1505 $(CCC
) -C
-E
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
) > $*.i
1508 $(CCC
) -C
-E
$(COMPILE_CXXFLAGS
) $(_VPATH_SRCS
) > $*.i
1511 $(CC
) -C
-E
$(COMPILE_CFLAGS
) $(_VPATH_SRCS
) > $*.i
1514 $(CCC
) -C
-E
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(_VPATH_SRCS
) > $*.i
1517 @echo Creating Resource file
: $@
1518 ifeq ($(OS_ARCH
),OS2
)
1519 $(RC
) $(RCFLAGS
:-D
%=-d
%) -i
$(subst /,\
,$(srcdir)) -r
$< $@
1522 $(RC
) $(RCFLAGS
) $(filter-out -U
%,$(DEFINES
)) $(INCLUDES
:-I
%=--include-dir
%) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1524 $(RC
) $(RCFLAGS
) -r
$(DEFINES
) $(INCLUDES
) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1528 # need 3 separate lines for OS/2
1535 rm -f
$@
; cp
$< $@
; chmod
+x
$@
1537 # Cancel these implicit rules
1547 ###############################################################################
1549 ###############################################################################
1550 ifneq (,$(filter OS2 WINNT WINCE
,$(OS_ARCH
)))
1557 SPACE
:= $(EMPTY
) $(EMPTY
)
1559 # Cygwin and MSYS have their own special path form, but javac expects the source
1560 # and class paths to be in the DOS form (i.e. e:/builds/...). This function
1561 # does the appropriate conversion on Windows, but is a noop on other systems.
1562 ifeq (,$(filter-out WINNT WINCE
, $(HOST_OS_ARCH
)))
1563 ifdef CYGWIN_WRAPPER
1564 normalizepath
= $(foreach p
,$(1),$(shell cygpath
-m
$(p
)))
1567 # We use 'pwd -W' to get DOS form of the path. However, since the given path
1568 # could be a file or a non-existent path, we cannot call 'pwd -W' directly
1569 # on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
1570 # on it, then merge with the rest of the path.
1571 root-path
= $(shell echo
$(1) | sed
-e
"s|\(/[^/]*\)/\?\(.*\)|\1|")
1572 non-root-path
= $(shell echo
$(1) | sed
-e
"s|\(/[^/]*\)/\?\(.*\)|\2|")
1573 normalizepath
= $(foreach p
,$(1),$(if
$(filter /%,$(1)),$(patsubst %/,%,$(shell cd
$(call root-path
,$(1)) && pwd
-W
))/$(call non-root-path
,$(1)),$(1)))
1576 normalizepath
= $(1)
1579 _srcdir
= $(call normalizepath
,$(srcdir))
1580 ifdef JAVA_SOURCEPATH
1581 SP
= $(subst $(SPACE
),$(SEP
),$(call normalizepath
,$(strip $(JAVA_SOURCEPATH
))))
1582 _JAVA_SOURCEPATH
= ".$(SEP)$(_srcdir)$(SEP)$(SP)"
1584 _JAVA_SOURCEPATH
= ".$(SEP)$(_srcdir)"
1587 ifdef JAVA_CLASSPATH
1588 CP
= $(subst $(SPACE
),$(SEP
),$(call normalizepath
,$(strip $(JAVA_CLASSPATH
))))
1589 _JAVA_CLASSPATH
= ".$(SEP)$(CP)"
1598 $(_JAVA_DIR
)/%.class
: %.java
$(GLOBAL_DEPS
) $(_JAVA_DIR
)
1599 $(CYGWIN_WRAPPER
) $(JAVAC
) $(JAVAC_FLAGS
) -classpath
$(_JAVA_CLASSPATH
) \
1600 -sourcepath
$(_JAVA_SOURCEPATH
) -d
$(_JAVA_DIR
) $(_VPATH_SRCS
)
1602 $(JAVA_LIBRARY
): $(addprefix $(_JAVA_DIR
)/,$(JAVA_SRCS
:.java
=.class
)) $(GLOBAL_DEPS
)
1603 $(JAR
) cf
$@
-C
$(_JAVA_DIR
) .
1605 GARBAGE_DIRS
+= $(_JAVA_DIR
)
1607 ###############################################################################
1609 ###############################################################################
1611 # In GNU make 3.80, makefiles must use the /cygdrive syntax, even if we're
1612 # processing them with AS perl. See bug 232003
1614 CYGWIN_TOPSRCDIR
= -nowrap
-p
$(topsrcdir
) -wrap
1617 # Note: Passing depth to make-makefile is optional.
1618 # It saves the script some work, though.
1619 Makefile
: Makefile.in
1620 @
$(PERL
) $(AUTOCONF_TOOLS
)/make-makefile
-t
$(topsrcdir
) -d
$(DEPTH
) $(CYGWIN_TOPSRCDIR
)
1623 # VPATH does not work on some machines in this case, so add $(srcdir)
1624 $(SUBMAKEFILES
): % : $(srcdir)/%.in
1625 $(PERL
) $(AUTOCONF_TOOLS
)/make-makefile
-t
$(topsrcdir
) -d
$(DEPTH
) $(CYGWIN_TOPSRCDIR
) $@
1628 ifdef AUTOUPDATE_CONFIGURE
1629 $(topsrcdir
)/configure
: $(topsrcdir
)/configure.in
1630 (cd
$(topsrcdir
) && $(AUTOCONF
)) && (cd
$(DEPTH
) && .
/config.status
--recheck
)
1633 ###############################################################################
1634 # Bunch of things that extend the 'export' rule (in order):
1635 ###############################################################################
1637 ################################################################################
1638 # Copy each element of EXPORTS to $(DIST)/include
1641 ifneq ($(XPIDLSRCS
),)
1647 ifneq ($(XPI_NAME
),)
1651 export:: $(FINAL_TARGET
)
1654 ifndef NO_DIST_INSTALL
1657 $(INSTALL
) $(IFLAGS1
) $^
$(DIST
)/include
1659 endif # NO_DIST_INSTALL
1661 define EXPORT_NAMESPACE_RULE
1662 ifndef NO_DIST_INSTALL
1663 export:: $(EXPORTS_
$(namespace
))
1664 $(INSTALL
) $(IFLAGS1
) $$^
$(DIST
)/include/$(namespace
)
1665 endif # NO_DIST_INSTALL
1668 $(foreach namespace
,$(EXPORTS_NAMESPACES
),$(eval
$(EXPORT_NAMESPACE_RULE
)))
1670 ################################################################################
1671 # Copy each element of PREF_JS_EXPORTS
1676 ifneq (,$(XPI_NAME
)$(LIBXUL_SDK
))
1677 PREF_DIR
= defaults
/preferences
1679 PREF_DIR
= defaults
/pref
1683 ifneq ($(PREF_JS_EXPORTS
),)
1684 # on win32, pref files need CRLF line endings... see bug 206029
1685 ifeq (WINNT
,$(OS_ARCH
))
1686 PREF_PPFLAGS
= --line-endings
=crlf
1689 ifndef NO_DIST_INSTALL
1690 $(FINAL_TARGET
)/$(PREF_DIR
):
1693 libs
:: $(FINAL_TARGET
)/$(PREF_DIR
) $(PREF_JS_EXPORTS
)
1695 for i in
$(PREF_JS_EXPORTS
); do \
1696 dest
=$(FINAL_TARGET
)/$(PREF_DIR
)/`basename $$i`; \
1698 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$(PREF_PPFLAGS
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $$i > $$dest; \
1703 ################################################################################
1704 # Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
1706 ifneq ($(AUTOCFG_JS_EXPORTS
),)
1707 $(FINAL_TARGET
)/defaults
/autoconfig
::
1710 ifndef NO_DIST_INSTALL
1711 export:: $(AUTOCFG_JS_EXPORTS
) $(FINAL_TARGET
)/defaults
/autoconfig
1712 $(INSTALL
) $(IFLAGS1
) $^
1716 ################################################################################
1717 # Export the elements of $(XPIDLSRCS)
1718 # generating .h and .xpt files and moving them to the appropriate places.
1720 ifneq ($(XPIDLSRCS
),)
1722 export:: $(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.h
, $(XPIDLSRCS
))
1725 XPIDL_MODULE
= $(MODULE
)
1728 ifeq ($(XPIDL_MODULE
),) # we need $(XPIDL_MODULE) to make $(XPIDL_MODULE).xpt
1731 @echo
"*** Error processing XPIDLSRCS:"
1732 @echo
"Please define MODULE or XPIDL_MODULE when defining XPIDLSRCS,"
1733 @echo
"so we have a module name to use when creating MODULE.xpt."
1734 @echo
; sleep
2; false
1740 # generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
1741 # warn against overriding existing .h file.
1742 $(XPIDL_GEN_DIR
)/.done
:
1743 @if
test ! -d
$(XPIDL_GEN_DIR
); then echo Creating
$(XPIDL_GEN_DIR
)/.done
; rm -rf
$(XPIDL_GEN_DIR
); mkdir
$(XPIDL_GEN_DIR
); fi
1746 # don't depend on $(XPIDL_GEN_DIR), because the modification date changes
1747 # with any addition to the directory, regenerating all .h files -> everything.
1749 $(XPIDL_GEN_DIR
)/%.h
: %.idl
$(XPIDL_COMPILE
) $(XPIDL_GEN_DIR
)/.done
1751 $(ELOG
) $(XPIDL_COMPILE
) -m header
-w
$(XPIDL_FLAGS
) -o
$(XPIDL_GEN_DIR
)/$* $(_VPATH_SRCS
)
1752 @if
test -n
"$(findstring $*.h, $(EXPORTS))"; \
1753 then echo
"*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true
; fi
1756 # generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
1757 # into $(XPIDL_MODULE).xpt and export it to $(FINAL_TARGET)/components.
1758 $(XPIDL_GEN_DIR
)/%.xpt
: %.idl
$(XPIDL_COMPILE
) $(XPIDL_GEN_DIR
)/.done
1760 $(ELOG
) $(XPIDL_COMPILE
) -m typelib
-w
$(XPIDL_FLAGS
) -e
$@
-d
$(MDDEPDIR
)/$*.pp
$(_VPATH_SRCS
)
1762 # no need to link together if XPIDLSRCS contains only XPIDL_MODULE
1763 ifneq ($(XPIDL_MODULE
).idl
,$(strip $(XPIDLSRCS
)))
1764 $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
: $(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.xpt
,$(XPIDLSRCS
)) $(GLOBAL_DEPS
) $(XPIDL_LINK
)
1765 $(XPIDL_LINK
) $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
$(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.xpt
,$(XPIDLSRCS
))
1766 endif # XPIDL_MODULE.xpt != XPIDLSRCS
1768 libs
:: $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
1769 ifndef NO_DIST_INSTALL
1770 $(INSTALL
) $(IFLAGS1
) $(XPIDL_GEN_DIR
)/$(XPIDL_MODULE
).xpt
$(FINAL_TARGET
)/components
1771 ifndef NO_INTERFACES_MANIFEST
1772 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/components
/interfaces.manifest
"interfaces $(XPIDL_MODULE).xpt"
1773 @
$(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/chrome.manifest
"manifest components/interfaces.manifest"
1779 GARBAGE_DIRS
+= $(XPIDL_GEN_DIR
)
1783 ifneq ($(XPIDLSRCS
),)
1784 # export .idl files to $(IDL_DIR)
1785 ifndef NO_DIST_INSTALL
1786 export:: $(XPIDLSRCS
) $(IDL_DIR
)
1787 $(INSTALL
) $(IFLAGS1
) $^
1789 export:: $(patsubst %.idl
,$(XPIDL_GEN_DIR
)/%.h
, $(XPIDLSRCS
)) $(DIST
)/include
1790 $(INSTALL
) $(IFLAGS1
) $^
1791 endif # NO_DIST_INSTALL
1798 # General rules for exporting idl files.
1800 # WORK-AROUND ONLY, for mozilla/tools/module-deps/bootstrap.pl build.
1801 # Bug to fix idl dependency problems w/o this extra build pass is
1802 # http://bugzilla.mozilla.org/show_bug.cgi?id=145777
1807 export-idl
:: $(SUBMAKEFILES
) $(MAKE_DIRS
)
1809 ifneq ($(XPIDLSRCS
),)
1810 ifndef NO_DIST_INSTALL
1811 export-idl
:: $(XPIDLSRCS
) $(IDL_DIR
)
1812 $(INSTALL
) $(IFLAGS1
) $^
1815 $(LOOP_OVER_PARALLEL_DIRS
)
1817 $(LOOP_OVER_TOOL_DIRS
)
1820 ifneq ($(XPIDLSRCS
),)
1822 JAVA_XPIDLSRCS
= $(XPIDLSRCS
)
1824 # A single IDL file can contain multiple interfaces, which result in multiple
1825 # Java interface files. So use hidden dependency files.
1826 JAVADEPFILES
= $(addprefix $(JAVA_GEN_DIR
)/.
,$(JAVA_XPIDLSRCS
:.idl
=.java.pp
))
1830 GARBAGE_DIRS
+= $(JAVA_GEN_DIR
)
1832 # generate .java files into _javagen/[package name dirs]
1833 _JAVA_GEN_DIR
= $(JAVA_GEN_DIR
)/$(JAVA_IFACES_PKG_NAME
)
1837 $(JAVA_GEN_DIR
)/.
%.java.pp
: %.idl
$(XPIDL_COMPILE
) $(_JAVA_GEN_DIR
)
1839 $(ELOG
) $(XPIDL_COMPILE
) -m java
-w
$(XPIDL_FLAGS
) -I
$(srcdir) -I
$(IDL_DIR
) -o
$(_JAVA_GEN_DIR
)/$* $(_VPATH_SRCS
)
1842 # "Install" generated Java interfaces. We segregate them based on the XPI_NAME.
1843 # If XPI_NAME is not set, install into the "default" directory.
1844 ifneq ($(XPI_NAME
),)
1845 JAVA_INSTALL_DIR
= $(JAVA_DIST_DIR
)/$(XPI_NAME
)
1847 JAVA_INSTALL_DIR
= $(JAVA_DIST_DIR
)/default
1850 $(JAVA_INSTALL_DIR
):
1853 export:: $(JAVA_DIST_DIR
) $(JAVADEPFILES
) $(JAVA_INSTALL_DIR
)
1854 (cd
$(JAVA_GEN_DIR
) && tar $(TAR_CREATE_FLAGS
) - .
) |
(cd
$(JAVA_INSTALL_DIR
) && tar -xf
-)
1857 endif # MOZ_JAVAXPCOM
1859 ################################################################################
1860 # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
1861 ifneq (,$(filter %.js
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1862 ifeq (,$(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1863 ifndef NO_JS_MANIFEST
1864 $(error .js component without matching .manifest. See https
://developer.mozilla.org
/en
/XPCOM
/XPCOM_changes_in_Gecko_2.0
)
1869 ifdef EXTRA_COMPONENTS
1870 libs
:: $(EXTRA_COMPONENTS
)
1871 ifndef NO_DIST_INSTALL
1872 $(INSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/components
1877 ifdef EXTRA_PP_COMPONENTS
1878 libs
:: $(EXTRA_PP_COMPONENTS
)
1879 ifndef NO_DIST_INSTALL
1881 $(NSINSTALL
) -D
$(FINAL_TARGET
)/components
; \
1883 fname
=`basename $$i`; \
1884 dest
=$(FINAL_TARGET
)/components
/$${fname}; \
1886 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $$i > $$dest; \
1891 EXTRA_MANIFESTS
= $(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
))
1892 ifneq (,$(EXTRA_MANIFESTS
))
1894 $(PYTHON
) $(MOZILLA_DIR
)/config
/buildlist.py
$(FINAL_TARGET
)/chrome.manifest
$(patsubst %,"manifest components/%",$(notdir $(EXTRA_MANIFESTS
)))
1897 ################################################################################
1898 # Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
1899 ifdef EXTRA_JS_MODULES
1900 libs
:: $(EXTRA_JS_MODULES
)
1901 ifndef NO_DIST_INSTALL
1902 $(INSTALL
) $(IFLAGS1
) $^
$(FINAL_TARGET
)/modules
1907 ifdef EXTRA_PP_JS_MODULES
1908 libs
:: $(EXTRA_PP_JS_MODULES
)
1909 ifndef NO_DIST_INSTALL
1911 $(NSINSTALL
) -D
$(FINAL_TARGET
)/modules
; \
1913 dest
=$(FINAL_TARGET
)/modules
/`basename $$i`; \
1915 $(PYTHON
) $(topsrcdir
)/config
/Preprocessor.py
$(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) $$i > $$dest; \
1921 ################################################################################
1924 ifneq (,$(SDK_LIBRARY
))
1928 ifndef NO_DIST_INSTALL
1929 libs
:: $(SDK_LIBRARY
) $(SDK_LIB_DIR
)
1930 $(INSTALL
) $(IFLAGS2
) $^
1935 ifneq (,$(SDK_BINARY
))
1939 ifndef NO_DIST_INSTALL
1940 libs
:: $(SDK_BINARY
) $(SDK_BIN_DIR
)
1941 $(INSTALL
) $(IFLAGS2
) $^
1946 ################################################################################
1949 JAR_MANIFEST
:= $(srcdir)/jar.mn
1953 $(LOOP_OVER_PARALLEL_DIRS
)
1955 $(LOOP_OVER_TOOL_DIRS
)
1957 $(FINAL_TARGET
)/chrome
:
1960 libs realchrome
:: $(CHROME_DEPS
) $(FINAL_TARGET
)/chrome
1961 ifneq (,$(wildcard $(JAR_MANIFEST
)))
1962 ifndef NO_DIST_INSTALL
1963 $(PYTHON
) $(MOZILLA_DIR
)/config
/JarMaker.py \
1964 $(QUIET
) -j
$(FINAL_TARGET
)/chrome \
1965 $(MAKE_JARS_FLAGS
) $(XULPPFLAGS
) $(DEFINES
) $(ACDEFINES
) \
1970 ifneq ($(DIST_FILES
),)
1974 libs
:: $(DIST_FILES
) $(DIST
)/bin
1976 for f in
$(DIST_FILES
); do \
1977 dest
=$(FINAL_TARGET
)/`basename $$f`; \
1979 $(PYTHON
) $(MOZILLA_DIR
)/config
/Preprocessor.py \
1980 $(XULAPP_DEFINES
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) \
1981 $(srcdir)/$$f > $$dest; \
1985 ifneq ($(DIST_CHROME_FILES
),)
1986 libs
:: $(DIST_CHROME_FILES
)
1988 for f in
$(DIST_CHROME_FILES
); do \
1989 dest
=$(FINAL_TARGET
)/chrome
/`basename $$f`; \
1991 $(PYTHON
) $(MOZILLA_DIR
)/config
/Preprocessor.py \
1992 $(XULAPP_DEFINES
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) \
1993 $(srcdir)/$$f > $$dest; \
1997 ifneq ($(XPI_PKGNAME
),)
2001 @echo
"Stripping $(XPI_PKGNAME) package directory..."
2002 @echo
$(FINAL_TARGET
)
2003 @cd
$(FINAL_TARGET
) && find .
! -type d \
2013 ! -name
"*.properties" \
2024 $(PLATFORM_EXCLUDE_LIST
) \
2025 -exec
$(STRIP
) $(STRIP_FLAGS
) {} >/dev
/null
2>&1 \
;
2028 @echo
"Packaging $(XPI_PKGNAME).xpi..."
2029 cd
$(FINAL_TARGET
) && $(ZIP
) -qr ..
/$(XPI_PKGNAME
).xpi
*
2032 ifdef INSTALL_EXTENSION_ID
2034 $(error XPI_NAME must be set for INSTALL_EXTENSION_ID
)
2038 $(RM
) -rf
"$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)"
2039 $(NSINSTALL
) -D
"$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)"
2040 cd
$(FINAL_TARGET
) && tar $(TAR_CREATE_FLAGS
) - . |
(cd
"../../bin/extensions/$(INSTALL_EXTENSION_ID)" && tar -xf
-)
2044 ifneq (,$(filter flat symlink
,$(MOZ_CHROME_FILE_FORMAT
)))
2045 _JAR_REGCHROME_DISABLE_JAR
=1
2047 _JAR_REGCHROME_DISABLE_JAR
=0
2050 REGCHROME
= $(PERL
) -I
$(MOZILLA_DIR
)/config
$(MOZILLA_DIR
)/config
/add-chrome.pl \
2051 $(if
$(filter gtk2
,$(MOZ_WIDGET_TOOLKIT
)),-x
) \
2052 $(if
$(CROSS_COMPILE
),-o
$(OS_ARCH
)) $(FINAL_TARGET
)/chrome
/installed-chrome.txt \
2053 $(_JAR_REGCHROME_DISABLE_JAR
)
2055 REGCHROME_INSTALL
= $(PERL
) -I
$(MOZILLA_DIR
)/config
$(MOZILLA_DIR
)/config
/add-chrome.pl \
2056 $(if
$(filter gtk2
,$(MOZ_WIDGET_TOOLKIT
)),-x
) \
2057 $(if
$(CROSS_COMPILE
),-o
$(OS_ARCH
)) $(DESTDIR
)$(mozappdir
)/chrome
/installed-chrome.txt \
2058 $(_JAR_REGCHROME_DISABLE_JAR
)
2061 #############################################################################
2063 #############################################################################
2064 ifdef COMPILER_DEPEND
2066 @echo
"$(MAKE): No need to run depend target.\
2067 Using compiler-based depend." 1>&2
2068 ifeq ($(GNU_CC
)$(GNU_CXX
),)
2070 @echo
"`echo '$(MAKE):'|sed 's/./ /g'`"\
2071 '(Compiler-based depend was turned on by "--enable-md".)' 1>&2
2074 @space
="`echo '$(MAKE): '|sed 's/./ /g'`";\
2075 echo
"$$space"'Since you are using a GNU compiler,\
2076 it is on by default.' 1>&2; \
2077 echo
"$$space"'To turn it off, pass --disable-md to configure.' 1>&2
2080 else # ! COMPILER_DEPEND
2082 ifndef MOZ_AUTO_DEPS
2084 define MAKE_DEPS_NOAUTO
2085 $(MKDEPEND
) -w1024
-o
'.$(OBJ_SUFFIX)' -f-
$(DEFINES
) $(ACDEFINES
) $(INCLUDES
) $< 2>/dev
/null | sed
-e
"s|^[^ ]*/||" > $@
2088 $(MDDEPDIR
)/%.pp
: %.c
2090 @
$(MAKE_DEPS_NOAUTO
)
2092 $(MDDEPDIR
)/%.pp
: %.
cpp
2094 @
$(MAKE_DEPS_NOAUTO
)
2096 $(MDDEPDIR
)/%.pp
: %.s
2098 @
$(MAKE_DEPS_NOAUTO
)
2100 ifneq (,$(OBJS
)$(XPIDLSRCS
)$(SIMPLE_PROGRAMS
))
2101 depend
:: $(SUBMAKEFILES
) $(MAKE_DIRS
) $(MDDEPFILES
)
2103 depend
:: $(SUBMAKEFILES
)
2105 $(LOOP_OVER_PARALLEL_DIRS
)
2107 $(LOOP_OVER_TOOL_DIRS
)
2109 dependclean
:: $(SUBMAKEFILES
)
2111 $(LOOP_OVER_PARALLEL_DIRS
)
2113 $(LOOP_OVER_TOOL_DIRS
)
2115 endif # MOZ_AUTO_DEPS
2117 endif # COMPILER_DEPEND
2120 #############################################################################
2121 # MDDEPDIR is the subdirectory where all the dependency files are placed.
2122 # This uses a make rule (instead of a macro) to support parallel
2123 # builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
2124 # processes could simultaneously try to create the same directory.
2126 # We use $(CURDIR) in the rule's target to ensure that we don't find
2127 # a dependency directory in the source tree via VPATH (perhaps from
2128 # a previous build in the source tree) and thus neglect to create a
2129 # dependency directory in the object directory, where we really need
2132 $(CURDIR
)/$(MDDEPDIR
):
2133 @if
test ! -d
$@
; then echo Creating
$@
; rm -rf
$@
; mkdir
$@
; else true
; fi
2135 ifneq (,$(filter-out all chrome default
export realchrome tools
clean clobber clobber_all
distclean realclean,$(MAKECMDGOALS
)))
2136 ifneq (,$(OBJS
)$(XPIDLSRCS
)$(SIMPLE_PROGRAMS
))
2137 MDDEPEND_FILES
:= $(strip $(wildcard $(MDDEPDIR
)/*.pp
))
2139 ifneq (,$(MDDEPEND_FILES
))
2140 # The script mddepend.pl checks the dependencies and writes to stdout
2141 # one rule to force out-of-date objects. For example,
2142 # foo.o boo.o: FORCE
2143 # The script has an advantage over including the *.pp files directly
2144 # because it handles the case when header files are removed from the build.
2145 # 'make' would complain that there is no way to build missing headers.
2146 ALL_PP_RESULTS
= $(shell $(PERL
) $(BUILD_TOOLS
)/mddepend.pl
- $(MDDEPEND_FILES
))
2147 $(eval
$(ALL_PP_RESULTS
))
2152 #############################################################################
2154 -include $(topsrcdir
)/$(MOZ_BUILD_APP
)/app-rules.mk
2155 -include $(MY_RULES
)
2158 # Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
2162 ifneq ($(CSRCS
)$(CPPSRCS
)$(HEADERS
),)
2164 TAGS
:: $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
2165 $(ETAGS
) $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
2169 ################################################################################
2170 # Special gmake rules.
2171 ################################################################################
2175 # Disallow parallel builds with MSVC < 8
2177 ifneq (,$(filter 1200 1300 1310,$(_MSC_VER
)))
2182 # Re-define the list of default suffixes, so gmake won't have to churn through
2183 # hundreds of built-in suffix rules for stuff we don't need.
2188 # Fake targets. Always run these rules, even if a file/directory with that
2189 # name already exists.
2191 .PHONY
: all alltags boot checkout chrome realchrome
clean clobber clobber_all
export install libs makefiles
realclean run_apprunner tools
$(DIRS
) $(TOOL_DIRS
) FORCE
2193 # Used as a dependency to force targets to rebuild
2196 # Delete target if error occurs when building target
2199 # Properly set LIBPATTERNS for the platform
2200 .LIBPATTERNS
= $(if
$(IMPORT_LIB_SUFFIX
),$(LIB_PREFIX
)%.
$(IMPORT_LIB_SUFFIX
)) $(LIB_PREFIX
)%.
$(LIB_SUFFIX
) $(DLL_PREFIX
)%$(DLL_SUFFIX
)
2204 TAGS
: $(SUBMAKEFILES
) $(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
2205 -etags
$(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
2206 $(LOOP_OVER_PARALLEL_DIRS
)
2216 @
$(foreach tier
,$(TIERS
),echo
'$(tier):'; echo
' dirs: $(tier_$(tier)_dirs)'; echo
' staticdirs: $(tier_$(tier)_staticdirs)'; )
2228 @
$(topsrcdir
)/build
/unix
/print-depth-path.sh
2231 @
$(topsrcdir
)/build
/package
/rpm
/print-module-name.sh
2233 echo-module-filelist
:
2234 @
$(topsrcdir
)/build
/package
/rpm
/print-module-filelist.sh
2237 ifneq (,$(filter $(PROGRAM
) $(HOST_PROGRAM
) $(SIMPLE_PROGRAMS
) $(HOST_LIBRARY
) $(LIBRARY
) $(SHARED_LIBRARY
),$(TARGETS
)))
2238 @echo
--------------------------------------------------------------------------------
2239 @echo
"PROGRAM = $(PROGRAM)"
2240 @echo
"SIMPLE_PROGRAMS = $(SIMPLE_PROGRAMS)"
2241 @echo
"LIBRARY = $(LIBRARY)"
2242 @echo
"SHARED_LIBRARY = $(SHARED_LIBRARY)"
2243 @echo
"SHARED_LIBRARY_LIBS = $(SHARED_LIBRARY_LIBS)"
2244 @echo
"LIBS = $(LIBS)"
2245 @echo
"DEF_FILE = $(DEF_FILE)"
2246 @echo
"IMPORT_LIBRARY = $(IMPORT_LIBRARY)"
2247 @echo
"STATIC_LIBS = $(STATIC_LIBS)"
2248 @echo
"SHARED_LIBS = $(SHARED_LIBS)"
2249 @echo
"EXTRA_DSO_LIBS = $(EXTRA_DSO_LIBS)"
2250 @echo
"EXTRA_DSO_LDOPTS = $(EXTRA_DSO_LDOPTS)"
2251 @echo
"DEPENDENT_LIBS = $(DEPENDENT_LIBS)"
2252 @echo
--------------------------------------------------------------------------------
2254 $(LOOP_OVER_PARALLEL_DIRS
)
2258 @echo
"MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)"
2259 @echo
"MOZ_WIDGET_TOOLKIT = $(MOZ_WIDGET_TOOLKIT)"
2261 @echo
"CXX = $(CXX)"
2262 @echo
"CCC = $(CCC)"
2263 @echo
"CPP = $(CPP)"
2266 @echo
"IMPLIB = $(IMPLIB)"
2267 @echo
"FILTER = $(FILTER)"
2268 @echo
"MKSHLIB = $(MKSHLIB)"
2269 @echo
"MKCSHLIB = $(MKCSHLIB)"
2271 @echo
"CFLAGS = $(CFLAGS)"
2272 @echo
"OS_CFLAGS = $(OS_CFLAGS)"
2273 @echo
"COMPILE_CFLAGS = $(COMPILE_CFLAGS)"
2274 @echo
"CXXFLAGS = $(CXXFLAGS)"
2275 @echo
"OS_CXXFLAGS = $(OS_CXXFLAGS)"
2276 @echo
"COMPILE_CXXFLAGS = $(COMPILE_CXXFLAGS)"
2277 @echo
"COMPILE_CMFLAGS = $(COMPILE_CMFLAGS)"
2278 @echo
"COMPILE_CMMFLAGS = $(COMPILE_CMMFLAGS)"
2279 @echo
"LDFLAGS = $(LDFLAGS)"
2280 @echo
"OS_LDFLAGS = $(OS_LDFLAGS)"
2281 @echo
"DSO_LDOPTS = $(DSO_LDOPTS)"
2282 @echo
"OS_INCLUDES = $(OS_INCLUDES)"
2283 @echo
"OS_LIBS = $(OS_LIBS)"
2284 @echo
"EXTRA_LIBS = $(EXTRA_LIBS)"
2285 @echo
"BIN_FLAGS = $(BIN_FLAGS)"
2286 @echo
"INCLUDES = $(INCLUDES)"
2287 @echo
"DEFINES = $(DEFINES)"
2288 @echo
"ACDEFINES = $(ACDEFINES)"
2289 @echo
"BIN_SUFFIX = $(BIN_SUFFIX)"
2290 @echo
"LIB_SUFFIX = $(LIB_SUFFIX)"
2291 @echo
"DLL_SUFFIX = $(DLL_SUFFIX)"
2292 @echo
"IMPORT_LIB_SUFFIX = $(IMPORT_LIB_SUFFIX)"
2293 @echo
"INSTALL = $(INSTALL)"
2296 @echo
"HOST_CC = $(HOST_CC)"
2297 @echo
"HOST_CXX = $(HOST_CXX)"
2298 @echo
"HOST_CFLAGS = $(HOST_CFLAGS)"
2299 @echo
"HOST_LDFLAGS = $(HOST_LDFLAGS)"
2300 @echo
"HOST_LIBS = $(HOST_LIBS)"
2301 @echo
"HOST_EXTRA_LIBS = $(HOST_EXTRA_LIBS)"
2302 @echo
"HOST_EXTRA_DEPS = $(HOST_EXTRA_DEPS)"
2303 @echo
"HOST_PROGRAM = $(HOST_PROGRAM)"
2304 @echo
"HOST_OBJS = $(HOST_OBJS)"
2305 @echo
"HOST_PROGOBJS = $(HOST_PROGOBJS)"
2306 @echo
"HOST_LIBRARY = $(HOST_LIBRARY)"
2309 @echo
"Build Modules = $(BUILD_MODULES)"
2310 @echo
"Module dirs = $(BUILD_MODULE_DIRS)"
2314 $(DOXYGEN
) $(DEPTH
)/config
/doxygen.cfg
2317 check:: $(SUBMAKEFILES
) $(MAKE_DIRS
)
2318 $(LOOP_OVER_PARALLEL_DIRS
)
2320 $(LOOP_OVER_TOOL_DIRS
)
2324 FREEZE_VARIABLES
= \
2336 EXTRA_PP_COMPONENTS \
2339 $(foreach var
,$(FREEZE_VARIABLES
),$(eval
$(var
)_FROZEN
:= '$($(var))'))
2341 CHECK_FROZEN_VARIABLES
= $(foreach var
,$(FREEZE_VARIABLES
), \
2342 $(if
$(subst $($(var
)_FROZEN
),,'$($(var))'),$(error Makefile variable
'$(var)' changed value after including rules.mk. Was
$($(var
)_FROZEN
), now
$($(var
)).
)))
2345 $(CHECK_FROZEN_VARIABLES
)
2348 if
test -d
$(DIST
)/bin
; then touch
$(DIST
)/bin
/.purgecaches
; fi