2 # vim:set ts=8 sw=8 sts=8 noet:
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 # You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(error topsrcdir was not set
))
13 # Define an include-at-most-once flag
14 ifdef INCLUDED_RULES_MK
15 $(error Do not
include rules.mk twice
!)
19 # Make sure that anything that needs to be defined in moz.build wasn't
21 _eval_for_side_effects
:= $(CHECK_MOZBUILD_VARIABLES
)
24 MOZILLA_DIR
= $(topsrcdir
)
27 ifndef INCLUDED_CONFIG_MK
28 include $(topsrcdir
)/config
/config.mk
31 ifndef INCLUDED_VERSION_MK
32 include $(topsrcdir
)/config
/version.mk
35 USE_AUTOTARGETS_MK
= 1
36 include $(topsrcdir
)/config
/makefiles
/makeutils.mk
38 # Only build with Pymake (not GNU make) on Windows.
39 ifeq ($(HOST_OS_ARCH
),WINNT
)
42 $(error Pymake is required to build on Windows. Run |.
/mach build| to \
43 automatically use pymake or invoke pymake directly via \
44 |python build
/pymake
/make.py|.
)
51 REPORT_BUILD
= @
%rebuild_check rebuild_check
$@
$^
53 REPORT_BUILD
= $(info $(shell $(PYTHON
) $(MOZILLA_DIR
)/config
/rebuild_check.py
$@
$^
))
56 REPORT_BUILD
= $(info $(notdir $@
))
65 # Don't copy xulrunner files at install time, when using system xulrunner
70 # ELOG prints out failed command when building silently (gmake -s). Pymake
71 # prints out failed commands anyway, so ELOG just makes things worse by
72 # forcing shell invocations.
74 ifneq (,$(findstring s
, $(filter-out --%, $(MAKEFLAGS
))))
75 ELOG
:= $(EXEC
) sh
$(BUILD_TOOLS
)/print-failed-commands.sh
81 endif # ifndef .PYMAKE
83 _VPATH_SRCS
= $(abspath
$<)
85 ################################################################################
86 # Testing frameworks support
87 ################################################################################
89 testxpcobjdir
= $(DEPTH
)/_tests
/xpcshell
93 # Add test directories to the regular directories list. TEST_DIRS should
94 # arguably have the same status as TOOL_DIRS and other *_DIRS variables. It is
95 # coded this way until Makefiles stop using the "ifdef ENABLE_TESTS; DIRS +="
98 # The current developer workflow expects tests to be updated when processing
99 # the default target. If we ever change this implementation, the behavior
100 # should be preserved or the change should be widely communicated. A
101 # consequence of not processing test dir targets during the default target is
102 # that changes to tests may not be updated and code could assume to pass
103 # locally against non-current test code.
106 ifndef INCLUDED_TESTS_MOCHITEST_MK
#{
107 include $(topsrcdir
)/config
/makefiles
/mochitest.mk
111 ifdef COMPILE_ENVIRONMENT
113 # Compile the tests to $(DIST)/bin. Make lots of niceties available by default
114 # through TestHarness.h, by modifying the list of includes and the libs against
116 CPPSRCS
+= $(CPP_UNIT_TESTS
)
117 CPP_UNIT_TEST_BINS
:= $(CPP_UNIT_TESTS
:.
cpp=$(BIN_SUFFIX
))
118 SIMPLE_PROGRAMS
+= $(CPP_UNIT_TEST_BINS
)
119 INCLUDES
+= -I
$(DIST
)/include/testing
120 LIBS
+= $(XPCOM_GLUE_LDOPTS
) $(NSPR_LIBS
)
122 ifndef MOZ_PROFILE_GENERATE
123 libs
:: $(CPP_UNIT_TEST_BINS
) $(call mkdir_deps
,$(DIST
)/cppunittests
)
124 $(NSINSTALL
) $(CPP_UNIT_TEST_BINS
) $(DIST
)/cppunittests
128 @
$(PYTHON
) $(topsrcdir
)/testing
/runcppunittests.py
--xre-path
=$(DIST
)/bin
--symbols-path
=$(DIST
)/crashreporter-symbols
$(subst .
cpp,$(BIN_SUFFIX
),$(CPP_UNIT_TESTS
))
130 cppunittests-remote
: DM_TRANS?
=adb
132 @if
[ '${TEST_DEVICE}' != '' -o
'$(DM_TRANS)' = 'adb' ]; then \
133 $(PYTHON
) -u
$(topsrcdir
)/testing
/remotecppunittests.py \
134 --xre-path
=$(DEPTH
)/dist/bin \
135 --localLib
=$(DEPTH
)/dist/$(MOZ_APP_NAME
) \
136 --dm_trans
=$(DM_TRANS
) \
137 --deviceIP
=${TEST_DEVICE} \
138 $(subst .
cpp,$(BIN_SUFFIX
),$(CPP_UNIT_TESTS
)) $(EXTRA_TEST_ARGS
); \
140 echo
'please prepare your host with environment variables for TEST_DEVICE'; \
143 endif # COMPILE_ENVIRONMENT
144 endif # CPP_UNIT_TESTS
148 ifdef PYTHON_UNIT_TESTS
150 RUN_PYTHON_UNIT_TESTS
:= $(addsuffix -run
,$(PYTHON_UNIT_TESTS
))
152 .PHONY
: $(RUN_PYTHON_UNIT_TESTS
)
154 check:: $(RUN_PYTHON_UNIT_TESTS
)
156 $(RUN_PYTHON_UNIT_TESTS
): %-run
: %
157 @PYTHONDONTWRITEBYTECODE
=1 $(PYTHON
) $<
159 endif # PYTHON_UNIT_TESTS
167 # If FORCE_STATIC_LIB is set, build a static library.
168 # Otherwise, build a shared library.
172 ifdef STATIC_LIBRARY_NAME
173 REAL_LIBRARY
:= $(LIB_PREFIX
)$(STATIC_LIBRARY_NAME
).
$(LIB_SUFFIX
)
174 # Only build actual library if it is installed in DIST/lib or SDK
175 ifeq (,$(SDK_LIBRARY
)$(DIST_INSTALL
)$(NO_EXPAND_LIBS
))
176 LIBRARY
:= $(REAL_LIBRARY
).
$(LIBS_DESC_SUFFIX
)
178 LIBRARY
:= $(REAL_LIBRARY
) $(REAL_LIBRARY
).
$(LIBS_DESC_SUFFIX
)
180 endif # STATIC_LIBRARY_NAME
184 ifdef HOST_LIBRARY_NAME
185 HOST_LIBRARY
:= $(LIB_PREFIX
)$(HOST_LIBRARY_NAME
).
$(LIB_SUFFIX
)
190 ifdef FORCE_SHARED_LIB
194 MKSHLIB
= $(MKCSHLIB
)
197 ifneq (,$(filter OS2 WINNT
,$(OS_ARCH
)))
198 IMPORT_LIBRARY
:= $(LIB_PREFIX
)$(SHARED_LIBRARY_NAME
).
$(IMPORT_LIB_SUFFIX
)
202 SHARED_LIBRARY
:= $(SHARED_LIBRARY_NAME
)
204 SHARED_LIBRARY
:= $(DLL_PREFIX
)$(SHARED_LIBRARY_NAME
)$(DLL_SUFFIX
)
207 ifeq ($(OS_ARCH
),OS2
)
208 DEF_FILE
:= $(SHARED_LIBRARY
:.dll
=.def
)
214 endif # FORCE_SHARED_LIB
217 ifdef FORCE_STATIC_LIB
218 ifndef FORCE_SHARED_LIB
219 SHARED_LIBRARY
:= $(NULL
)
221 IMPORT_LIBRARY
:= $(NULL
)
225 ifdef FORCE_SHARED_LIB
226 ifndef FORCE_STATIC_LIB
231 ifeq ($(OS_ARCH
),WINNT
)
235 # Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
236 # directory. For parallel builds, this PDB file is shared and locked by
237 # MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
238 # without SP1, don't do parallel builds.
240 # The final PDB for libraries and programs is created by the linker and uses
241 # a different name from the single PDB file created by the compiler. See
245 ifdef SIMPLE_PROGRAMS
246 COMPILE_PDBFILE
= $(basename $(@F
)).pdb
248 COMPILE_PDBFILE
= generated.pdb
251 LINK_PDBFILE
= $(basename $(@F
)).pdb
253 CODFILE
=$(basename $(@F
)).cod
257 OS_LDFLAGS
+= -DEF
:$(call normalizepath
,$(DEFFILE
))
258 EXTRA_DEPS
+= $(DEFFILE
)
264 OS_LDFLAGS
+= $(call normalizepath
,$(DEFFILE
))
265 EXTRA_DEPS
+= $(DEFFILE
)
272 ifeq ($(SOLARIS_SUNPRO_CXX
),1)
273 ifeq (86,$(findstring 86,$(OS_TEST
)))
274 OS_LDFLAGS
+= -M
$(topsrcdir
)/config
/solaris_ia32.map
276 endif # Solaris Sun Studio C++
278 ifeq ($(HOST_OS_ARCH
),WINNT
)
279 HOST_PDBFILE
=$(basename $(@F
)).pdb
282 # Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
283 ifdef MOZ_PROFILE_GENERATE
284 EXCLUDED_OBJS
:= $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.
$(OBJ_SUFFIX
))
288 ifdef COMPILE_ENVIRONMENT
290 TARGETS
= $(LIBRARY
) $(SHARED_LIBRARY
) $(PROGRAM
) $(SIMPLE_PROGRAMS
) $(HOST_LIBRARY
) $(HOST_PROGRAM
) $(HOST_SIMPLE_PROGRAMS
)
293 COBJS
= $(notdir $(CSRCS
:.c
=.
$(OBJ_SUFFIX
)))
294 SOBJS
= $(notdir $(SSRCS
:.S
=.
$(OBJ_SUFFIX
)))
295 # CPPSRCS can have different extensions (eg: .cpp, .cc)
296 CPPOBJS
= $(notdir $(addsuffix .
$(OBJ_SUFFIX
),$(basename $(CPPSRCS
))))
297 CMOBJS
= $(notdir $(CMSRCS
:.m
=.
$(OBJ_SUFFIX
)))
298 CMMOBJS
= $(notdir $(CMMSRCS
:.mm
=.
$(OBJ_SUFFIX
)))
299 ASOBJS
= $(notdir $(ASFILES
:.
$(ASM_SUFFIX
)=.
$(OBJ_SUFFIX
)))
301 _OBJS
= $(COBJS
) $(SOBJS
) $(CPPOBJS
) $(CMOBJS
) $(CMMOBJS
) $(ASOBJS
)
302 OBJS
= $(strip $(_OBJS
))
305 HOST_COBJS
= $(addprefix host_
,$(notdir $(HOST_CSRCS
:.c
=.
$(OBJ_SUFFIX
))))
306 # HOST_CPPOBJS can have different extensions (eg: .cpp, .cc)
307 HOST_CPPOBJS
= $(addprefix host_
,$(notdir $(addsuffix .
$(OBJ_SUFFIX
),$(basename $(HOST_CPPSRCS
)))))
308 HOST_CMOBJS
= $(addprefix host_
,$(notdir $(HOST_CMSRCS
:.m
=.
$(OBJ_SUFFIX
))))
309 HOST_CMMOBJS
= $(addprefix host_
,$(notdir $(HOST_CMMSRCS
:.mm
=.
$(OBJ_SUFFIX
))))
311 _HOST_OBJS
= $(HOST_COBJS
) $(HOST_CPPOBJS
) $(HOST_CMOBJS
) $(HOST_CMMOBJS
)
312 HOST_OBJS
= $(strip $(_HOST_OBJS
))
323 HOST_SIMPLE_PROGRAMS
:=
324 SDK_BINARY
:= $(filter %.py
,$(SDK_BINARY
))
329 $(GARBAGE
) $(TARGETS
) $(OBJS
) $(PROGOBJS
) LOGS TAGS a.out \
330 $(filter-out $(ASFILES
),$(OBJS
:.
$(OBJ_SUFFIX
)=.s
)) $(OBJS
:.
$(OBJ_SUFFIX
)=.ii
) \
331 $(OBJS
:.
$(OBJ_SUFFIX
)=.i
) $(OBJS
:.
$(OBJ_SUFFIX
)=.i_o
) \
332 $(HOST_PROGOBJS
) $(HOST_OBJS
) $(IMPORT_LIBRARY
) $(DEF_FILE
)\
333 $(EXE_DEF_FILE
) so_locations _gen _stubs
$(wildcard *.res
) $(wildcard *.RES
) \
334 $(wildcard *.pdb
) $(CODFILE
) $(IMPORT_LIBRARY
) \
335 $(SHARED_LIBRARY
:$(DLL_SUFFIX
)=.exp
) $(wildcard *.ilk
) \
336 $(PROGRAM
:$(BIN_SUFFIX
)=.exp
) $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.exp
) \
337 $(PROGRAM
:$(BIN_SUFFIX
)=.lib
) $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.lib
) \
338 $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.
$(OBJ_SUFFIX
)) \
339 $(wildcard gts_tmp_
*) $(LIBRARY
:%.a
=.
%.timestamp
)
341 $(GARBAGE_DIRS
) /no-such-file
344 GARBAGE
+= $(MOCSRCS
)
347 ifdef SIMPLE_PROGRAMS
348 GARBAGE
+= $(SIMPLE_PROGRAMS
:%=%.
$(OBJ_SUFFIX
))
351 ifdef HOST_SIMPLE_PROGRAMS
352 GARBAGE
+= $(HOST_SIMPLE_PROGRAMS
:%=%.
$(OBJ_SUFFIX
))
356 # the Solaris WorkShop template repository cache. it occasionally can get
357 # out of sync, so targets like clobber should kill it.
359 ifeq ($(SOLARIS_SUNPRO_CXX
),1)
360 GARBAGE_DIRS
+= SunWS_cache
363 ifdef MOZ_UPDATE_XTERM
364 # Its good not to have a newline at the end of the titlebar string because it
365 # makes the make -s output easier to read. Echo -n does not work on all
366 # platforms, but we can trick printf into doing it.
367 UPDATE_TITLE
= printf
'\033]0;%s in %s\007' $(1) $(relativesrcdir
)/$(2) ;
371 ifndef NO_BUILDSTATUS_MESSAGES
373 @echo
'BUILDSTATUS $1'
379 define SUBMAKE
# $(call SUBMAKE,target,directory,static)
381 +$(MAKE
) $(if
$(2),-C
$(2)) $(1)
383 endef # The extra line is important here! don't delete it
385 define TIER_DIR_SUBMAKE
386 $(call BUILDSTATUS
,TIERDIR_START
$(1) $(2) $(3))
387 $(call SUBMAKE
,$(4),$(3),$(5))
388 $(call BUILDSTATUS
,TIERDIR_FINISH
$(1) $(2) $(3))
390 endef # Ths empty line is important.
392 ifneq (,$(strip $(DIRS
)))
394 $(foreach dir,$(DIRS
),$(call SUBMAKE
,$@
,$(dir)))
397 # we only use this for the makefiles target and other stuff that doesn't matter
398 ifneq (,$(strip $(PARALLEL_DIRS
)))
399 LOOP_OVER_PARALLEL_DIRS
= \
400 $(foreach dir,$(PARALLEL_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
403 ifneq (,$(strip $(TOOL_DIRS
)))
404 LOOP_OVER_TOOL_DIRS
= \
405 $(foreach dir,$(TOOL_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
409 # Now we can differentiate between objects used to build a library, and
410 # objects used to build an executable in the same directory.
417 HOST_PROGOBJS
= $(HOST_OBJS
)
420 GARBAGE_DIRS
+= $(wildcard $(CURDIR
)/$(MDDEPDIR
))
423 # Tags: emacs (etags), vi (ctags)
424 # TAG_PROGRAM := ctags -L -
426 TAG_PROGRAM
= xargs etags
-a
429 # Turn on C++ linking if we have any .cpp or .mm files
430 # (moved this from config.mk so that config.mk can be included
431 # before the CPPSRCS are defined)
433 ifneq ($(HOST_CPPSRCS
)$(HOST_CMMSRCS
),)
434 HOST_CPP_PROG_LINK
= 1
438 # This will strip out symbols that the component should not be
439 # exporting from the .dynsym section.
442 EXTRA_DSO_LDOPTS
+= $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
)
446 # MacOS X specific stuff
449 ifeq ($(OS_ARCH
),Darwin
)
452 EXTRA_DSO_LDOPTS
+= -bundle
454 EXTRA_DSO_LDOPTS
+= -dynamiclib
-install_name @executable_path
/$(SHARED_LIBRARY
) -compatibility_version
1 -current_version
1 -single_module
460 # On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be
461 # fatal symbol name clashes between components.
463 ifeq ($(OS_ARCH
),NetBSD
)
464 ifeq ($(DLL_SUFFIX
),.so
.1.0)
466 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
471 ifeq ($(OS_ARCH
),FreeBSD
)
473 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
477 ifeq ($(OS_ARCH
),NetBSD
)
478 ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips
,$(OS_TEST
)))
479 ifneq (,$(filter layout
/%,$(relativesrcdir
)))
480 OS_CFLAGS
+= -Wa
,-xgot
481 OS_CXXFLAGS
+= -Wa
,-xgot
487 # HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
488 # which uses internal symbols first
490 ifeq ($(OS_ARCH
),HP-UX
)
492 ifeq ($(GNU_CC
)$(GNU_CXX
),)
493 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
494 ifneq ($(HAS_EXTRAEXPORTS
),1)
495 MKSHLIB
+= -Wl
,+eNSGetModule
-Wl
,+eerrno
496 MKCSHLIB
+= +eNSGetModule
+eerrno
497 ifneq ($(OS_TEST
),ia64
)
498 MKSHLIB
+= -Wl
,+e_shlInit
499 MKCSHLIB
+= +e_shlInit
501 endif # !HAS_EXTRAEXPORTS
502 endif # non-gnu compilers
506 ifeq ($(OS_ARCH
),AIX
)
508 ifneq ($(HAS_EXTRAEXPORTS
),1)
509 MKSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
510 MKCSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
511 endif # HAS_EXTRAEXPORTS
516 # Linux: add -Bsymbolic flag for components
518 ifeq ($(OS_ARCH
),Linux
)
520 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
525 # GNU doesn't have path length limitation
528 ifeq ($(OS_ARCH
),GNU
)
529 OS_CPPFLAGS
+= -DPATH_MAX
=1024 -DMAXPATHLEN
=1024
535 ifeq ($(OS_ARCH
),WINNT
)
538 DSO_LDOPTS
+= -Wl
,--out-implib
-Wl
,$(IMPORT_LIBRARY
)
551 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
553 PREPROCESS_OPTION
= -P
-Fi
# eol
556 PREPROCESS_OPTION
= -E
-o
#eol
557 endif # WINNT && !GNU_CC
559 ifneq (,$(filter ml
%,$(AS
)))
560 ASOUTOPTION
= -Fo
# eol
562 ASOUTOPTION
= -o
# eol
565 ifeq (,$(CROSS_COMPILE
))
566 HOST_OUTOPTION
= $(OUTOPTION
)
568 HOST_OUTOPTION
= -o
# eol
570 ################################################################################
572 # Ensure the build config is up to date. This is done automatically when builds
573 # are performed through |mach build|. The check here is to catch people not
574 # using mach. If we ever enforce builds through mach, this code can be removed.
575 ifndef MOZBUILD_BACKEND_CHECKED
577 ifndef TOPLEVEL_BUILD
578 $(DEPTH
)/backend.RecursiveMakeBackend
:
579 $(error Build configuration changed. Build with |mach build| or run |mach build-backend| to regenerate build config
)
581 include $(DEPTH
)/backend.RecursiveMakeBackend.pp
583 default
:: $(DEPTH
)/backend.RecursiveMakeBackend
585 export MOZBUILD_BACKEND_CHECKED
=1
590 # The root makefile doesn't want to do a plain export/libs, because
591 # of the tiers and because of libxul. Suppress the default rules in favor
592 # of something else. Makefiles which use this var *must* provide a sensible
593 # default rule before including rules.mk
594 ifndef SUPPRESS_DEFAULT_RULES
597 ifdef MOZ_PSEUDO_DERECURSE
598 ifdef COMPILE_ENVIRONMENT
604 endif # SUPPRESS_DEFAULT_RULES
606 ifeq ($(findstring s
,$(filter-out --%, $(MAKEFLAGS
))),)
614 # Do everything from scratch
619 ifneq (,$(filter-out %.
$(LIB_SUFFIX
),$(SHARED_LIBRARY_LIBS
)))
620 $(error SHARED_LIBRARY_LIBS must contain .
$(LIB_SUFFIX
) files only
)
623 HOST_LIBS_DEPS
= $(filter %.
$(LIB_SUFFIX
),$(HOST_LIBS
))
625 # Dependencies which, if modified, should cause everything to rebuild
626 GLOBAL_DEPS
+= Makefile
$(DEPTH
)/config
/autoconf.mk
$(topsrcdir
)/config
/config.mk
628 ##############################################
629 ifdef COMPILE_ENVIRONMENT
630 OBJ_TARGETS
= $(OBJS
) $(PROGOBJS
) $(HOST_OBJS
) $(HOST_PROGOBJS
)
632 compile
:: $(OBJ_TARGETS
)
634 include $(topsrcdir
)/config
/makefiles
/target_binaries.mk
638 # One would think "tools:: libs" would work, but it turns out that combined with
639 # bug 907365, this makes make forget to run some rules sometimes.
644 ##############################################
645 ifndef NO_PROFILE_GUIDED_OPTIMIZE
646 ifdef MOZ_PROFILE_USE
647 ifeq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
648 # When building with PGO, we have to make sure to re-link
649 # in the MOZ_PROFILE_USE phase if we linked in the
650 # MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
651 # file in the link rule in the GENERATE phase to indicate
652 # that we need a relink.
654 $(SHARED_LIBRARY
): pgo.relink
657 $(PROGRAM
): pgo.relink
660 # In the second pass, we need to merge the pgc files into the pgd file.
661 # The compiler would do this for us automatically if they were in the right
662 # place, but they're in dist/bin.
663 ifneq (,$(SHARED_LIBRARY
)$(PROGRAM
))
666 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
667 $(PROGRAM
:$(BIN_SUFFIX
)=) $(DIST
)/bin
670 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
671 $(SHARED_LIBRARY_NAME
) $(DIST
)/bin
673 endif # SHARED_LIBRARY || PROGRAM
675 endif # MOZ_PROFILE_USE
676 ifdef MOZ_PROFILE_GENERATE
677 # Clean up profiling data during PROFILE_GENERATE phase
679 ifeq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
680 $(foreach pgd
,$(wildcard *.pgd
),pgomgr
-clear
$(pgd
);)
688 ifneq (,$(MOZ_PROFILE_GENERATE
)$(MOZ_PROFILE_USE
))
690 # Force rebuilding libraries and programs in both passes because each
691 # pass uses different object files.
692 $(PROGRAM
) $(SHARED_LIBRARY
) $(LIBRARY
): FORCE
696 endif # NO_PROFILE_GUIDED_OPTIMIZE
698 ##############################################
701 $(MAKE
) -C
$(topsrcdir
) -f client.mk checkout
703 clean clobber realclean clobber_all
::
705 -$(RM
) -r
$(ALL_TRASH_DIRS
)
708 clean clobber realclean clobber_all
distclean::
710 $(foreach tier
, $(TIERS
), $(tier_
$(tier
)_staticdirs
) $(tier_
$(tier
)_dirs
)), \
711 -$(call SUBMAKE
,$@
,$(dir)))
713 clean clobber realclean clobber_all
distclean::
714 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
717 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
721 -$(RM
) -r
$(ALL_TRASH_DIRS
)
722 -$(RM
) $(ALL_TRASH
) \
723 Makefile .HSancillary \
724 $(wildcard *.
$(OBJ_SUFFIX
)) $(wildcard *.ho
) $(wildcard host_
*.o
*) \
725 $(wildcard *.
$(LIB_SUFFIX
)) $(wildcard *$(DLL_SUFFIX
)) \
726 $(wildcard *.
$(IMPORT_LIB_SUFFIX
))
727 ifeq ($(OS_ARCH
),OS2
)
728 -$(RM
) $(PROGRAM
:.exe
=.map
)
733 find
$(topsrcdir
) -name
dist -prune
-o \
( -name
'*.[hc]' -o
-name
'*.cp' -o
-name
'*.cpp' -o
-name
'*.idl' \
) -print |
$(TAG_PROGRAM
)
737 # creates OBJS, links with LIBS to create Foo
739 $(PROGRAM
): $(PROGOBJS
) $(EXTRA_DEPS
) $(EXE_DEF_FILE
) $(RESFILE
) $(GLOBAL_DEPS
)
742 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
743 $(EXPAND_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(LINK_PDBFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(MOZ_GLUE_PROGRAM_LDFLAGS
) $(PROGOBJS
) $(RESFILE
) $(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
)
744 ifdef MSMANIFEST_TOOL
745 @if
test -f
$@.manifest
; then \
746 if
test -f
'$(srcdir)/$@.manifest'; then \
747 echo
'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
748 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
750 echo
'Embedding manifest from $@.manifest'; \
751 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
753 elif
test -f
'$(srcdir)/$@.manifest'; then \
754 echo
'Embedding manifest from $(srcdir)/$@.manifest'; \
755 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE
:$@\
;1; \
757 endif # MSVC with manifest tool
758 ifdef MOZ_PROFILE_GENERATE
759 # touch it a few seconds into the future to work around FAT's
760 # 2-second granularity
761 touch
-t
`date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
763 else # !WINNT || GNU_CC
764 $(EXPAND_CCC
) -o
$@
$(CXXFLAGS
) $(PROGOBJS
) $(RESFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(WRAP_LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(MOZ_GLUE_PROGRAM_LDFLAGS
) $(OS_LIBS
) $(EXTRA_LIBS
) $(BIN_FLAGS
) $(EXE_DEF_FILE
) $(STLPORT_LIBS
)
765 @
$(call CHECK_STDCXX
,$@
)
766 endif # WINNT && !GNU_CC
769 $(STRIP
) $(STRIP_FLAGS
) $@
771 ifdef MOZ_POST_PROGRAM_COMMAND
772 $(MOZ_POST_PROGRAM_COMMAND
) $@
775 $(HOST_PROGRAM
): $(HOST_PROGOBJS
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
777 ifeq (_WINNT
,$(GNU_CC
)_
$(HOST_OS_ARCH
))
778 $(EXPAND_LIBS_EXEC
) -- $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $(HOST_OBJS
) $(WIN32_EXE_LDFLAGS
) $(HOST_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
779 ifdef MSMANIFEST_TOOL
780 @if
test -f
$@.manifest
; then \
781 if
test -f
'$(srcdir)/$@.manifest'; then \
782 echo
'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
783 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
785 echo
'Embedding manifest from $@.manifest'; \
786 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
788 elif
test -f
'$(srcdir)/$@.manifest'; then \
789 echo
'Embedding manifest from $(srcdir)/$@.manifest'; \
790 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE
:$@\
;1; \
792 endif # MSVC with manifest tool
794 ifeq ($(HOST_CPP_PROG_LINK
),1)
795 $(EXPAND_LIBS_EXEC
) -- $(HOST_CXX
) -o
$@
$(HOST_CXXFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
797 $(EXPAND_LIBS_EXEC
) -- $(HOST_CC
) -o
$@
$(HOST_CFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
798 endif # HOST_CPP_PROG_LINK
802 # This is an attempt to support generation of multiple binaries
803 # in one directory, it assumes everything to compile Foo is in
804 # Foo.o (from either Foo.c or Foo.cpp).
806 # SIMPLE_PROGRAMS = Foo Bar
807 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
809 $(SIMPLE_PROGRAMS
): %$(BIN_SUFFIX
): %.
$(OBJ_SUFFIX
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
811 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
812 $(EXPAND_LD
) -nologo
-out
:$@
-pdb
:$(LINK_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(MOZ_GLUE_PROGRAM_LDFLAGS
) $(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
)
813 ifdef MSMANIFEST_TOOL
814 @if
test -f
$@.manifest
; then \
815 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
818 endif # MSVC with manifest tool
820 $(EXPAND_CCC
) $(CXXFLAGS
) -o
$@
$< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(WRAP_LDFLAGS
) $(LIBS_DIR
) $(LIBS
) $(MOZ_GLUE_PROGRAM_LDFLAGS
) $(OS_LIBS
) $(EXTRA_LIBS
) $(BIN_FLAGS
) $(STLPORT_LIBS
)
821 @
$(call CHECK_STDCXX
,$@
)
822 endif # WINNT && !GNU_CC
825 $(STRIP
) $(STRIP_FLAGS
) $@
827 ifdef MOZ_POST_PROGRAM_COMMAND
828 $(MOZ_POST_PROGRAM_COMMAND
) $@
831 $(HOST_SIMPLE_PROGRAMS
): host_
%$(HOST_BIN_SUFFIX
): host_
%.
$(OBJ_SUFFIX
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
833 ifeq (WINNT_
,$(HOST_OS_ARCH
)_
$(GNU_CC
))
834 $(EXPAND_LIBS_EXEC
) -- $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
836 ifneq (,$(HOST_CPPSRCS
)$(USE_HOST_CXX
))
837 $(EXPAND_LIBS_EXEC
) -- $(HOST_CXX
) $(HOST_OUTOPTION
)$@
$(HOST_CXXFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
839 $(EXPAND_LIBS_EXEC
) -- $(HOST_CC
) $(HOST_OUTOPTION
)$@
$(HOST_CFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
843 ifdef DTRACE_PROBE_OBJ
844 EXTRA_DEPS
+= $(DTRACE_PROBE_OBJ
)
845 OBJS
+= $(DTRACE_PROBE_OBJ
)
848 $(filter %.
$(LIB_SUFFIX
),$(LIBRARY
)): $(OBJS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
851 $(EXPAND_AR
) $(AR_FLAGS
) $(OBJS
) $(SHARED_LIBRARY_LIBS
)
853 $(filter-out %.
$(LIB_SUFFIX
),$(LIBRARY
)): $(filter %.
$(LIB_SUFFIX
),$(LIBRARY
)) $(OBJS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
854 # When we only build a library descriptor, blow out any existing library
856 $(if
$(filter %.
$(LIB_SUFFIX
),$(LIBRARY
)),,$(RM
) $(REAL_LIBRARY
) $(EXPORT_LIBRARY
:%=%/$(REAL_LIBRARY
)))
857 $(EXPAND_LIBS_GEN
) -o
$@
$(OBJS
) $(SHARED_LIBRARY_LIBS
)
859 ifeq ($(OS_ARCH
),WINNT
)
860 # Import libraries are created by the rules creating shared libraries.
861 # The rules to copy them to $(DIST)/lib depend on $(IMPORT_LIBRARY),
862 # but make will happily consider the import library before it is refreshed
863 # when rebuilding the corresponding shared library. Defining an empty recipe
864 # for import libraries forces make to wait for the shared library recipe to
865 # have run before considering other targets that depend on the import library.
867 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
) ;
870 ifeq ($(OS_ARCH
),OS2
)
871 $(DEF_FILE
): $(OBJS
) $(SHARED_LIBRARY_LIBS
)
873 echo LIBRARY
$(SHARED_LIBRARY_NAME
) INITINSTANCE TERMINSTANCE
> $@
875 echo CODE LOADONCALL MOVEABLE DISCARDABLE
>> $@
876 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED
>> $@
881 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
)
887 $(HOST_LIBRARY
): $(HOST_OBJS
) Makefile
890 $(EXPAND_LIBS_EXEC
) --extract
-- $(HOST_AR
) $(HOST_AR_FLAGS
) $(HOST_OBJS
)
894 ifdef DTRACE_PROBE_OBJ
895 ifndef DTRACE_LIB_DEPENDENT
896 NON_DTRACE_OBJS
:= $(filter-out $(DTRACE_PROBE_OBJ
),$(OBJS
))
897 $(DTRACE_PROBE_OBJ
): $(NON_DTRACE_OBJS
)
898 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(NON_DTRACE_OBJS
)
904 # On Darwin (Mac OS X), dwarf2 debugging uses debug info left in .o files,
905 # so instead of deleting .o files after repacking them into a dylib, we make
906 # symlinks back to the originals. The symlinks are a no-op for stabs debugging,
907 # so no need to conditionalize on OS version or debugging format.
909 $(SHARED_LIBRARY
): $(OBJS
) $(DEF_FILE
) $(RESFILE
) $(LIBRARY
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
911 ifndef INCREMENTAL_LINKER
914 ifdef DTRACE_LIB_DEPENDENT
916 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(shell $(EXPAND_LIBS
) $(MOZILLA_PROBE_LIBS
))
918 $(EXPAND_MKSHLIB
) $(SHLIB_LDSTARTFILE
) $(OBJS
) $(SUB_SHLOBJS
) $(DTRACE_PROBE_OBJ
) $(MOZILLA_PROBE_LIBS
) $(RESFILE
) $(LDFLAGS
) $(WRAP_LDFLAGS
) $(SHARED_LIBRARY_LIBS
) $(EXTRA_DSO_LDOPTS
) $(MOZ_GLUE_LDFLAGS
) $(OS_LIBS
) $(EXTRA_LIBS
) $(DEF_FILE
) $(SHLIB_LDENDFILE
) $(if
$(LIB_IS_C_ONLY
),,$(STLPORT_LIBS
))
919 @
$(RM
) $(DTRACE_PROBE_OBJ
)
920 else # ! DTRACE_LIB_DEPENDENT
921 $(EXPAND_MKSHLIB
) $(SHLIB_LDSTARTFILE
) $(OBJS
) $(SUB_SHLOBJS
) $(RESFILE
) $(LDFLAGS
) $(WRAP_LDFLAGS
) $(SHARED_LIBRARY_LIBS
) $(EXTRA_DSO_LDOPTS
) $(MOZ_GLUE_LDFLAGS
) $(OS_LIBS
) $(EXTRA_LIBS
) $(DEF_FILE
) $(SHLIB_LDENDFILE
) $(if
$(LIB_IS_C_ONLY
),,$(STLPORT_LIBS
))
922 endif # DTRACE_LIB_DEPENDENT
923 @
$(call CHECK_STDCXX
,$@
)
925 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
926 ifdef MSMANIFEST_TOOL
927 ifdef EMBED_MANIFEST_AT
928 @if
test -f
$@.manifest
; then \
929 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;$(EMBED_MANIFEST_AT
); \
932 endif # EMBED_MANIFEST_AT
933 endif # MSVC with manifest tool
934 ifdef MOZ_PROFILE_GENERATE
935 touch
-t
`date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
937 endif # WINNT && !GCC
938 @
$(RM
) foodummyfilefoo
$(DELETE_AFTER_LINK
)
941 $(STRIP
) $(STRIP_FLAGS
) $@
943 ifdef MOZ_POST_DSO_LIB_COMMAND
944 $(MOZ_POST_DSO_LIB_COMMAND
) $@
947 ifeq ($(SOLARIS_SUNPRO_CC
),1)
948 _MDDEPFILE
= $(MDDEPDIR
)/$(@F
).pp
950 define MAKE_DEPS_AUTO_CC
951 if
test -d
$(@D
); then \
952 echo
'Building deps for $< using Sun Studio cc'; \
953 $(CC
) $(COMPILE_CFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
954 $(PYTHON
) $(topsrcdir
)/build
/unix
/add_phony_targets.py
$(_MDDEPFILE
) ; \
957 define MAKE_DEPS_AUTO_CXX
958 if
test -d
$(@D
); then \
959 echo
'Building deps for $< using Sun Studio CC'; \
960 $(CXX
) $(COMPILE_CXXFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
961 $(PYTHON
) $(topsrcdir
)/build
/unix
/add_phony_targets.py
$(_MDDEPFILE
) ; \
964 endif # Sun Studio on Solaris
966 # The object file is in the current directory, and the source file can be any
967 # relative path. This macro adds the dependency obj: src for each source file.
968 # This dependency must be first for the $< flag to work correctly, and the
969 # rules that have commands for these targets must not list any other
970 # prerequisites, or they will override the $< variable.
972 $(basename $2$(notdir $1)).
$(OBJ_SUFFIX
): $1 $$(call mkdir_deps
,$$(MDDEPDIR
))
974 $(foreach f
,$(CSRCS
) $(SSRCS
) $(CPPSRCS
) $(CMSRCS
) $(CMMSRCS
) $(ASFILES
),$(eval
$(call src_objdep
,$(f
))))
975 $(foreach f
,$(HOST_CSRCS
) $(HOST_CPPSRCS
) $(HOST_CMSRCS
) $(HOST_CMMSRCS
),$(eval
$(call src_objdep
,$(f
),host_
)))
977 $(OBJS
) $(HOST_OBJS
) $(PROGOBJS
) $(HOST_PROGOBJS
): $(GLOBAL_DEPS
)
979 # Rules for building native targets must come first because of the host_ prefix
982 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
986 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
990 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(HOST_CMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
994 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(HOST_CMMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
998 @
$(MAKE_DEPS_AUTO_CC
)
999 $(ELOG
) $(CC
) $(OUTOPTION
)$@
-c
$(COMPILE_CFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1001 # DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
1002 # 'moc' only knows about #defines it gets on the command line (-D...), not in
1003 # included headers like mozilla-config.h
1004 $(filter moc_
%.
cpp,$(CPPSRCS
)): moc_
%.
cpp: %.h
1006 $(ELOG
) $(MOC
) $(DEFINES
) $(ACDEFINES
) $< $(OUTOPTION
)$@
1008 $(filter moc_
%.
cc,$(CPPSRCS
)): moc_
%.
cc: %.
cc
1010 $(ELOG
) $(MOC
) $(DEFINES
) $(ACDEFINES
) $(_VPATH_SRCS
:.
cc=.h
) $(OUTOPTION
)$@
1012 $(filter qrc_
%.
cpp,$(CPPSRCS
)): qrc_
%.
cpp: %.qrc
1014 $(ELOG
) $(RCC
) -name
$* $< $(OUTOPTION
)$@
1017 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
1021 $(AS
) $(ASOUTOPTION
)$@
$(ASFLAGS
) $(AS_DASH_C_FLAG
) $(_VPATH_SRCS
)
1026 $(AS
) -o
$@
$(ASFLAGS
) $(LOCAL_INCLUDES
) $(TARGET_LOCAL_INCLUDES
) -c
$<
1030 @
$(MAKE_DEPS_AUTO_CXX
)
1031 $(ELOG
) $(CCC
) $(OUTOPTION
)$@
-c
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1035 @
$(MAKE_DEPS_AUTO_CXX
)
1036 $(ELOG
) $(CCC
) -o
$@
-c
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1040 @
$(MAKE_DEPS_AUTO_CC
)
1041 $(ELOG
) $(CC
) -o
$@
-c
$(COMPILE_CFLAGS
) $(COMPILE_CMFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1043 $(filter %.s
,$(CPPSRCS
:%.
cpp=%.s
)): %.s
: %.
cpp $(call mkdir_deps
,$(MDDEPDIR
))
1045 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1047 $(filter %.s
,$(CPPSRCS
:%.
cc=%.s
)): %.s
: %.
cc $(call mkdir_deps
,$(MDDEPDIR
))
1049 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1051 $(filter %.s
,$(CSRCS
:%.c
=%.s
)): %.s
: %.c
$(call mkdir_deps
,$(MDDEPDIR
))
1053 $(CC
) -S
$(COMPILE_CFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1055 $(filter %.i
,$(CPPSRCS
:%.
cpp=%.i
)): %.i
: %.
cpp $(call mkdir_deps
,$(MDDEPDIR
))
1057 $(CCC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1059 $(filter %.i
,$(CPPSRCS
:%.
cc=%.i
)): %.i
: %.
cc $(call mkdir_deps
,$(MDDEPDIR
))
1061 $(CCC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1063 $(filter %.i
,$(CSRCS
:%.c
=%.i
)): %.i
: %.c
$(call mkdir_deps
,$(MDDEPDIR
))
1065 $(CC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1067 $(filter %.i
,$(CMMSRCS
:%.mm
=%.i
)): %.i
: %.mm
$(call mkdir_deps
,$(MDDEPDIR
))
1069 $(CCC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1071 $(RESFILE
): %.res
: %.rc
1073 @echo Creating Resource file
: $@
1074 ifeq ($(OS_ARCH
),OS2
)
1075 $(RC
) $(RCFLAGS
:-D
%=-d
%) -i
$(subst /,\
,$(srcdir)) -r
$< $@
1078 $(RC
) $(RCFLAGS
) $(filter-out -U
%,$(DEFINES
)) $(INCLUDES
:-I
%=--include-dir
%) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1080 $(RC
) $(RCFLAGS
) -r
$(DEFINES
) $(INCLUDES
) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1084 # Cancel GNU make built-in implicit rules
1089 ifneq (,$(filter OS2 WINNT
,$(OS_ARCH
)))
1096 SPACE
:= $(EMPTY
) $(EMPTY
)
1098 # MSYS has its own special path form, but javac expects the source and class
1099 # paths to be in the DOS form (i.e. e:/builds/...). This function does the
1100 # appropriate conversion on Windows, but is a noop on other systems.
1101 ifeq ($(HOST_OS_ARCH
),WINNT
)
1102 # We use 'pwd -W' to get DOS form of the path. However, since the given path
1103 # could be a file or a non-existent path, we cannot call 'pwd -W' directly
1104 # on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
1105 # on it, then merge with the rest of the path.
1106 root-path
= $(shell echo
$(1) | sed
-e
's|\(/[^/]*\)/\?\(.*\)|\1|')
1107 non-root-path
= $(shell echo
$(1) | sed
-e
's|\(/[^/]*\)/\?\(.*\)|\2|')
1108 normalizepath
= $(foreach p
,$(1),$(if
$(filter /%,$(1)),$(patsubst %/,%,$(shell cd
$(call root-path
,$(1)) && pwd
-W
))/$(call non-root-path
,$(1)),$(1)))
1110 normalizepath
= $(1)
1113 ###############################################################################
1115 ###############################################################################
1116 ifneq (,$(JAVAFILES
)$(ANDROID_RESFILES
)$(ANDROID_APKNAME
)$(JAVA_JAR_TARGETS
))
1117 include $(topsrcdir
)/config
/makefiles
/java-build.mk
1120 ###############################################################################
1121 # Bunch of things that extend the 'export' rule (in order):
1122 ###############################################################################
1124 ifneq ($(XPI_NAME
),)
1128 export:: $(FINAL_TARGET
)
1131 ################################################################################
1132 # Copy each element of PREF_JS_EXPORTS
1134 # The default location for PREF_JS_EXPORTS is the gre prefs directory.
1135 PREF_DIR
= defaults
/pref
1137 # If DIST_SUBDIR is defined it indicates that app and gre dirs are
1138 # different and that we are building app related resources. Hence,
1139 # PREF_DIR should point to the app prefs location.
1140 ifneq (,$(DIST_SUBDIR
)$(XPI_NAME
)$(LIBXUL_SDK
))
1141 PREF_DIR
= defaults
/preferences
1144 # on win32, pref files need CRLF line endings... see bug 206029
1145 ifeq (WINNT
,$(OS_ARCH
))
1146 PREF_PPFLAGS
+= --line-endings
=crlf
1149 ifneq ($(PREF_JS_EXPORTS
),)
1150 ifndef NO_DIST_INSTALL
1151 PREF_JS_EXPORTS_PATH
:= $(FINAL_TARGET
)/$(PREF_DIR
)
1152 PREF_JS_EXPORTS_FLAGS
:= $(PREF_PPFLAGS
)
1153 PP_TARGETS
+= PREF_JS_EXPORTS
1157 ################################################################################
1158 # Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
1160 ifneq ($(AUTOCFG_JS_EXPORTS
),)
1161 ifndef NO_DIST_INSTALL
1162 AUTOCFG_JS_EXPORTS_FILES
:= $(AUTOCFG_JS_EXPORTS
)
1163 AUTOCFG_JS_EXPORTS_DEST
:= $(FINAL_TARGET
)/defaults
/autoconfig
1164 AUTOCFG_JS_EXPORTS_TARGET
:= export
1165 INSTALL_TARGETS
+= AUTOCFG_JS_EXPORTS
1169 ################################################################################
1170 # Install a linked .xpt into the appropriate place.
1171 # This should ideally be performed by the non-recursive idl make file. Some day.
1174 ifndef NO_DIST_INSTALL
1175 _XPT_NAME_FILES
:= $(DEPTH
)/config
/makefiles
/xpidl
/xpt
/$(XPT_NAME
)
1176 _XPT_NAME_DEST
:= $(FINAL_TARGET
)/components
1177 INSTALL_TARGETS
+= _XPT_NAME
1179 ifndef NO_INTERFACES_MANIFEST
1180 libs
:: $(call mkdir_deps
,$(FINAL_TARGET
)/components
)
1181 $(call py_action
,buildlist
,$(FINAL_TARGET
)/components
/interfaces.manifest
'interfaces $(XPT_NAME)')
1182 $(call py_action
,buildlist
,$(FINAL_TARGET
)/chrome.manifest
'manifest components/interfaces.manifest')
1188 ################################################################################
1189 # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
1190 ifneq (,$(filter %.js
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1191 ifeq (,$(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1192 ifndef NO_JS_MANIFEST
1193 $(error .js component without matching .manifest. See https
://developer.mozilla.org
/en
/XPCOM
/XPCOM_changes_in_Gecko_2.0
)
1198 ifdef EXTRA_COMPONENTS
1199 libs
:: $(EXTRA_COMPONENTS
)
1200 ifndef NO_DIST_INSTALL
1201 EXTRA_COMPONENTS_FILES
:= $(EXTRA_COMPONENTS
)
1202 EXTRA_COMPONENTS_DEST
:= $(FINAL_TARGET
)/components
1203 INSTALL_TARGETS
+= EXTRA_COMPONENTS
1208 ifdef EXTRA_PP_COMPONENTS
1209 ifndef NO_DIST_INSTALL
1210 EXTRA_PP_COMPONENTS_PATH
:= $(FINAL_TARGET
)/components
1211 PP_TARGETS
+= EXTRA_PP_COMPONENTS
1215 EXTRA_MANIFESTS
= $(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
))
1216 ifneq (,$(EXTRA_MANIFESTS
))
1217 libs
:: $(call mkdir_deps
,$(FINAL_TARGET
))
1218 $(call py_action
,buildlist
,$(FINAL_TARGET
)/chrome.manifest
$(patsubst %,'manifest components/%',$(notdir $(EXTRA_MANIFESTS
))))
1221 ################################################################################
1222 # Copy each element of EXTRA_JS_MODULES to
1223 # $(FINAL_TARGET)/$(JS_MODULES_PATH). JS_MODULES_PATH defaults to "modules"
1224 # if it is undefined.
1225 JS_MODULES_PATH ?
= modules
1226 FINAL_JS_MODULES_PATH
:= $(FINAL_TARGET
)/$(JS_MODULES_PATH
)
1228 ifdef EXTRA_JS_MODULES
1229 ifndef NO_DIST_INSTALL
1230 EXTRA_JS_MODULES_FILES
:= $(EXTRA_JS_MODULES
)
1231 EXTRA_JS_MODULES_DEST
:= $(FINAL_JS_MODULES_PATH
)
1232 INSTALL_TARGETS
+= EXTRA_JS_MODULES
1236 ifdef EXTRA_PP_JS_MODULES
1237 ifndef NO_DIST_INSTALL
1238 EXTRA_PP_JS_MODULES_PATH
:= $(FINAL_JS_MODULES_PATH
)
1239 PP_TARGETS
+= EXTRA_PP_JS_MODULES
1243 ################################################################################
1244 # Copy testing-only JS modules to appropriate destination.
1246 # For each file defined in TESTING_JS_MODULES, copy it to
1247 # objdir/_tests/modules/. If TESTING_JS_MODULE_DIR is defined, that path
1248 # wlll be appended to the output directory.
1251 ifdef TESTING_JS_MODULES
1252 testmodulesdir
= $(DEPTH
)/_tests
/modules
/$(TESTING_JS_MODULE_DIR
)
1254 GENERATED_DIRS
+= $(testmodulesdir
)
1256 ifndef NO_DIST_INSTALL
1257 TESTING_JS_MODULES_FILES
:= $(TESTING_JS_MODULES
)
1258 TESTING_JS_MODULES_DEST
:= $(testmodulesdir
)
1259 INSTALL_TARGETS
+= TESTING_JS_MODULES
1265 ################################################################################
1268 ifneq (,$(SDK_LIBRARY
))
1269 ifndef NO_DIST_INSTALL
1270 SDK_LIBRARY_FILES
:= $(SDK_LIBRARY
)
1271 SDK_LIBRARY_DEST
:= $(SDK_LIB_DIR
)
1272 INSTALL_TARGETS
+= SDK_LIBRARY
1276 ifneq (,$(strip $(SDK_BINARY
)))
1277 ifndef NO_DIST_INSTALL
1278 SDK_BINARY_FILES
:= $(SDK_BINARY
)
1279 SDK_BINARY_DEST
:= $(SDK_BIN_DIR
)
1280 INSTALL_TARGETS
+= SDK_BINARY
1284 ################################################################################
1287 JAR_MANIFEST
:= $(srcdir)/jar.mn
1291 $(LOOP_OVER_PARALLEL_DIRS
)
1293 $(LOOP_OVER_TOOL_DIRS
)
1295 $(FINAL_TARGET
)/chrome
: $(call mkdir_deps
,$(FINAL_TARGET
)/chrome
)
1297 ifneq (,$(wildcard $(JAR_MANIFEST
)))
1298 ifndef NO_DIST_INSTALL
1301 ifdef XPI_ROOT_APPID
1302 # For add-on packaging we may specify that an application
1303 # sub-dir should be added to the root chrome manifest with
1304 # a specific application id.
1305 MAKE_JARS_FLAGS
+= --root-manifest-entry-appid
='$(XPI_ROOT_APPID)'
1308 # if DIST_SUBDIR is defined but XPI_ROOT_APPID is not there's
1309 # no way langpacks will get packaged right, so error out.
1310 ifneq (,$(DIST_SUBDIR
))
1311 ifndef XPI_ROOT_APPID
1312 $(error XPI_ROOT_APPID is not defined
- langpacks will break.
)
1317 libs realchrome
:: $(FINAL_TARGET
)/chrome
1318 $(call py_action
,jar_maker
,\
1319 $(QUIET
) -j
$(FINAL_TARGET
)/chrome \
1320 $(MAKE_JARS_FLAGS
) $(XULPPFLAGS
) $(DEFINES
) $(ACDEFINES
) \
1326 ifneq ($(DIST_FILES
),)
1327 DIST_FILES_PATH
:= $(FINAL_TARGET
)
1328 DIST_FILES_FLAGS
:= $(XULAPP_DEFINES
)
1329 PP_TARGETS
+= DIST_FILES
1332 ifneq ($(DIST_CHROME_FILES
),)
1333 DIST_CHROME_FILES_PATH
:= $(FINAL_TARGET
)/chrome
1334 DIST_CHROME_FILES_FLAGS
:= $(XULAPP_DEFINES
)
1335 PP_TARGETS
+= DIST_CHROME_FILES
1338 ifneq ($(XPI_PKGNAME
),)
1342 @echo
'Stripping $(XPI_PKGNAME) package directory...'
1343 @echo
$(FINAL_TARGET
)
1344 @cd
$(FINAL_TARGET
) && find .
! -type d \
1354 ! -name
'*.properties' \
1365 $(PLATFORM_EXCLUDE_LIST
) \
1366 -exec
$(STRIP
) $(STRIP_FLAGS
) {} >/dev
/null
2>&1 \
;
1369 @echo
'Packaging $(XPI_PKGNAME).xpi...'
1370 cd
$(FINAL_TARGET
) && $(ZIP
) -qr ..
/$(XPI_PKGNAME
).xpi
*
1373 ifdef INSTALL_EXTENSION_ID
1375 $(error XPI_NAME must be set for INSTALL_EXTENSION_ID
)
1379 $(RM
) -r
'$(DIST)/bin$(DIST_SUBDIR:%=/%)/extensions/$(INSTALL_EXTENSION_ID)'
1380 $(NSINSTALL
) -D
'$(DIST)/bin$(DIST_SUBDIR:%=/%)/extensions/$(INSTALL_EXTENSION_ID)'
1381 $(call copy_dir
,$(FINAL_TARGET
),$(DIST
)/bin
$(DIST_SUBDIR
:%=/%)/extensions
/$(INSTALL_EXTENSION_ID
))
1385 #############################################################################
1386 # MDDEPDIR is the subdirectory where all the dependency files are placed.
1387 # This uses a make rule (instead of a macro) to support parallel
1388 # builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
1389 # processes could simultaneously try to create the same directory.
1391 # We use $(CURDIR) in the rule's target to ensure that we don't find
1392 # a dependency directory in the source tree via VPATH (perhaps from
1393 # a previous build in the source tree) and thus neglect to create a
1394 # dependency directory in the object directory, where we really need
1397 ifneq (,$(filter-out all chrome default
export realchrome
clean clobber clobber_all
distclean realclean,$(MAKECMDGOALS
)))
1398 MDDEPEND_FILES
:= $(strip $(wildcard $(addprefix $(MDDEPDIR
)/,$(EXTRA_MDDEPEND_FILES
) $(addsuffix .pp
,$(notdir $(sort $(OBJS
) $(PROGOBJS
) $(HOST_OBJS
) $(HOST_PROGOBJS
))) $(TARGETS
)))))
1400 ifneq (,$(MDDEPEND_FILES
))
1401 $(call include_deps
,$(MDDEPEND_FILES
))
1407 ifneq (,$(filter export,$(MAKECMDGOALS
)))
1408 MDDEPEND_FILES
:= $(strip $(wildcard $(addprefix $(MDDEPDIR
)/,$(EXTRA_EXPORT_MDDEPEND_FILES
))))
1410 ifneq (,$(MDDEPEND_FILES
))
1411 $(call include_deps
,$(MDDEPEND_FILES
))
1416 #############################################################################
1418 -include $(topsrcdir
)/$(MOZ_BUILD_APP
)/app-rules.mk
1419 -include $(MY_RULES
)
1422 # Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
1426 ifneq ($(CSRCS
)$(CPPSRCS
)$(HEADERS
),)
1428 TAGS
:: $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
1429 $(ETAGS
) $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
1433 ################################################################################
1434 # Install/copy rules
1436 # The INSTALL_TARGETS variable contains a list of all install target
1437 # categories. Each category defines a list of files and executables, and an
1438 # install destination,
1440 # FOO_FILES := foo bar
1441 # FOO_EXECUTABLES := baz
1442 # FOO_DEST := target_path
1443 # INSTALL_TARGETS += FOO
1445 # Additionally, a FOO_TARGET variable may be added to indicate the target for
1446 # which the files and executables are installed. Default is "libs".
1448 # Finally, a FOO_KEEP_PATH variable may be set to 1 to indicate the paths given
1449 # in FOO_FILES/FOO_EXECUTABLES are to be kept at the destination. That is,
1450 # if FOO_FILES is bar/baz/qux.h, and FOO_DEST is $(DIST)/include, the installed
1451 # file would be $(DIST)/include/bar/baz/qux.h instead of $(DIST)/include/qux.h
1453 # If we're using binary nsinstall and it's not built yet, fallback to python nsinstall.
1454 ifneq (,$(filter $(CONFIG_TOOLS
)/nsinstall
$(HOST_BIN_SUFFIX
),$(install_cmd
)))
1455 ifeq (,$(wildcard $(CONFIG_TOOLS
)/nsinstall
$(HOST_BIN_SUFFIX
)))
1456 nsinstall_is_usable
= $(if
$(wildcard $(CONFIG_TOOLS
)/nsinstall
$(HOST_BIN_SUFFIX
)),yes
)
1458 define install_cmd_override
1459 $(1): install_cmd
= $$(if
$$(nsinstall_is_usable
),$$(INSTALL
),$$(NSINSTALL_PY
)) $$(1)
1464 install_target_tier
= $(or
$($(1)_TARGET
),libs
)
1465 INSTALL_TARGETS_TIERS
:= $(sort $(foreach category
,$(INSTALL_TARGETS
),$(call install_target_tier
,$(category
))))
1467 install_target_result
= $($(1)_DEST
:%/=%)/$(if
$($(1)_KEEP_PATH
),$(2),$(notdir $(2)))
1468 install_target_files
= $(foreach file
,$($(1)_FILES
),$(call install_target_result
,$(category
),$(file
)))
1469 install_target_executables
= $(foreach file
,$($(1)_EXECUTABLES
),$(call install_target_result
,$(category
),$(file
)))
1471 # Work around a GNU make 3.81 bug where it gives $< the wrong value.
1472 # See details in bug 934864.
1473 define create_dependency
1478 define install_target_template
1479 $(call install_cmd_override
,$(2))
1480 $(call create_dependency
,$(2),$(1))
1483 $(foreach category
,$(INSTALL_TARGETS
),\
1484 $(if
$($(category
)_DEST
),,$(error Missing
$(category
)_DEST
)) \
1485 $(foreach tier
,$(call install_target_tier
,$(category
)),\
1486 $(eval INSTALL_TARGETS_FILES_
$(tier
) += $(call install_target_files
,$(category
))) \
1487 $(eval INSTALL_TARGETS_EXECUTABLES_
$(tier
) += $(call install_target_executables
,$(category
))) \
1489 $(foreach file
,$($(category
)_FILES
) $($(category
)_EXECUTABLES
), \
1490 $(eval
$(call install_target_template
,$(file
),$(call install_target_result
,$(category
),$(file
)))) \
1494 $(foreach tier
,$(INSTALL_TARGETS_TIERS
), \
1495 $(eval
$(tier
):: $(INSTALL_TARGETS_FILES_
$(tier
)) $(INSTALL_TARGETS_EXECUTABLES_
$(tier
))) \
1498 install_targets_sanity
= $(if
$(filter-out $(notdir $@
),$(notdir $(<))),$(error Looks like
$@ has an unexpected dependency on
$< which breaks INSTALL_TARGETS
))
1500 $(sort $(foreach tier
,$(INSTALL_TARGETS_TIERS
),$(INSTALL_TARGETS_FILES_
$(tier
)))):
1501 $(install_targets_sanity
)
1502 $(call install_cmd
,$(IFLAGS1
) '$<' '$(@D)')
1504 $(sort $(foreach tier
,$(INSTALL_TARGETS_TIERS
),$(INSTALL_TARGETS_EXECUTABLES_
$(tier
)))):
1505 $(install_targets_sanity
)
1506 $(call install_cmd
,$(IFLAGS2
) '$<' '$(@D)')
1508 ################################################################################
1509 # Preprocessing rules
1511 # The PP_TARGETS variable contains a list of all preprocessing target
1512 # categories. Each category has associated variables listing input files, the
1513 # output directory, extra preprocessor flags, and so on. For example:
1516 # FOO_PATH := target-directory
1517 # FOO_FLAGS := -Dsome_flag
1520 # If PP_TARGETS lists a category name <C> (like FOO, above), then we consult the
1521 # following make variables to see what to do:
1523 # - <C> lists input files to be preprocessed with mozbuild.action.preprocessor.
1524 # We search VPATH for the names given here. If an input file name ends in
1525 # '.in', that suffix is omitted from the output file name.
1527 # - <C>_PATH names the directory in which to place the preprocessed output
1528 # files. We create this directory if it does not already exist. Setting
1529 # this variable is optional; if unset, we install the files in $(CURDIR).
1531 # - <C>_FLAGS lists flags to pass to mozbuild.action.preprocessor, in addition
1532 # to the usual bunch. Setting this variable is optional.
1534 # - <C>_TARGET names the 'make' target that should depend on creating the output
1535 # files. Setting this variable is optional; if unset, we preprocess the
1536 # files for the 'libs' target.
1538 # - <C>_KEEP_PATH may be set to 1 to indicate the paths given in <C> are to be
1539 # kept under <C>_PATH. That is, if <C> is bar/baz/qux.h.in and <C>_PATH is
1540 # $(DIST)/include, the preprocessed file would be $(DIST)/include/bar/baz/qux.h
1541 # instead of $(DIST)/include/qux.h.
1543 pp_target_tier
= $(or
$($(1)_TARGET
),libs
)
1544 PP_TARGETS_TIERS
:= $(sort $(foreach category
,$(PP_TARGETS
),$(call pp_target_tier
,$(category
))))
1546 pp_target_result
= $(or
$($(1)_PATH
:%/=%),$(CURDIR
))/$(if
$($(1)_KEEP_PATH
),$(2:.in
=),$(notdir $(2:.in
=)))
1547 pp_target_results
= $(foreach file
,$($(1)),$(call pp_target_result
,$(category
),$(file
)))
1549 $(foreach category
,$(PP_TARGETS
), \
1550 $(foreach tier
,$(call pp_target_tier
,$(category
)), \
1551 $(eval PP_TARGETS_RESULTS_
$(tier
) += $(call pp_target_results
,$(category
))) \
1553 $(foreach file
,$($(category
)), \
1554 $(eval
$(call create_dependency
,$(call pp_target_result
,$(category
),$(file
)), \
1555 $(file
) $(GLOBAL_DEPS
))) \
1557 $(eval
$(call pp_target_results
,$(category
)): PP_TARGET_FLAGS
=$($(category
)_FLAGS
)) \
1560 $(foreach tier
,$(PP_TARGETS_TIERS
), \
1561 $(eval
$(tier
):: $(PP_TARGETS_RESULTS_
$(tier
))) \
1564 PP_TARGETS_ALL_RESULTS
:= $(sort $(foreach tier
,$(PP_TARGETS_TIERS
),$(PP_TARGETS_RESULTS_
$(tier
))))
1565 $(PP_TARGETS_ALL_RESULTS
):
1566 $(if
$(filter-out $(notdir $@
),$(notdir $(<:.in
=))),$(error Looks like
$@ has an unexpected dependency on
$< which breaks PP_TARGETS
))
1568 $(call py_action
,preprocessor
,--depend
$(MDDEPDIR
)/$(@F
).pp
$(PP_TARGET_FLAGS
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) '$<' -o
'$@')
1570 # The depfile is based on the filename, and we don't want conflicts. So check
1571 # there's only one occurrence of any given filename in PP_TARGETS_ALL_RESULTS.
1572 PP_TARGETS_ALL_RESULT_NAMES
:= $(notdir $(PP_TARGETS_ALL_RESULTS
))
1573 $(foreach file
,$(sort $(PP_TARGETS_ALL_RESULT_NAMES
)), \
1574 $(if
$(filter-out 1,$(words $(filter $(file
),$(PP_TARGETS_ALL_RESULT_NAMES
)))), \
1575 $(error Multiple preprocessing rules are creating a
$(file
) file
) \
1579 ifneq (,$(filter $(PP_TARGETS_TIERS
) $(PP_TARGETS_ALL_RESULTS
),$(MAKECMDGOALS
)))
1580 # If the depfile for a preprocessed file doesn't exist, add a dep to force
1582 $(foreach file
,$(PP_TARGETS_ALL_RESULTS
), \
1583 $(if
$(wildcard $(MDDEPDIR
)/$(notdir $(file
)).pp
), \
1585 $(eval
$(file
): FORCE
) \
1589 MDDEPEND_FILES
:= $(strip $(wildcard $(addprefix $(MDDEPDIR
)/,$(addsuffix .pp
,$(notdir $(PP_TARGETS_ALL_RESULTS
))))))
1591 ifneq (,$(MDDEPEND_FILES
))
1592 $(call include_deps
,$(MDDEPEND_FILES
))
1597 # Pull in non-recursive targets if this is a partial tree build.
1598 ifndef TOPLEVEL_BUILD
1599 include $(topsrcdir
)/config
/makefiles
/nonrecursive.mk
1602 ################################################################################
1603 # Special gmake rules.
1604 ################################################################################
1608 # Re-define the list of default suffixes, so gmake won't have to churn through
1609 # hundreds of built-in suffix rules for stuff we don't need.
1614 # Fake targets. Always run these rules, even if a file/directory with that
1615 # name already exists.
1617 .PHONY
: all alltags boot checkout chrome realchrome
clean clobber clobber_all
export install libs makefiles
realclean run_apprunner tools
$(DIRS
) $(TOOL_DIRS
) FORCE
1619 # Used as a dependency to force targets to rebuild
1622 # Delete target if error occurs when building target
1627 TAGS
: $(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
1628 -etags
$(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
1629 $(LOOP_OVER_PARALLEL_DIRS
)
1632 ifndef INCLUDED_DEBUGMAKE_MK
#{
1633 ## Only parse when an echo* or show* target is requested
1634 ifneq (,$(call isTargetStem
,echo
,show
))
1635 include $(topsrcdir
)/config
/makefiles
/debugmake.mk
1641 $(DOXYGEN
) $(DEPTH
)/config
/doxygen.cfg
1645 $(LOOP_OVER_PARALLEL_DIRS
)
1647 $(LOOP_OVER_TOOL_DIRS
)
1651 FREEZE_VARIABLES
= \
1660 EXTRA_PP_COMPONENTS \
1662 MOCHITEST_CHROME_FILES \
1663 MOCHITEST_BROWSER_FILES \
1664 MOCHITEST_A11Y_FILES \
1665 MOCHITEST_METRO_FILES \
1666 MOCHITEST_ROBOCOP_FILES \
1669 $(foreach var
,$(FREEZE_VARIABLES
),$(eval
$(var
)_FROZEN
:= '$($(var))'))
1671 CHECK_FROZEN_VARIABLES
= $(foreach var
,$(FREEZE_VARIABLES
), \
1672 $(if
$(subst $($(var
)_FROZEN
),,'$($(var))'),$(error Makefile variable
'$(var)' changed value after including rules.mk. Was
$($(var
)_FROZEN
), now
$($(var
)).
)))
1675 $(CHECK_FROZEN_VARIABLES
)
1677 PURGECACHES_DIRS ?
= $(DIST
)/bin
1678 ifdef MOZ_WEBAPP_RUNTIME
1679 PURGECACHES_DIRS
+= $(DIST
)/bin
/webapprt
1682 PURGECACHES_FILES
= $(addsuffix /.purgecaches
,$(PURGECACHES_DIRS
))
1684 default
all:: $(PURGECACHES_FILES
)
1686 $(PURGECACHES_FILES
):
1687 if
test -d
$(@D
) ; then touch
$@
; fi
1689 .DEFAULT_GOAL
:= $(or
$(OVERRIDE_DEFAULT_GOAL
),default
)
1691 #############################################################################
1692 # Derived targets and dependencies
1694 include $(topsrcdir
)/config
/makefiles
/autotargets.mk
1695 ifneq ($(NULL
),$(AUTO_DEPS
))
1696 default
all libs tools
export:: $(AUTO_DEPS
)
1699 export:: $(GENERATED_FILES
)
1701 GARBAGE
+= $(GENERATED_FILES
)