2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 topsrcdir
= @top_srcdir@
12 ifeq (,$(MAKE_VERSION
))
13 $(error GNU Make is required
)
15 ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION
)))
16 $(error GNU Make
3.80 or higher is required
)
20 include $(DEPTH
)/config
/autoconf.mk
27 # tier "base" - basic setup
37 ifeq (android
,$(MOZ_WIDGET_TOOLKIT
))
39 other-licenses
/android \
42 ifeq (gonk
,$(MOZ_WIDGET_TOOLKIT
))
44 other-licenses
/android \
49 tier_base_dirs
+= memory
/mozjemalloc
51 ifndef MOZ_NATIVE_JEMALLOC
52 tier_base_dirs
+= memory
/jemalloc
55 tier_base_dirs
+= memory
/build
57 ifndef MOZ_NATIVE_ZLIB
58 tier_base_dirs
+= modules
/zlib
66 ifdef COMPILE_ENVIRONMENT
67 include $(topsrcdir
)/$(MOZ_BUILD_APP
)/build.mk
71 include $(topsrcdir
)/config
/config.mk
73 GARBAGE_DIRS
+= dist _javagen _profile _tests staticlib
74 DIST_GARBAGE
= config.cache config.log config.status
* config-defs.h \
76 unallmakefiles mozilla-config.h \
77 netwerk
/necko-config.h xpcom
/xpcom-config.h xpcom
/xpcom-private.h \
78 $(topsrcdir
)/.mozconfig.mk
$(topsrcdir
)/.mozconfig.out
80 default alldep
all:: $(topsrcdir
)/configure config.status
82 $(RM
) -r
$(DIST
)/include
83 $(RM
) -r
$(DIST
)/private
84 $(RM
) -r
$(DIST
)/public
85 $(RM
) $(DIST
)/bin
/chrome.manifest
$(DIST
)/bin
/components
/components.manifest
88 $(topsrcdir
)/configure
: $(topsrcdir
)/configure.in
89 @echo
"STOP! configure.in has changed, and your configure is out of date."
90 @echo
"Please rerun autoconf and re-configure your build directory."
91 @echo
"To ignore this message, touch 'configure' in the source directory,"
92 @echo
"but your build might not succeed."
95 config.status
: $(topsrcdir
)/configure
96 @echo
"STOP! configure has changed and needs to be run in this build directory."
97 @echo
"Please rerun configure."
98 @echo
"To ignore this message, touch 'config.status' in the build directory,"
99 @echo
"but your build might not succeed."
102 # Build pseudo-external modules first when export is explicitly called
105 $(MAKE
) -C config
export
109 # Additional makefile targets to call automated test suites
110 include $(topsrcdir
)/testing
/testsuite-targets.mk
113 include $(topsrcdir
)/config
/rules.mk
116 cat unallmakefiles |
$(XARGS
) rm -f
117 $(RM
) unallmakefiles
$(DIST_GARBAGE
)
119 ifeq ($(OS_ARCH
),WINNT
)
120 # we want to copy PDB files on Windows
121 MAKE_SYM_STORE_ARGS
:= -c
--vcs-info
123 MAKE_SYM_STORE_ARGS
+= -i
125 DUMP_SYMS_BIN ?
= $(topsrcdir
)/toolkit
/crashreporter
/tools
/win32
/dump_syms_vc
$(_MSC_VER
).exe
126 # PDB files don't get moved to dist, so we need to scan the whole objdir
127 MAKE_SYM_STORE_PATH
:= .
129 ifeq ($(OS_ARCH
),Darwin
)
130 # need to pass arch flags for universal builds
131 ifdef UNIVERSAL_BINARY
132 MAKE_SYM_STORE_ARGS
:= -c
-a
"i386 x86_64" --vcs-info
133 MAKE_SYM_STORE_PATH
:= $(DIST
)/universal
135 MAKE_SYM_STORE_ARGS
:= -c
-a
$(OS_TEST
) --vcs-info
136 MAKE_SYM_STORE_PATH
:= $(DIST
)/bin
138 DUMP_SYMS_BIN ?
= $(DIST
)/host
/bin
/dump_syms
140 ifeq (,$(filter-out Linux SunOS
,$(OS_ARCH
)))
141 MAKE_SYM_STORE_ARGS
:= -c
--vcs-info
142 DUMP_SYMS_BIN ?
= $(DIST
)/host
/bin
/dump_syms
143 MAKE_SYM_STORE_PATH
:= $(DIST
)/bin
146 SYM_STORE_SOURCE_DIRS
:= $(topsrcdir
)
148 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
150 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
151 EXTRA_BUILDID
:= -$(MOZ_SYMBOLS_EXTRA_BUILDID
)
154 SYMBOL_INDEX_NAME
= \
155 $(MOZ_APP_NAME
)-$(MOZ_APP_VERSION
)-$(OS_TARGET
)-$(BUILDID
)-$(CPU_ARCH
)$(EXTRA_BUILDID
)-symbols.txt
158 ifdef MOZ_CRASHREPORTER
160 ifeq (mobile
,$(MOZ_BUILD_APP
))
161 $(MAKE
) -C mobile
/xul
/installer elfhack
163 $(MAKE
) -C
$(MOZ_BUILD_APP
)/installer elfhack
166 echo building symbol store
167 $(RM
) -r
$(DIST
)/crashreporter-symbols
168 $(RM
) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
169 $(NSINSTALL
) -D
$(DIST
)/crashreporter-symbols
170 OBJCOPY
="$(OBJCOPY)" \
171 $(PYTHON
) $(topsrcdir
)/toolkit
/crashreporter
/tools
/symbolstore.py \
172 $(MAKE_SYM_STORE_ARGS
) \
173 $(foreach dir,$(SYM_STORE_SOURCE_DIRS
),-s
$(dir)) \
175 $(DIST
)/crashreporter-symbols \
176 $(MAKE_SYM_STORE_PATH
) | grep
-iv
test > \
177 $(DIST
)/crashreporter-symbols
/$(SYMBOL_INDEX_NAME
)
179 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
180 cd
$(DIST
)/crashreporter-symbols
&& \
181 zip
-r9D
"../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
-x
"*test*" -x
"*Test*"
182 cd
$(DIST
)/crashreporter-symbols
&& \
183 grep
"sym" $(SYMBOL_INDEX_NAME
) > $(SYMBOL_INDEX_NAME
).tmp
&& \
184 mv
$(SYMBOL_INDEX_NAME
).tmp
$(SYMBOL_INDEX_NAME
)
185 cd
$(DIST
)/crashreporter-symbols
&& \
186 zip
-r9D
"../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
-i
"*.sym" -i
"*.txt" -x
"*test*" -x
"*Test*"
187 endif # MOZ_CRASHREPORTER
190 ifdef MOZ_CRASHREPORTER
191 $(SHELL
) $(topsrcdir
)/toolkit
/crashreporter
/tools
/upload_symbols.sh
$(SYMBOL_INDEX_NAME
) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
195 $(MAKE
) -C
$(MOZ_BUILD_APP
)/installer codesighs
197 # defined in package-name.mk
198 export MOZ_SOURCE_STAMP
200 #XXX: this is a hack, since we don't want to clobber for MSVC
201 # PGO support, but we can't do this test in client.mk
202 ifneq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
203 # No point in clobbering if PGO has been explicitly disabled.
204 ifndef NO_PROFILE_GUIDED_OPTIMIZE
205 maybe_clobber_profiledbuild
: clean
207 maybe_clobber_profiledbuild
:
210 maybe_clobber_profiledbuild
:
211 $(RM
) $(DIST
)/bin
/*.pgc
212 find
$(DIST
)/$(MOZ_APP_NAME
) -name
"*.pgc" -exec mv
{} $(DIST
)/bin \
;
215 # put in our default gdbinit so that the gdb debugging experience is happier.
217 $(INSTALL
) $< $(DIST
)/bin
219 .PHONY
: maybe_clobber_profiledbuild
221 # Look for R_386_PC32 relocations in shared libs, these
222 # break x86_64 builds and SELinux users.
223 ifeq ($(OS_TARGET
)_
$(TARGET_XPCOM_ABI
),Linux_x86-gcc3
)
225 @relcount
=`find $(DIST)/bin -name "*.so" | xargs objdump -R | grep R_386_PC32 | wc -l` && if
test $$relcount -gt
0; then echo
"FAILED: R_386_PC32 relocations detected in a shared library. Did you use a system header without adding it to config/system-headers?"; exit
1; else echo
"PASSED"; fi
228 js
/src
/Makefile
: subsrcdir
:= js
/src