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
127 cppunittests-remote
: DM_TRANS?
=adb
129 @if
[ '${TEST_DEVICE}' != '' -o
'$(DM_TRANS)' = 'adb' ]; then \
130 $(PYTHON
) -u
$(topsrcdir
)/testing
/remotecppunittests.py \
131 --xre-path
=$(DEPTH
)/dist/bin \
132 --localLib
=$(DEPTH
)/dist/$(MOZ_APP_NAME
) \
133 --dm_trans
=$(DM_TRANS
) \
134 --deviceIP
=${TEST_DEVICE} \
135 $(subst .
cpp,$(BIN_SUFFIX
),$(CPP_UNIT_TESTS
)) $(EXTRA_TEST_ARGS
); \
137 echo
'please prepare your host with environment variables for TEST_DEVICE'; \
140 endif # COMPILE_ENVIRONMENT
141 endif # CPP_UNIT_TESTS
145 ifdef PYTHON_UNIT_TESTS
147 RUN_PYTHON_UNIT_TESTS
:= $(addsuffix -run
,$(PYTHON_UNIT_TESTS
))
149 .PHONY
: $(RUN_PYTHON_UNIT_TESTS
)
151 check:: $(RUN_PYTHON_UNIT_TESTS
)
153 $(RUN_PYTHON_UNIT_TESTS
): %-run
: %
154 @PYTHONDONTWRITEBYTECODE
=1 $(PYTHON
) $<
156 endif # PYTHON_UNIT_TESTS
164 # If FORCE_STATIC_LIB is set, build a static library.
165 # Otherwise, build a shared library.
169 ifdef STATIC_LIBRARY_NAME
170 REAL_LIBRARY
:= $(LIB_PREFIX
)$(STATIC_LIBRARY_NAME
).
$(LIB_SUFFIX
)
171 # Only build actual library if it is installed in DIST/lib or SDK
172 ifeq (,$(SDK_LIBRARY
)$(DIST_INSTALL
)$(NO_EXPAND_LIBS
))
173 LIBRARY
:= $(REAL_LIBRARY
).
$(LIBS_DESC_SUFFIX
)
175 LIBRARY
:= $(REAL_LIBRARY
) $(REAL_LIBRARY
).
$(LIBS_DESC_SUFFIX
)
177 endif # STATIC_LIBRARY_NAME
181 ifdef HOST_LIBRARY_NAME
182 HOST_LIBRARY
:= $(LIB_PREFIX
)$(HOST_LIBRARY_NAME
).
$(LIB_SUFFIX
)
187 ifdef FORCE_SHARED_LIB
191 MKSHLIB
= $(MKCSHLIB
)
194 ifneq (,$(filter OS2 WINNT
,$(OS_ARCH
)))
195 IMPORT_LIBRARY
:= $(LIB_PREFIX
)$(SHARED_LIBRARY_NAME
).
$(IMPORT_LIB_SUFFIX
)
199 SHARED_LIBRARY
:= $(SHARED_LIBRARY_NAME
)
201 SHARED_LIBRARY
:= $(DLL_PREFIX
)$(SHARED_LIBRARY_NAME
)$(DLL_SUFFIX
)
204 ifeq ($(OS_ARCH
),OS2
)
205 DEF_FILE
:= $(SHARED_LIBRARY
:.dll
=.def
)
211 endif # FORCE_SHARED_LIB
214 ifdef FORCE_STATIC_LIB
215 ifndef FORCE_SHARED_LIB
216 SHARED_LIBRARY
:= $(NULL
)
218 IMPORT_LIBRARY
:= $(NULL
)
222 ifdef FORCE_SHARED_LIB
223 ifndef FORCE_STATIC_LIB
228 ifeq ($(OS_ARCH
),WINNT
)
232 # Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
233 # directory. For parallel builds, this PDB file is shared and locked by
234 # MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
235 # without SP1, don't do parallel builds.
237 # The final PDB for libraries and programs is created by the linker and uses
238 # a different name from the single PDB file created by the compiler. See
242 ifdef SIMPLE_PROGRAMS
243 COMPILE_PDBFILE
= $(basename $(@F
)).pdb
245 COMPILE_PDBFILE
= generated.pdb
248 LINK_PDBFILE
= $(basename $(@F
)).pdb
250 CODFILE
=$(basename $(@F
)).cod
254 OS_LDFLAGS
+= -DEF
:$(call normalizepath
,$(DEFFILE
))
255 EXTRA_DEPS
+= $(DEFFILE
)
261 OS_LDFLAGS
+= $(call normalizepath
,$(DEFFILE
))
262 EXTRA_DEPS
+= $(DEFFILE
)
269 ifeq ($(SOLARIS_SUNPRO_CXX
),1)
270 ifeq (86,$(findstring 86,$(OS_TEST
)))
271 OS_LDFLAGS
+= -M
$(topsrcdir
)/config
/solaris_ia32.map
273 endif # Solaris Sun Studio C++
275 ifeq ($(HOST_OS_ARCH
),WINNT
)
276 HOST_PDBFILE
=$(basename $(@F
)).pdb
279 # Don't build SIMPLE_PROGRAMS during the MOZ_PROFILE_GENERATE pass
280 ifdef MOZ_PROFILE_GENERATE
281 EXCLUDED_OBJS
:= $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.
$(OBJ_SUFFIX
))
285 ifdef COMPILE_ENVIRONMENT
287 TARGETS
= $(LIBRARY
) $(SHARED_LIBRARY
) $(PROGRAM
) $(SIMPLE_PROGRAMS
) $(HOST_LIBRARY
) $(HOST_PROGRAM
) $(HOST_SIMPLE_PROGRAMS
)
290 COBJS
= $(notdir $(CSRCS
:.c
=.
$(OBJ_SUFFIX
)))
291 SOBJS
= $(notdir $(SSRCS
:.S
=.
$(OBJ_SUFFIX
)))
292 # CPPSRCS can have different extensions (eg: .cpp, .cc)
293 CPPOBJS
= $(notdir $(addsuffix .
$(OBJ_SUFFIX
),$(basename $(CPPSRCS
))))
294 CMOBJS
= $(notdir $(CMSRCS
:.m
=.
$(OBJ_SUFFIX
)))
295 CMMOBJS
= $(notdir $(CMMSRCS
:.mm
=.
$(OBJ_SUFFIX
)))
296 ASOBJS
= $(notdir $(ASFILES
:.
$(ASM_SUFFIX
)=.
$(OBJ_SUFFIX
)))
298 _OBJS
= $(COBJS
) $(SOBJS
) $(CPPOBJS
) $(CMOBJS
) $(CMMOBJS
) $(ASOBJS
)
299 OBJS
= $(strip $(_OBJS
))
302 HOST_COBJS
= $(addprefix host_
,$(notdir $(HOST_CSRCS
:.c
=.
$(OBJ_SUFFIX
))))
303 # HOST_CPPOBJS can have different extensions (eg: .cpp, .cc)
304 HOST_CPPOBJS
= $(addprefix host_
,$(notdir $(addsuffix .
$(OBJ_SUFFIX
),$(basename $(HOST_CPPSRCS
)))))
305 HOST_CMOBJS
= $(addprefix host_
,$(notdir $(HOST_CMSRCS
:.m
=.
$(OBJ_SUFFIX
))))
306 HOST_CMMOBJS
= $(addprefix host_
,$(notdir $(HOST_CMMSRCS
:.mm
=.
$(OBJ_SUFFIX
))))
308 _HOST_OBJS
= $(HOST_COBJS
) $(HOST_CPPOBJS
) $(HOST_CMOBJS
) $(HOST_CMMOBJS
)
309 HOST_OBJS
= $(strip $(_HOST_OBJS
))
320 HOST_SIMPLE_PROGRAMS
:=
321 SDK_BINARY
:= $(filter %.py
,$(SDK_BINARY
))
326 $(GARBAGE
) $(TARGETS
) $(OBJS
) $(PROGOBJS
) LOGS TAGS a.out \
327 $(filter-out $(ASFILES
),$(OBJS
:.
$(OBJ_SUFFIX
)=.s
)) $(OBJS
:.
$(OBJ_SUFFIX
)=.ii
) \
328 $(OBJS
:.
$(OBJ_SUFFIX
)=.i
) $(OBJS
:.
$(OBJ_SUFFIX
)=.i_o
) \
329 $(HOST_PROGOBJS
) $(HOST_OBJS
) $(IMPORT_LIBRARY
) $(DEF_FILE
)\
330 $(EXE_DEF_FILE
) so_locations _gen _stubs
$(wildcard *.res
) $(wildcard *.RES
) \
331 $(wildcard *.pdb
) $(CODFILE
) $(IMPORT_LIBRARY
) \
332 $(SHARED_LIBRARY
:$(DLL_SUFFIX
)=.exp
) $(wildcard *.ilk
) \
333 $(PROGRAM
:$(BIN_SUFFIX
)=.exp
) $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.exp
) \
334 $(PROGRAM
:$(BIN_SUFFIX
)=.lib
) $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.lib
) \
335 $(SIMPLE_PROGRAMS
:$(BIN_SUFFIX
)=.
$(OBJ_SUFFIX
)) \
336 $(wildcard gts_tmp_
*) $(LIBRARY
:%.a
=.
%.timestamp
)
338 $(GARBAGE_DIRS
) /no-such-file
341 GARBAGE
+= $(MOCSRCS
)
344 ifdef SIMPLE_PROGRAMS
345 GARBAGE
+= $(SIMPLE_PROGRAMS
:%=%.
$(OBJ_SUFFIX
))
348 ifdef HOST_SIMPLE_PROGRAMS
349 GARBAGE
+= $(HOST_SIMPLE_PROGRAMS
:%=%.
$(OBJ_SUFFIX
))
353 # the Solaris WorkShop template repository cache. it occasionally can get
354 # out of sync, so targets like clobber should kill it.
356 ifeq ($(SOLARIS_SUNPRO_CXX
),1)
357 GARBAGE_DIRS
+= SunWS_cache
360 ifdef MOZ_UPDATE_XTERM
361 # Its good not to have a newline at the end of the titlebar string because it
362 # makes the make -s output easier to read. Echo -n does not work on all
363 # platforms, but we can trick printf into doing it.
364 UPDATE_TITLE
= printf
'\033]0;%s in %s\007' $(1) $(relativesrcdir
)/$(2) ;
368 NO_BUILDSTATUS_MESSAGES
=1
372 ifndef NO_BUILDSTATUS_MESSAGES
374 @echo
'BUILDSTATUS $1'
380 define SUBMAKE
# $(call SUBMAKE,target,directory,static)
382 +$(MAKE
) $(if
$(2),-C
$(2)) $(1)
384 endef # The extra line is important here! don't delete it
386 define TIER_DIR_SUBMAKE
387 $(call BUILDSTATUS
,TIERDIR_START
$(1) $(2) $(3))
388 $(call SUBMAKE
,$(4),$(3),$(5))
389 $(call BUILDSTATUS
,TIERDIR_FINISH
$(1) $(2) $(3))
391 endef # Ths empty line is important.
393 ifneq (,$(strip $(DIRS
)))
395 $(foreach dir,$(DIRS
),$(call SUBMAKE
,$@
,$(dir)))
398 # we only use this for the makefiles target and other stuff that doesn't matter
399 ifneq (,$(strip $(PARALLEL_DIRS
)))
400 LOOP_OVER_PARALLEL_DIRS
= \
401 $(foreach dir,$(PARALLEL_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
404 ifneq (,$(strip $(TOOL_DIRS
)))
405 LOOP_OVER_TOOL_DIRS
= \
406 $(foreach dir,$(TOOL_DIRS
),$(call SUBMAKE
,$@
,$(dir)))
410 # Now we can differentiate between objects used to build a library, and
411 # objects used to build an executable in the same directory.
418 HOST_PROGOBJS
= $(HOST_OBJS
)
421 GARBAGE_DIRS
+= $(wildcard $(CURDIR
)/$(MDDEPDIR
))
424 # Tags: emacs (etags), vi (ctags)
425 # TAG_PROGRAM := ctags -L -
427 TAG_PROGRAM
= xargs etags
-a
430 # Turn on C++ linking if we have any .cpp or .mm files
431 # (moved this from config.mk so that config.mk can be included
432 # before the CPPSRCS are defined)
434 ifneq ($(HOST_CPPSRCS
)$(HOST_CMMSRCS
),)
435 HOST_CPP_PROG_LINK
= 1
439 # This will strip out symbols that the component should not be
440 # exporting from the .dynsym section.
443 EXTRA_DSO_LDOPTS
+= $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
)
447 # MacOS X specific stuff
450 ifeq ($(OS_ARCH
),Darwin
)
453 EXTRA_DSO_LDOPTS
+= -bundle
455 EXTRA_DSO_LDOPTS
+= -dynamiclib
-install_name @executable_path
/$(SHARED_LIBRARY
) -compatibility_version
1 -current_version
1 -single_module
461 # On NetBSD a.out systems, use -Bsymbolic. This fixes what would otherwise be
462 # fatal symbol name clashes between components.
464 ifeq ($(OS_ARCH
),NetBSD
)
465 ifeq ($(DLL_SUFFIX
),.so
.1.0)
467 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
472 ifeq ($(OS_ARCH
),FreeBSD
)
474 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
478 ifeq ($(OS_ARCH
),NetBSD
)
479 ifneq (,$(filter arc cobalt hpcmips mipsco newsmips pmax sgimips
,$(OS_TEST
)))
480 ifneq (,$(filter layout
/%,$(relativesrcdir
)))
481 OS_CFLAGS
+= -Wa
,-xgot
482 OS_CXXFLAGS
+= -Wa
,-xgot
488 # HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
489 # which uses internal symbols first
491 ifeq ($(OS_ARCH
),HP-UX
)
493 ifeq ($(GNU_CC
)$(GNU_CXX
),)
494 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
495 ifneq ($(HAS_EXTRAEXPORTS
),1)
496 MKSHLIB
+= -Wl
,+eNSGetModule
-Wl
,+eerrno
497 MKCSHLIB
+= +eNSGetModule
+eerrno
498 ifneq ($(OS_TEST
),ia64
)
499 MKSHLIB
+= -Wl
,+e_shlInit
500 MKCSHLIB
+= +e_shlInit
502 endif # !HAS_EXTRAEXPORTS
503 endif # non-gnu compilers
507 ifeq ($(OS_ARCH
),AIX
)
509 ifneq ($(HAS_EXTRAEXPORTS
),1)
510 MKSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
511 MKCSHLIB
+= -bE
:$(MOZILLA_DIR
)/build
/unix
/aix.exp
-bnoexpall
512 endif # HAS_EXTRAEXPORTS
517 # Linux: add -Bsymbolic flag for components
519 ifeq ($(OS_ARCH
),Linux
)
521 EXTRA_DSO_LDOPTS
+= -Wl
,-Bsymbolic
526 # GNU doesn't have path length limitation
529 ifeq ($(OS_ARCH
),GNU
)
530 OS_CPPFLAGS
+= -DPATH_MAX
=1024 -DMAXPATHLEN
=1024
536 ifeq ($(OS_ARCH
),WINNT
)
539 DSO_LDOPTS
+= -Wl
,--out-implib
-Wl
,$(IMPORT_LIBRARY
)
552 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
554 PREPROCESS_OPTION
= -P
-Fi
# eol
557 PREPROCESS_OPTION
= -E
-o
#eol
558 endif # WINNT && !GNU_CC
560 ifneq (,$(filter ml
%,$(AS
)))
561 ASOUTOPTION
= -Fo
# eol
563 ASOUTOPTION
= -o
# eol
566 ifeq (,$(CROSS_COMPILE
))
567 HOST_OUTOPTION
= $(OUTOPTION
)
569 HOST_OUTOPTION
= -o
# eol
571 ################################################################################
573 # Ensure the build config is up to date. This is done automatically when builds
574 # are performed through |mach build|. The check here is to catch people not
575 # using mach. If we ever enforce builds through mach, this code can be removed.
576 ifndef MOZBUILD_BACKEND_CHECKED
578 ifndef TOPLEVEL_BUILD
579 $(DEPTH
)/backend.RecursiveMakeBackend
:
580 $(error Build configuration changed. Build with |mach build| or run |mach build-backend| to regenerate build config
)
582 include $(DEPTH
)/backend.RecursiveMakeBackend.pp
584 default
:: $(DEPTH
)/backend.RecursiveMakeBackend
586 export MOZBUILD_BACKEND_CHECKED
=1
591 # The root makefile doesn't want to do a plain export/libs, because
592 # of the tiers and because of libxul. Suppress the default rules in favor
593 # of something else. Makefiles which use this var *must* provide a sensible
594 # default rule before including rules.mk
595 ifndef SUPPRESS_DEFAULT_RULES
598 ifdef MOZ_PSEUDO_DERECURSE
599 ifdef COMPILE_ENVIRONMENT
605 endif # SUPPRESS_DEFAULT_RULES
607 ifeq ($(findstring s
,$(filter-out --%, $(MAKEFLAGS
))),)
615 # Do everything from scratch
620 ifneq (,$(filter-out %.
$(LIB_SUFFIX
),$(SHARED_LIBRARY_LIBS
)))
621 $(error SHARED_LIBRARY_LIBS must contain .
$(LIB_SUFFIX
) files only
)
624 HOST_LIBS_DEPS
= $(filter %.
$(LIB_SUFFIX
),$(HOST_LIBS
))
626 # Dependencies which, if modified, should cause everything to rebuild
627 GLOBAL_DEPS
+= Makefile
$(DEPTH
)/config
/autoconf.mk
$(topsrcdir
)/config
/config.mk
629 ##############################################
630 ifdef COMPILE_ENVIRONMENT
631 OBJ_TARGETS
= $(OBJS
) $(PROGOBJS
) $(HOST_OBJS
) $(HOST_PROGOBJS
)
633 compile
:: $(OBJ_TARGETS
)
635 include $(topsrcdir
)/config
/makefiles
/target_binaries.mk
639 # One would think "tools:: libs" would work, but it turns out that combined with
640 # bug 907365, this makes make forget to run some rules sometimes.
645 ##############################################
646 ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE
))
647 ifdef MOZ_PROFILE_USE
648 ifeq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
649 # When building with PGO, we have to make sure to re-link
650 # in the MOZ_PROFILE_USE phase if we linked in the
651 # MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
652 # file in the link rule in the GENERATE phase to indicate
653 # that we need a relink.
655 $(SHARED_LIBRARY
): pgo.relink
658 $(PROGRAM
): pgo.relink
661 # In the second pass, we need to merge the pgc files into the pgd file.
662 # The compiler would do this for us automatically if they were in the right
663 # place, but they're in dist/bin.
664 ifneq (,$(SHARED_LIBRARY
)$(PROGRAM
))
667 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
668 $(PROGRAM
:$(BIN_SUFFIX
)=) $(DIST
)/bin
671 $(PYTHON
) $(topsrcdir
)/build
/win32
/pgomerge.py \
672 $(SHARED_LIBRARY_NAME
) $(DIST
)/bin
674 endif # SHARED_LIBRARY || PROGRAM
676 endif # MOZ_PROFILE_USE
677 ifdef MOZ_PROFILE_GENERATE
678 # Clean up profiling data during PROFILE_GENERATE phase
680 ifeq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
681 $(foreach pgd
,$(wildcard *.pgd
),pgomgr
-clear
$(pgd
);)
689 ifneq (,$(MOZ_PROFILE_GENERATE
)$(MOZ_PROFILE_USE
))
691 # Force rebuilding libraries and programs in both passes because each
692 # pass uses different object files.
693 $(PROGRAM
) $(SHARED_LIBRARY
) $(LIBRARY
): FORCE
697 endif # NO_PROFILE_GUIDED_OPTIMIZE
699 ##############################################
702 $(MAKE
) -C
$(topsrcdir
) -f client.mk checkout
704 clean clobber realclean clobber_all
::
706 -$(RM
) -r
$(ALL_TRASH_DIRS
)
709 clean clobber realclean clobber_all
distclean::
711 $(foreach tier
, $(TIERS
), $(tier_
$(tier
)_staticdirs
) $(tier_
$(tier
)_dirs
)), \
712 -$(call SUBMAKE
,$@
,$(dir)))
714 clean clobber realclean clobber_all
distclean::
715 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
718 $(foreach dir,$(PARALLEL_DIRS
) $(DIRS
) $(TOOL_DIRS
),-$(call SUBMAKE
,$@
,$(dir)))
722 -$(RM
) -r
$(ALL_TRASH_DIRS
)
723 -$(RM
) $(ALL_TRASH
) \
724 Makefile .HSancillary \
725 $(wildcard *.
$(OBJ_SUFFIX
)) $(wildcard *.ho
) $(wildcard host_
*.o
*) \
726 $(wildcard *.
$(LIB_SUFFIX
)) $(wildcard *$(DLL_SUFFIX
)) \
727 $(wildcard *.
$(IMPORT_LIB_SUFFIX
))
728 ifeq ($(OS_ARCH
),OS2
)
729 -$(RM
) $(PROGRAM
:.exe
=.map
)
734 find
$(topsrcdir
) -name
dist -prune
-o \
( -name
'*.[hc]' -o
-name
'*.cp' -o
-name
'*.cpp' -o
-name
'*.idl' \
) -print |
$(TAG_PROGRAM
)
738 # creates OBJS, links with LIBS to create Foo
740 $(PROGRAM
): $(PROGOBJS
) $(EXTRA_DEPS
) $(EXE_DEF_FILE
) $(RESFILE
) $(GLOBAL_DEPS
)
743 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
744 $(EXPAND_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(LINK_PDBFILE
) $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(MOZ_GLUE_PROGRAM_LDFLAGS
) $(PROGOBJS
) $(RESFILE
) $(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
)
745 ifdef MSMANIFEST_TOOL
746 @if
test -f
$@.manifest
; then \
747 if
test -f
'$(srcdir)/$@.manifest'; then \
748 echo
'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
749 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
751 echo
'Embedding manifest from $@.manifest'; \
752 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
754 elif
test -f
'$(srcdir)/$@.manifest'; then \
755 echo
'Embedding manifest from $(srcdir)/$@.manifest'; \
756 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE
:$@\
;1; \
758 endif # MSVC with manifest tool
759 ifdef MOZ_PROFILE_GENERATE
760 # touch it a few seconds into the future to work around FAT's
761 # 2-second granularity
762 touch
-t
`date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
764 else # !WINNT || GNU_CC
765 $(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
)
766 @
$(call CHECK_STDCXX
,$@
)
767 endif # WINNT && !GNU_CC
770 $(STRIP
) $(STRIP_FLAGS
) $@
772 ifdef MOZ_POST_PROGRAM_COMMAND
773 $(MOZ_POST_PROGRAM_COMMAND
) $@
776 $(HOST_PROGRAM
): $(HOST_PROGOBJS
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
778 ifeq (_WINNT
,$(GNU_CC
)_
$(HOST_OS_ARCH
))
779 $(EXPAND_LIBS_EXEC
) -- $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $(HOST_OBJS
) $(WIN32_EXE_LDFLAGS
) $(HOST_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
780 ifdef MSMANIFEST_TOOL
781 @if
test -f
$@.manifest
; then \
782 if
test -f
'$(srcdir)/$@.manifest'; then \
783 echo
'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
784 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' $@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
786 echo
'Embedding manifest from $@.manifest'; \
787 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
789 elif
test -f
'$(srcdir)/$@.manifest'; then \
790 echo
'Embedding manifest from $(srcdir)/$@.manifest'; \
791 mt.exe
-NOLOGO
-MANIFEST
'$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE
:$@\
;1; \
793 endif # MSVC with manifest tool
795 ifeq ($(HOST_CPP_PROG_LINK
),1)
796 $(EXPAND_LIBS_EXEC
) -- $(HOST_CXX
) -o
$@
$(HOST_CXXFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
798 $(EXPAND_LIBS_EXEC
) -- $(HOST_CC
) -o
$@
$(HOST_CFLAGS
) $(HOST_LDFLAGS
) $(HOST_PROGOBJS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
799 endif # HOST_CPP_PROG_LINK
803 # This is an attempt to support generation of multiple binaries
804 # in one directory, it assumes everything to compile Foo is in
805 # Foo.o (from either Foo.c or Foo.cpp).
807 # SIMPLE_PROGRAMS = Foo Bar
808 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
810 $(SIMPLE_PROGRAMS
): %$(BIN_SUFFIX
): %.
$(OBJ_SUFFIX
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
812 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
813 $(EXPAND_LD
) -nologo
-out
:$@
-pdb
:$(LINK_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(LDFLAGS
) $(MOZ_GLUE_PROGRAM_LDFLAGS
) $(LIBS
) $(EXTRA_LIBS
) $(OS_LIBS
)
814 ifdef MSMANIFEST_TOOL
815 @if
test -f
$@.manifest
; then \
816 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;1; \
819 endif # MSVC with manifest tool
821 $(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
)
822 @
$(call CHECK_STDCXX
,$@
)
823 endif # WINNT && !GNU_CC
826 $(STRIP
) $(STRIP_FLAGS
) $@
828 ifdef MOZ_POST_PROGRAM_COMMAND
829 $(MOZ_POST_PROGRAM_COMMAND
) $@
832 $(HOST_SIMPLE_PROGRAMS
): host_
%$(HOST_BIN_SUFFIX
): host_
%.
$(OBJ_SUFFIX
) $(HOST_LIBS_DEPS
) $(HOST_EXTRA_DEPS
) $(GLOBAL_DEPS
)
834 ifeq (WINNT_
,$(HOST_OS_ARCH
)_
$(GNU_CC
))
835 $(EXPAND_LIBS_EXEC
) -- $(HOST_LD
) -NOLOGO
-OUT
:$@
-PDB
:$(HOST_PDBFILE
) $< $(WIN32_EXE_LDFLAGS
) $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
837 ifneq (,$(HOST_CPPSRCS
)$(USE_HOST_CXX
))
838 $(EXPAND_LIBS_EXEC
) -- $(HOST_CXX
) $(HOST_OUTOPTION
)$@
$(HOST_CXXFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
840 $(EXPAND_LIBS_EXEC
) -- $(HOST_CC
) $(HOST_OUTOPTION
)$@
$(HOST_CFLAGS
) $(INCLUDES
) $< $(HOST_LIBS
) $(HOST_EXTRA_LIBS
)
844 ifdef DTRACE_PROBE_OBJ
845 EXTRA_DEPS
+= $(DTRACE_PROBE_OBJ
)
846 OBJS
+= $(DTRACE_PROBE_OBJ
)
849 $(filter %.
$(LIB_SUFFIX
),$(LIBRARY
)): $(OBJS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
852 $(EXPAND_AR
) $(AR_FLAGS
) $(OBJS
) $(SHARED_LIBRARY_LIBS
)
854 $(filter-out %.
$(LIB_SUFFIX
),$(LIBRARY
)): $(filter %.
$(LIB_SUFFIX
),$(LIBRARY
)) $(OBJS
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
855 # When we only build a library descriptor, blow out any existing library
857 $(if
$(filter %.
$(LIB_SUFFIX
),$(LIBRARY
)),,$(RM
) $(REAL_LIBRARY
) $(EXPORT_LIBRARY
:%=%/$(REAL_LIBRARY
)))
858 $(EXPAND_LIBS_GEN
) -o
$@
$(OBJS
) $(SHARED_LIBRARY_LIBS
)
860 ifeq ($(OS_ARCH
),WINNT
)
861 # Import libraries are created by the rules creating shared libraries.
862 # The rules to copy them to $(DIST)/lib depend on $(IMPORT_LIBRARY),
863 # but make will happily consider the import library before it is refreshed
864 # when rebuilding the corresponding shared library. Defining an empty recipe
865 # for import libraries forces make to wait for the shared library recipe to
866 # have run before considering other targets that depend on the import library.
868 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
) ;
871 ifeq ($(OS_ARCH
),OS2
)
872 $(DEF_FILE
): $(OBJS
) $(SHARED_LIBRARY_LIBS
)
874 echo LIBRARY
$(SHARED_LIBRARY_NAME
) INITINSTANCE TERMINSTANCE
> $@
876 echo CODE LOADONCALL MOVEABLE DISCARDABLE
>> $@
877 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED
>> $@
882 $(IMPORT_LIBRARY
): $(SHARED_LIBRARY
)
888 $(HOST_LIBRARY
): $(HOST_OBJS
) Makefile
891 $(EXPAND_LIBS_EXEC
) --extract
-- $(HOST_AR
) $(HOST_AR_FLAGS
) $(HOST_OBJS
)
895 ifdef DTRACE_PROBE_OBJ
896 ifndef DTRACE_LIB_DEPENDENT
897 NON_DTRACE_OBJS
:= $(filter-out $(DTRACE_PROBE_OBJ
),$(OBJS
))
898 $(DTRACE_PROBE_OBJ
): $(NON_DTRACE_OBJS
)
899 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(NON_DTRACE_OBJS
)
905 # On Darwin (Mac OS X), dwarf2 debugging uses debug info left in .o files,
906 # so instead of deleting .o files after repacking them into a dylib, we make
907 # symlinks back to the originals. The symlinks are a no-op for stabs debugging,
908 # so no need to conditionalize on OS version or debugging format.
910 $(SHARED_LIBRARY
): $(OBJS
) $(DEF_FILE
) $(RESFILE
) $(LIBRARY
) $(EXTRA_DEPS
) $(GLOBAL_DEPS
)
912 ifndef INCREMENTAL_LINKER
915 ifdef DTRACE_LIB_DEPENDENT
917 dtrace
-G
-C
-s
$(MOZILLA_DTRACE_SRC
) -o
$(DTRACE_PROBE_OBJ
) $(shell $(EXPAND_LIBS
) $(MOZILLA_PROBE_LIBS
))
919 $(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
))
920 @
$(RM
) $(DTRACE_PROBE_OBJ
)
921 else # ! DTRACE_LIB_DEPENDENT
922 $(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
))
923 endif # DTRACE_LIB_DEPENDENT
924 @
$(call CHECK_STDCXX
,$@
)
926 ifeq (_WINNT
,$(GNU_CC
)_
$(OS_ARCH
))
927 ifdef MSMANIFEST_TOOL
928 ifdef EMBED_MANIFEST_AT
929 @if
test -f
$@.manifest
; then \
930 mt.exe
-NOLOGO
-MANIFEST
$@.manifest
-OUTPUTRESOURCE
:$@\
;$(EMBED_MANIFEST_AT
); \
933 endif # EMBED_MANIFEST_AT
934 endif # MSVC with manifest tool
935 ifdef MOZ_PROFILE_GENERATE
936 touch
-t
`date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
938 endif # WINNT && !GCC
939 @
$(RM
) foodummyfilefoo
$(DELETE_AFTER_LINK
)
942 $(STRIP
) $(STRIP_FLAGS
) $@
944 ifdef MOZ_POST_DSO_LIB_COMMAND
945 $(MOZ_POST_DSO_LIB_COMMAND
) $@
948 ifeq ($(SOLARIS_SUNPRO_CC
),1)
949 _MDDEPFILE
= $(MDDEPDIR
)/$(@F
).pp
951 define MAKE_DEPS_AUTO_CC
952 if
test -d
$(@D
); then \
953 echo
'Building deps for $< using Sun Studio cc'; \
954 $(CC
) $(COMPILE_CFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
955 $(PYTHON
) $(topsrcdir
)/build
/unix
/add_phony_targets.py
$(_MDDEPFILE
) ; \
958 define MAKE_DEPS_AUTO_CXX
959 if
test -d
$(@D
); then \
960 echo
'Building deps for $< using Sun Studio CC'; \
961 $(CXX
) $(COMPILE_CXXFLAGS
) -xM
$< >$(_MDDEPFILE
) ; \
962 $(PYTHON
) $(topsrcdir
)/build
/unix
/add_phony_targets.py
$(_MDDEPFILE
) ; \
965 endif # Sun Studio on Solaris
967 # The object file is in the current directory, and the source file can be any
968 # relative path. This macro adds the dependency obj: src for each source file.
969 # This dependency must be first for the $< flag to work correctly, and the
970 # rules that have commands for these targets must not list any other
971 # prerequisites, or they will override the $< variable.
973 $(basename $2$(notdir $1)).
$(OBJ_SUFFIX
): $1 $$(call mkdir_deps
,$$(MDDEPDIR
))
975 $(foreach f
,$(CSRCS
) $(SSRCS
) $(CPPSRCS
) $(CMSRCS
) $(CMMSRCS
) $(ASFILES
),$(eval
$(call src_objdep
,$(f
))))
976 $(foreach f
,$(HOST_CSRCS
) $(HOST_CPPSRCS
) $(HOST_CMSRCS
) $(HOST_CMMSRCS
),$(eval
$(call src_objdep
,$(f
),host_
)))
978 $(OBJS
) $(HOST_OBJS
) $(PROGOBJS
) $(HOST_PROGOBJS
): $(GLOBAL_DEPS
)
980 # Rules for building native targets must come first because of the host_ prefix
983 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
987 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
991 $(ELOG
) $(HOST_CC
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CFLAGS
) $(HOST_CMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
995 $(ELOG
) $(HOST_CXX
) $(HOST_OUTOPTION
)$@
-c
$(HOST_CXXFLAGS
) $(HOST_CMMFLAGS
) $(INCLUDES
) $(NSPR_CFLAGS
) $(_VPATH_SRCS
)
999 @
$(MAKE_DEPS_AUTO_CC
)
1000 $(ELOG
) $(CC
) $(OUTOPTION
)$@
-c
$(COMPILE_CFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1002 # DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
1003 # 'moc' only knows about #defines it gets on the command line (-D...), not in
1004 # included headers like mozilla-config.h
1005 $(filter moc_
%.
cpp,$(CPPSRCS
)): moc_
%.
cpp: %.h
1007 $(ELOG
) $(MOC
) $(DEFINES
) $(ACDEFINES
) $< $(OUTOPTION
)$@
1009 $(filter moc_
%.
cc,$(CPPSRCS
)): moc_
%.
cc: %.
cc
1011 $(ELOG
) $(MOC
) $(DEFINES
) $(ACDEFINES
) $(_VPATH_SRCS
:.
cc=.h
) $(OUTOPTION
)$@
1013 $(filter qrc_
%.
cpp,$(CPPSRCS
)): qrc_
%.
cpp: %.qrc
1015 $(ELOG
) $(RCC
) -name
$* $< $(OUTOPTION
)$@
1018 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
1022 $(AS
) $(ASOUTOPTION
)$@
$(ASFLAGS
) $(AS_DASH_C_FLAG
) $(_VPATH_SRCS
)
1027 $(AS
) -o
$@
$(ASFLAGS
) $(LOCAL_INCLUDES
) $(TARGET_LOCAL_INCLUDES
) -c
$<
1031 @
$(MAKE_DEPS_AUTO_CXX
)
1032 $(ELOG
) $(CCC
) $(OUTOPTION
)$@
-c
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1036 @
$(MAKE_DEPS_AUTO_CXX
)
1037 $(ELOG
) $(CCC
) -o
$@
-c
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1041 @
$(MAKE_DEPS_AUTO_CC
)
1042 $(ELOG
) $(CC
) -o
$@
-c
$(COMPILE_CFLAGS
) $(COMPILE_CMFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1044 $(filter %.s
,$(CPPSRCS
:%.
cpp=%.s
)): %.s
: %.
cpp $(call mkdir_deps
,$(MDDEPDIR
))
1046 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1048 $(filter %.s
,$(CPPSRCS
:%.
cc=%.s
)): %.s
: %.
cc $(call mkdir_deps
,$(MDDEPDIR
))
1050 $(CCC
) -S
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1052 $(filter %.s
,$(CSRCS
:%.c
=%.s
)): %.s
: %.c
$(call mkdir_deps
,$(MDDEPDIR
))
1054 $(CC
) -S
$(COMPILE_CFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1056 $(filter %.i
,$(CPPSRCS
:%.
cpp=%.i
)): %.i
: %.
cpp $(call mkdir_deps
,$(MDDEPDIR
))
1058 $(CCC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1060 $(filter %.i
,$(CPPSRCS
:%.
cc=%.i
)): %.i
: %.
cc $(call mkdir_deps
,$(MDDEPDIR
))
1062 $(CCC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CXXFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1064 $(filter %.i
,$(CSRCS
:%.c
=%.i
)): %.i
: %.c
$(call mkdir_deps
,$(MDDEPDIR
))
1066 $(CC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1068 $(filter %.i
,$(CMMSRCS
:%.mm
=%.i
)): %.i
: %.mm
$(call mkdir_deps
,$(MDDEPDIR
))
1070 $(CCC
) -C
$(PREPROCESS_OPTION
)$@
$(COMPILE_CXXFLAGS
) $(COMPILE_CMMFLAGS
) $(TARGET_LOCAL_INCLUDES
) $(_VPATH_SRCS
)
1072 $(RESFILE
): %.res
: %.rc
1074 @echo Creating Resource file
: $@
1075 ifeq ($(OS_ARCH
),OS2
)
1076 $(RC
) $(RCFLAGS
:-D
%=-d
%) -i
$(subst /,\
,$(srcdir)) -r
$< $@
1079 $(RC
) $(RCFLAGS
) $(filter-out -U
%,$(DEFINES
)) $(INCLUDES
:-I
%=--include-dir
%) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1081 $(RC
) $(RCFLAGS
) -r
$(DEFINES
) $(INCLUDES
) $(OUTOPTION
)$@
$(_VPATH_SRCS
)
1085 # Cancel GNU make built-in implicit rules
1090 ifneq (,$(filter OS2 WINNT
,$(OS_ARCH
)))
1097 SPACE
:= $(EMPTY
) $(EMPTY
)
1099 # MSYS has its own special path form, but javac expects the source and class
1100 # paths to be in the DOS form (i.e. e:/builds/...). This function does the
1101 # appropriate conversion on Windows, but is a noop on other systems.
1102 ifeq ($(HOST_OS_ARCH
),WINNT
)
1103 # We use 'pwd -W' to get DOS form of the path. However, since the given path
1104 # could be a file or a non-existent path, we cannot call 'pwd -W' directly
1105 # on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
1106 # on it, then merge with the rest of the path.
1107 root-path
= $(shell echo
$(1) | sed
-e
's|\(/[^/]*\)/\?\(.*\)|\1|')
1108 non-root-path
= $(shell echo
$(1) | sed
-e
's|\(/[^/]*\)/\?\(.*\)|\2|')
1109 normalizepath
= $(foreach p
,$(1),$(if
$(filter /%,$(1)),$(patsubst %/,%,$(shell cd
$(call root-path
,$(1)) && pwd
-W
))/$(call non-root-path
,$(1)),$(1)))
1111 normalizepath
= $(1)
1114 ###############################################################################
1116 ###############################################################################
1117 ifneq (,$(JAVAFILES
)$(ANDROID_RESFILES
)$(ANDROID_APKNAME
)$(JAVA_JAR_TARGETS
))
1118 include $(topsrcdir
)/config
/makefiles
/java-build.mk
1121 ###############################################################################
1122 # Bunch of things that extend the 'export' rule (in order):
1123 ###############################################################################
1125 ifneq ($(XPI_NAME
),)
1129 export:: $(FINAL_TARGET
)
1132 ################################################################################
1133 # Copy each element of PREF_JS_EXPORTS
1135 # The default location for PREF_JS_EXPORTS is the gre prefs directory.
1136 PREF_DIR
= defaults
/pref
1138 # If DIST_SUBDIR is defined it indicates that app and gre dirs are
1139 # different and that we are building app related resources. Hence,
1140 # PREF_DIR should point to the app prefs location.
1141 ifneq (,$(DIST_SUBDIR
)$(XPI_NAME
)$(LIBXUL_SDK
))
1142 PREF_DIR
= defaults
/preferences
1145 # on win32, pref files need CRLF line endings... see bug 206029
1146 ifeq (WINNT
,$(OS_ARCH
))
1147 PREF_PPFLAGS
+= --line-endings
=crlf
1150 ifneq ($(PREF_JS_EXPORTS
),)
1151 ifndef NO_DIST_INSTALL
1152 PREF_JS_EXPORTS_PATH
:= $(FINAL_TARGET
)/$(PREF_DIR
)
1153 PREF_JS_EXPORTS_FLAGS
:= $(PREF_PPFLAGS
)
1154 PP_TARGETS
+= PREF_JS_EXPORTS
1158 ################################################################################
1159 # Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
1161 ifneq ($(AUTOCFG_JS_EXPORTS
),)
1162 ifndef NO_DIST_INSTALL
1163 AUTOCFG_JS_EXPORTS_FILES
:= $(AUTOCFG_JS_EXPORTS
)
1164 AUTOCFG_JS_EXPORTS_DEST
:= $(FINAL_TARGET
)/defaults
/autoconfig
1165 AUTOCFG_JS_EXPORTS_TARGET
:= export
1166 INSTALL_TARGETS
+= AUTOCFG_JS_EXPORTS
1170 ################################################################################
1171 # Install a linked .xpt into the appropriate place.
1172 # This should ideally be performed by the non-recursive idl make file. Some day.
1175 ifndef NO_DIST_INSTALL
1176 _XPT_NAME_FILES
:= $(DEPTH
)/config
/makefiles
/xpidl
/xpt
/$(XPT_NAME
)
1177 _XPT_NAME_DEST
:= $(FINAL_TARGET
)/components
1178 INSTALL_TARGETS
+= _XPT_NAME
1180 ifndef NO_INTERFACES_MANIFEST
1181 libs
:: $(call mkdir_deps
,$(FINAL_TARGET
)/components
)
1182 $(call py_action
,buildlist
,$(FINAL_TARGET
)/components
/interfaces.manifest
'interfaces $(XPT_NAME)')
1183 $(call py_action
,buildlist
,$(FINAL_TARGET
)/chrome.manifest
'manifest components/interfaces.manifest')
1189 ################################################################################
1190 # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
1191 ifneq (,$(filter %.js
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1192 ifeq (,$(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
)))
1193 ifndef NO_JS_MANIFEST
1194 $(error .js component without matching .manifest. See https
://developer.mozilla.org
/en
/XPCOM
/XPCOM_changes_in_Gecko_2.0
)
1199 ifdef EXTRA_COMPONENTS
1200 libs
:: $(EXTRA_COMPONENTS
)
1201 ifndef NO_DIST_INSTALL
1202 EXTRA_COMPONENTS_FILES
:= $(EXTRA_COMPONENTS
)
1203 EXTRA_COMPONENTS_DEST
:= $(FINAL_TARGET
)/components
1204 INSTALL_TARGETS
+= EXTRA_COMPONENTS
1209 ifdef EXTRA_PP_COMPONENTS
1210 ifndef NO_DIST_INSTALL
1211 EXTRA_PP_COMPONENTS_PATH
:= $(FINAL_TARGET
)/components
1212 PP_TARGETS
+= EXTRA_PP_COMPONENTS
1216 EXTRA_MANIFESTS
= $(filter %.manifest
,$(EXTRA_COMPONENTS
) $(EXTRA_PP_COMPONENTS
))
1217 ifneq (,$(EXTRA_MANIFESTS
))
1218 libs
:: $(call mkdir_deps
,$(FINAL_TARGET
))
1219 $(call py_action
,buildlist
,$(FINAL_TARGET
)/chrome.manifest
$(patsubst %,'manifest components/%',$(notdir $(EXTRA_MANIFESTS
))))
1222 ################################################################################
1223 # Copy each element of EXTRA_JS_MODULES to
1224 # $(FINAL_TARGET)/$(JS_MODULES_PATH). JS_MODULES_PATH defaults to "modules"
1225 # if it is undefined.
1226 JS_MODULES_PATH ?
= modules
1227 FINAL_JS_MODULES_PATH
:= $(FINAL_TARGET
)/$(JS_MODULES_PATH
)
1229 ifdef EXTRA_JS_MODULES
1230 ifndef NO_DIST_INSTALL
1231 EXTRA_JS_MODULES_FILES
:= $(EXTRA_JS_MODULES
)
1232 EXTRA_JS_MODULES_DEST
:= $(FINAL_JS_MODULES_PATH
)
1233 INSTALL_TARGETS
+= EXTRA_JS_MODULES
1237 ifdef EXTRA_PP_JS_MODULES
1238 ifndef NO_DIST_INSTALL
1239 EXTRA_PP_JS_MODULES_PATH
:= $(FINAL_JS_MODULES_PATH
)
1240 PP_TARGETS
+= EXTRA_PP_JS_MODULES
1244 ################################################################################
1245 # Copy testing-only JS modules to appropriate destination.
1247 # For each file defined in TESTING_JS_MODULES, copy it to
1248 # objdir/_tests/modules/. If TESTING_JS_MODULE_DIR is defined, that path
1249 # wlll be appended to the output directory.
1252 ifdef TESTING_JS_MODULES
1253 testmodulesdir
= $(DEPTH
)/_tests
/modules
/$(TESTING_JS_MODULE_DIR
)
1255 GENERATED_DIRS
+= $(testmodulesdir
)
1257 ifndef NO_DIST_INSTALL
1258 TESTING_JS_MODULES_FILES
:= $(TESTING_JS_MODULES
)
1259 TESTING_JS_MODULES_DEST
:= $(testmodulesdir
)
1260 INSTALL_TARGETS
+= TESTING_JS_MODULES
1266 ################################################################################
1269 ifneq (,$(SDK_LIBRARY
))
1270 ifndef NO_DIST_INSTALL
1271 SDK_LIBRARY_FILES
:= $(SDK_LIBRARY
)
1272 SDK_LIBRARY_DEST
:= $(SDK_LIB_DIR
)
1273 INSTALL_TARGETS
+= SDK_LIBRARY
1277 ifneq (,$(strip $(SDK_BINARY
)))
1278 ifndef NO_DIST_INSTALL
1279 SDK_BINARY_FILES
:= $(SDK_BINARY
)
1280 SDK_BINARY_DEST
:= $(SDK_BIN_DIR
)
1281 INSTALL_TARGETS
+= SDK_BINARY
1285 ################################################################################
1290 $(LOOP_OVER_PARALLEL_DIRS
)
1292 $(LOOP_OVER_TOOL_DIRS
)
1294 $(FINAL_TARGET
)/chrome
: $(call mkdir_deps
,$(FINAL_TARGET
)/chrome
)
1296 ifneq (,$(JAR_MANIFEST
))
1297 ifndef NO_DIST_INSTALL
1300 ifdef XPI_ROOT_APPID
1301 # For add-on packaging we may specify that an application
1302 # sub-dir should be added to the root chrome manifest with
1303 # a specific application id.
1304 MAKE_JARS_FLAGS
+= --root-manifest-entry-appid
='$(XPI_ROOT_APPID)'
1307 # if DIST_SUBDIR is defined but XPI_ROOT_APPID is not there's
1308 # no way langpacks will get packaged right, so error out.
1309 ifneq (,$(DIST_SUBDIR
))
1310 ifndef XPI_ROOT_APPID
1311 $(error XPI_ROOT_APPID is not defined
- langpacks will break.
)
1316 libs realchrome
:: $(FINAL_TARGET
)/chrome
1317 $(call py_action
,jar_maker
,\
1318 $(QUIET
) -j
$(FINAL_TARGET
)/chrome \
1319 $(MAKE_JARS_FLAGS
) $(XULPPFLAGS
) $(DEFINES
) $(ACDEFINES
) \
1324 # This is a temporary check to ensure patches relying on the old behavior
1325 # of silently picking up jar.mn files continue to work.
1326 else # No JAR_MANIFEST
1327 ifneq (,$(wildcard $(srcdir)/jar.mn
))
1328 $(error
$(srcdir) contains a jar.mn file but this file is not declared in a JAR_MANIFESTS variable in a moz.build file
)
1332 ifneq ($(DIST_FILES
),)
1333 DIST_FILES_PATH
:= $(FINAL_TARGET
)
1334 DIST_FILES_FLAGS
:= $(XULAPP_DEFINES
)
1335 PP_TARGETS
+= DIST_FILES
1338 ifneq ($(DIST_CHROME_FILES
),)
1339 DIST_CHROME_FILES_PATH
:= $(FINAL_TARGET
)/chrome
1340 DIST_CHROME_FILES_FLAGS
:= $(XULAPP_DEFINES
)
1341 PP_TARGETS
+= DIST_CHROME_FILES
1344 ifneq ($(XPI_PKGNAME
),)
1348 @echo
'Stripping $(XPI_PKGNAME) package directory...'
1349 @echo
$(FINAL_TARGET
)
1350 @cd
$(FINAL_TARGET
) && find .
! -type d \
1360 ! -name
'*.properties' \
1371 $(PLATFORM_EXCLUDE_LIST
) \
1372 -exec
$(STRIP
) $(STRIP_FLAGS
) {} >/dev
/null
2>&1 \
;
1375 @echo
'Packaging $(XPI_PKGNAME).xpi...'
1376 cd
$(FINAL_TARGET
) && $(ZIP
) -qr ..
/$(XPI_PKGNAME
).xpi
*
1379 ifdef INSTALL_EXTENSION_ID
1381 $(error XPI_NAME must be set for INSTALL_EXTENSION_ID
)
1385 $(RM
) -r
'$(DIST)/bin$(DIST_SUBDIR:%=/%)/extensions/$(INSTALL_EXTENSION_ID)'
1386 $(NSINSTALL
) -D
'$(DIST)/bin$(DIST_SUBDIR:%=/%)/extensions/$(INSTALL_EXTENSION_ID)'
1387 $(call copy_dir
,$(FINAL_TARGET
),$(DIST
)/bin
$(DIST_SUBDIR
:%=/%)/extensions
/$(INSTALL_EXTENSION_ID
))
1391 #############################################################################
1392 # MDDEPDIR is the subdirectory where all the dependency files are placed.
1393 # This uses a make rule (instead of a macro) to support parallel
1394 # builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
1395 # processes could simultaneously try to create the same directory.
1397 # We use $(CURDIR) in the rule's target to ensure that we don't find
1398 # a dependency directory in the source tree via VPATH (perhaps from
1399 # a previous build in the source tree) and thus neglect to create a
1400 # dependency directory in the object directory, where we really need
1403 ifneq (,$(filter-out all chrome default
export realchrome
clean clobber clobber_all
distclean realclean,$(MAKECMDGOALS
)))
1404 MDDEPEND_FILES
:= $(strip $(wildcard $(addprefix $(MDDEPDIR
)/,$(EXTRA_MDDEPEND_FILES
) $(addsuffix .pp
,$(notdir $(sort $(OBJS
) $(PROGOBJS
) $(HOST_OBJS
) $(HOST_PROGOBJS
))) $(TARGETS
)))))
1406 ifneq (,$(MDDEPEND_FILES
))
1407 $(call include_deps
,$(MDDEPEND_FILES
))
1413 ifneq (,$(filter export,$(MAKECMDGOALS
)))
1414 MDDEPEND_FILES
:= $(strip $(wildcard $(addprefix $(MDDEPDIR
)/,$(EXTRA_EXPORT_MDDEPEND_FILES
))))
1416 ifneq (,$(MDDEPEND_FILES
))
1417 $(call include_deps
,$(MDDEPEND_FILES
))
1422 #############################################################################
1424 -include $(topsrcdir
)/$(MOZ_BUILD_APP
)/app-rules.mk
1425 -include $(MY_RULES
)
1428 # Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
1432 ifneq ($(CSRCS
)$(CPPSRCS
)$(HEADERS
),)
1434 TAGS
:: $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
1435 $(ETAGS
) $(CSRCS
) $(CPPSRCS
) $(HEADERS
)
1439 ################################################################################
1440 # Install/copy rules
1442 # The INSTALL_TARGETS variable contains a list of all install target
1443 # categories. Each category defines a list of files and executables, and an
1444 # install destination,
1446 # FOO_FILES := foo bar
1447 # FOO_EXECUTABLES := baz
1448 # FOO_DEST := target_path
1449 # INSTALL_TARGETS += FOO
1451 # Additionally, a FOO_TARGET variable may be added to indicate the target for
1452 # which the files and executables are installed. Default is "libs".
1454 # Finally, a FOO_KEEP_PATH variable may be set to 1 to indicate the paths given
1455 # in FOO_FILES/FOO_EXECUTABLES are to be kept at the destination. That is,
1456 # if FOO_FILES is bar/baz/qux.h, and FOO_DEST is $(DIST)/include, the installed
1457 # file would be $(DIST)/include/bar/baz/qux.h instead of $(DIST)/include/qux.h
1459 # If we're using binary nsinstall and it's not built yet, fallback to python nsinstall.
1460 ifneq (,$(filter $(DIST
)/bin
/nsinstall
$(HOST_BIN_SUFFIX
),$(install_cmd
)))
1461 ifeq (,$(wildcard $(DIST
)/bin
/nsinstall
$(HOST_BIN_SUFFIX
)))
1462 nsinstall_is_usable
= $(if
$(wildcard $(DIST
)/bin
/nsinstall
$(HOST_BIN_SUFFIX
)),yes
)
1464 define install_cmd_override
1465 $(1): install_cmd
= $$(if
$$(nsinstall_is_usable
),$$(INSTALL
),$$(NSINSTALL_PY
)) $$(1)
1470 install_target_tier
= $(or
$($(1)_TARGET
),libs
)
1471 INSTALL_TARGETS_TIERS
:= $(sort $(foreach category
,$(INSTALL_TARGETS
),$(call install_target_tier
,$(category
))))
1473 install_target_result
= $($(1)_DEST
:%/=%)/$(if
$($(1)_KEEP_PATH
),$(2),$(notdir $(2)))
1474 install_target_files
= $(foreach file
,$($(1)_FILES
),$(call install_target_result
,$(category
),$(file
)))
1475 install_target_executables
= $(foreach file
,$($(1)_EXECUTABLES
),$(call install_target_result
,$(category
),$(file
)))
1477 # Work around a GNU make 3.81 bug where it gives $< the wrong value.
1478 # See details in bug 934864.
1479 define create_dependency
1484 define install_target_template
1485 $(call install_cmd_override
,$(2))
1486 $(call create_dependency
,$(2),$(1))
1489 $(foreach category
,$(INSTALL_TARGETS
),\
1490 $(if
$($(category
)_DEST
),,$(error Missing
$(category
)_DEST
)) \
1491 $(foreach tier
,$(call install_target_tier
,$(category
)),\
1492 $(eval INSTALL_TARGETS_FILES_
$(tier
) += $(call install_target_files
,$(category
))) \
1493 $(eval INSTALL_TARGETS_EXECUTABLES_
$(tier
) += $(call install_target_executables
,$(category
))) \
1495 $(foreach file
,$($(category
)_FILES
) $($(category
)_EXECUTABLES
), \
1496 $(eval
$(call install_target_template
,$(file
),$(call install_target_result
,$(category
),$(file
)))) \
1500 $(foreach tier
,$(INSTALL_TARGETS_TIERS
), \
1501 $(eval
$(tier
):: $(INSTALL_TARGETS_FILES_
$(tier
)) $(INSTALL_TARGETS_EXECUTABLES_
$(tier
))) \
1504 install_targets_sanity
= $(if
$(filter-out $(notdir $@
),$(notdir $(<))),$(error Looks like
$@ has an unexpected dependency on
$< which breaks INSTALL_TARGETS
))
1506 $(sort $(foreach tier
,$(INSTALL_TARGETS_TIERS
),$(INSTALL_TARGETS_FILES_
$(tier
)))):
1507 $(install_targets_sanity
)
1508 $(call install_cmd
,$(IFLAGS1
) '$<' '$(@D)')
1510 $(sort $(foreach tier
,$(INSTALL_TARGETS_TIERS
),$(INSTALL_TARGETS_EXECUTABLES_
$(tier
)))):
1511 $(install_targets_sanity
)
1512 $(call install_cmd
,$(IFLAGS2
) '$<' '$(@D)')
1514 ################################################################################
1515 # Preprocessing rules
1517 # The PP_TARGETS variable contains a list of all preprocessing target
1518 # categories. Each category has associated variables listing input files, the
1519 # output directory, extra preprocessor flags, and so on. For example:
1522 # FOO_PATH := target-directory
1523 # FOO_FLAGS := -Dsome_flag
1526 # If PP_TARGETS lists a category name <C> (like FOO, above), then we consult the
1527 # following make variables to see what to do:
1529 # - <C> lists input files to be preprocessed with mozbuild.action.preprocessor.
1530 # We search VPATH for the names given here. If an input file name ends in
1531 # '.in', that suffix is omitted from the output file name.
1533 # - <C>_PATH names the directory in which to place the preprocessed output
1534 # files. We create this directory if it does not already exist. Setting
1535 # this variable is optional; if unset, we install the files in $(CURDIR).
1537 # - <C>_FLAGS lists flags to pass to mozbuild.action.preprocessor, in addition
1538 # to the usual bunch. Setting this variable is optional.
1540 # - <C>_TARGET names the 'make' target that should depend on creating the output
1541 # files. Setting this variable is optional; if unset, we preprocess the
1542 # files for the 'libs' target.
1544 # - <C>_KEEP_PATH may be set to 1 to indicate the paths given in <C> are to be
1545 # kept under <C>_PATH. That is, if <C> is bar/baz/qux.h.in and <C>_PATH is
1546 # $(DIST)/include, the preprocessed file would be $(DIST)/include/bar/baz/qux.h
1547 # instead of $(DIST)/include/qux.h.
1549 pp_target_tier
= $(or
$($(1)_TARGET
),libs
)
1550 PP_TARGETS_TIERS
:= $(sort $(foreach category
,$(PP_TARGETS
),$(call pp_target_tier
,$(category
))))
1552 pp_target_result
= $(or
$($(1)_PATH
:%/=%),$(CURDIR
))/$(if
$($(1)_KEEP_PATH
),$(2:.in
=),$(notdir $(2:.in
=)))
1553 pp_target_results
= $(foreach file
,$($(1)),$(call pp_target_result
,$(category
),$(file
)))
1555 $(foreach category
,$(PP_TARGETS
), \
1556 $(foreach tier
,$(call pp_target_tier
,$(category
)), \
1557 $(eval PP_TARGETS_RESULTS_
$(tier
) += $(call pp_target_results
,$(category
))) \
1559 $(foreach file
,$($(category
)), \
1560 $(eval
$(call create_dependency
,$(call pp_target_result
,$(category
),$(file
)), \
1561 $(file
) $(GLOBAL_DEPS
))) \
1563 $(eval
$(call pp_target_results
,$(category
)): PP_TARGET_FLAGS
=$($(category
)_FLAGS
)) \
1566 $(foreach tier
,$(PP_TARGETS_TIERS
), \
1567 $(eval
$(tier
):: $(PP_TARGETS_RESULTS_
$(tier
))) \
1570 PP_TARGETS_ALL_RESULTS
:= $(sort $(foreach tier
,$(PP_TARGETS_TIERS
),$(PP_TARGETS_RESULTS_
$(tier
))))
1571 $(PP_TARGETS_ALL_RESULTS
):
1572 $(if
$(filter-out $(notdir $@
),$(notdir $(<:.in
=))),$(error Looks like
$@ has an unexpected dependency on
$< which breaks PP_TARGETS
))
1574 $(call py_action
,preprocessor
,--depend
$(MDDEPDIR
)/$(@F
).pp
$(PP_TARGET_FLAGS
) $(DEFINES
) $(ACDEFINES
) $(XULPPFLAGS
) '$<' -o
'$@')
1576 # The depfile is based on the filename, and we don't want conflicts. So check
1577 # there's only one occurrence of any given filename in PP_TARGETS_ALL_RESULTS.
1578 PP_TARGETS_ALL_RESULT_NAMES
:= $(notdir $(PP_TARGETS_ALL_RESULTS
))
1579 $(foreach file
,$(sort $(PP_TARGETS_ALL_RESULT_NAMES
)), \
1580 $(if
$(filter-out 1,$(words $(filter $(file
),$(PP_TARGETS_ALL_RESULT_NAMES
)))), \
1581 $(error Multiple preprocessing rules are creating a
$(file
) file
) \
1585 ifneq (,$(filter $(PP_TARGETS_TIERS
) $(PP_TARGETS_ALL_RESULTS
),$(MAKECMDGOALS
)))
1586 # If the depfile for a preprocessed file doesn't exist, add a dep to force
1588 $(foreach file
,$(PP_TARGETS_ALL_RESULTS
), \
1589 $(if
$(wildcard $(MDDEPDIR
)/$(notdir $(file
)).pp
), \
1591 $(eval
$(file
): FORCE
) \
1595 MDDEPEND_FILES
:= $(strip $(wildcard $(addprefix $(MDDEPDIR
)/,$(addsuffix .pp
,$(notdir $(PP_TARGETS_ALL_RESULTS
))))))
1597 ifneq (,$(MDDEPEND_FILES
))
1598 $(call include_deps
,$(MDDEPEND_FILES
))
1603 # Pull in non-recursive targets if this is a partial tree build.
1604 ifndef TOPLEVEL_BUILD
1605 include $(topsrcdir
)/config
/makefiles
/nonrecursive.mk
1608 ################################################################################
1609 # Special gmake rules.
1610 ################################################################################
1614 # Re-define the list of default suffixes, so gmake won't have to churn through
1615 # hundreds of built-in suffix rules for stuff we don't need.
1620 # Fake targets. Always run these rules, even if a file/directory with that
1621 # name already exists.
1623 .PHONY
: all alltags boot checkout chrome realchrome
clean clobber clobber_all
export install libs makefiles
realclean run_apprunner tools
$(DIRS
) $(TOOL_DIRS
) FORCE
1625 # Used as a dependency to force targets to rebuild
1628 # Delete target if error occurs when building target
1633 TAGS
: $(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
1634 -etags
$(CSRCS
) $(CPPSRCS
) $(wildcard *.h
)
1635 $(LOOP_OVER_PARALLEL_DIRS
)
1638 ifndef INCLUDED_DEBUGMAKE_MK
#{
1639 ## Only parse when an echo* or show* target is requested
1640 ifneq (,$(call isTargetStem
,echo
,show
))
1641 include $(topsrcdir
)/config
/makefiles
/debugmake.mk
1647 $(DOXYGEN
) $(DEPTH
)/config
/doxygen.cfg
1651 $(LOOP_OVER_PARALLEL_DIRS
)
1653 $(LOOP_OVER_TOOL_DIRS
)
1657 FREEZE_VARIABLES
= \
1666 EXTRA_PP_COMPONENTS \
1668 MOCHITEST_CHROME_FILES \
1669 MOCHITEST_BROWSER_FILES \
1670 MOCHITEST_A11Y_FILES \
1671 MOCHITEST_METRO_FILES \
1672 MOCHITEST_ROBOCOP_FILES \
1675 $(foreach var
,$(FREEZE_VARIABLES
),$(eval
$(var
)_FROZEN
:= '$($(var))'))
1677 CHECK_FROZEN_VARIABLES
= $(foreach var
,$(FREEZE_VARIABLES
), \
1678 $(if
$(subst $($(var
)_FROZEN
),,'$($(var))'),$(error Makefile variable
'$(var)' changed value after including rules.mk. Was
$($(var
)_FROZEN
), now
$($(var
)).
)))
1681 $(CHECK_FROZEN_VARIABLES
)
1683 PURGECACHES_DIRS ?
= $(DIST
)/bin
1684 ifdef MOZ_WEBAPP_RUNTIME
1685 PURGECACHES_DIRS
+= $(DIST
)/bin
/webapprt
1688 PURGECACHES_FILES
= $(addsuffix /.purgecaches
,$(PURGECACHES_DIRS
))
1690 default
all:: $(PURGECACHES_FILES
)
1692 $(PURGECACHES_FILES
):
1693 if
test -d
$(@D
) ; then touch
$@
; fi
1695 .DEFAULT_GOAL
:= $(or
$(OVERRIDE_DEFAULT_GOAL
),default
)
1697 #############################################################################
1698 # Derived targets and dependencies
1700 include $(topsrcdir
)/config
/makefiles
/autotargets.mk
1701 ifneq ($(NULL
),$(AUTO_DEPS
))
1702 default
all libs tools
export:: $(AUTO_DEPS
)
1705 export:: $(GENERATED_FILES
)
1707 GARBAGE
+= $(GENERATED_FILES
)