2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Original Code is mozilla.org code.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998
20 # the Initial Developer. All Rights Reserved.
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
39 topsrcdir
= @top_srcdir@
44 ifeq (,$(MAKE_VERSION
))
45 $(error GNU Make is required
)
47 ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION
)))
48 $(error GNU Make
3.80 or higher is required
)
52 include $(DEPTH
)/config
/autoconf.mk
59 # tier "base" - basic setup
69 ifeq (android
,$(MOZ_WIDGET_TOOLKIT
))
71 other-licenses
/android \
72 other-licenses
/skia-npapi \
75 ifeq (gonk
,$(MOZ_WIDGET_TOOLKIT
))
77 other-licenses
/android \
82 tier_base_dirs
+= memory
/jemalloc
83 tier_base_dirs
+= memory
/build
91 ifdef COMPILE_ENVIRONMENT
92 include $(topsrcdir
)/$(MOZ_BUILD_APP
)/build.mk
96 include $(topsrcdir
)/config
/config.mk
98 GARBAGE_DIRS
+= dist _javagen _profile _tests staticlib
99 DIST_GARBAGE
= config.cache config.log config.status config-defs.h \
101 unallmakefiles mozilla-config.h \
102 netwerk
/necko-config.h xpcom
/xpcom-config.h xpcom
/xpcom-private.h \
103 $(topsrcdir
)/.mozconfig.mk
$(topsrcdir
)/.mozconfig.out
105 default alldep
all:: $(topsrcdir
)/configure config.status
107 $(RM
) -r
$(DIST
)/include
108 $(RM
) -r
$(DIST
)/private
109 $(RM
) -r
$(DIST
)/public
110 $(RM
) -r
$(DIST
)/bin
/components
113 $(topsrcdir
)/configure
: $(topsrcdir
)/configure.in
114 @echo
"STOP! configure.in has changed, and your configure is out of date."
115 @echo
"Please rerun autoconf and re-configure your build directory."
116 @echo
"To ignore this message, touch 'configure' in the source directory,"
117 @echo
"but your build might not succeed."
120 config.status
: $(topsrcdir
)/configure
121 @echo
"STOP! configure has changed and needs to be run in this build directory."
122 @echo
"Please rerun configure."
123 @echo
"To ignore this message, touch 'config.status' in the build directory,"
124 @echo
"but your build might not succeed."
127 # Build pseudo-external modules first when export is explicitly called
130 $(MAKE
) -C config
export
134 # Additional makefile targets to call automated test suites
135 include $(topsrcdir
)/testing
/testsuite-targets.mk
138 include $(topsrcdir
)/config
/rules.mk
141 cat unallmakefiles |
$(XARGS
) rm -f
142 $(RM
) unallmakefiles
$(DIST_GARBAGE
)
144 ifeq ($(OS_ARCH
),WINNT
)
145 # we want to copy PDB files on Windows
146 MAKE_SYM_STORE_ARGS
:= -c
--vcs-info
148 MAKE_SYM_STORE_ARGS
+= -i
150 DUMP_SYMS_BIN ?
= $(topsrcdir
)/toolkit
/crashreporter
/tools
/win32
/dump_syms_vc
$(_MSC_VER
).exe
151 # PDB files don't get moved to dist, so we need to scan the whole objdir
152 MAKE_SYM_STORE_PATH
:= .
154 ifeq ($(OS_ARCH
),Darwin
)
155 # need to pass arch flags for universal builds
156 ifdef UNIVERSAL_BINARY
157 MAKE_SYM_STORE_ARGS
:= -c
-a
"i386 x86_64" --vcs-info
158 MAKE_SYM_STORE_PATH
:= $(DIST
)/universal
160 MAKE_SYM_STORE_ARGS
:= -c
-a
$(OS_TEST
) --vcs-info
161 MAKE_SYM_STORE_PATH
:= $(DIST
)/bin
163 DUMP_SYMS_BIN ?
= $(DIST
)/host
/bin
/dump_syms
165 ifeq (,$(filter-out Linux SunOS
,$(OS_ARCH
)))
166 MAKE_SYM_STORE_ARGS
:= -c
--vcs-info
167 DUMP_SYMS_BIN ?
= $(DIST
)/host
/bin
/dump_syms
168 MAKE_SYM_STORE_PATH
:= $(DIST
)/bin
171 SYM_STORE_SOURCE_DIRS
:= $(topsrcdir
)
173 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
175 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
176 EXTRA_BUILDID
:= -$(MOZ_SYMBOLS_EXTRA_BUILDID
)
179 SYMBOL_INDEX_NAME
= \
180 $(MOZ_APP_NAME
)-$(MOZ_APP_VERSION
)-$(OS_TARGET
)-$(BUILDID
)$(EXTRA_BUILDID
)-symbols.txt
183 ifdef MOZ_CRASHREPORTER
185 ifeq (mobile
,$(MOZ_BUILD_APP
))
186 $(MAKE
) -C mobile
/xul
/installer elfhack
188 $(MAKE
) -C
$(MOZ_BUILD_APP
)/installer elfhack
191 echo building symbol store
192 $(RM
) -r
$(DIST
)/crashreporter-symbols
193 $(RM
) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
194 $(NSINSTALL
) -D
$(DIST
)/crashreporter-symbols
195 OBJCOPY
="$(OBJCOPY)" \
196 $(PYTHON
) $(topsrcdir
)/toolkit
/crashreporter
/tools
/symbolstore.py \
197 $(MAKE_SYM_STORE_ARGS
) \
198 $(foreach dir,$(SYM_STORE_SOURCE_DIRS
),-s
$(dir)) \
200 $(DIST
)/crashreporter-symbols \
201 $(MAKE_SYM_STORE_PATH
) > \
202 $(DIST
)/crashreporter-symbols
/$(SYMBOL_INDEX_NAME
)
204 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
205 cd
$(DIST
)/crashreporter-symbols
&& \
206 zip
-r9D
"../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
207 cd
$(DIST
)/crashreporter-symbols
&& \
208 grep
"sym" $(SYMBOL_INDEX_NAME
) > $(SYMBOL_INDEX_NAME
).tmp
&& \
209 mv
$(SYMBOL_INDEX_NAME
).tmp
$(SYMBOL_INDEX_NAME
)
210 cd
$(DIST
)/crashreporter-symbols
&& \
211 zip
-r9D
"../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
-i
"*.sym" -i
"*.txt"
212 endif # MOZ_CRASHREPORTER
215 ifdef MOZ_CRASHREPORTER
216 $(SHELL
) $(topsrcdir
)/toolkit
/crashreporter
/tools
/upload_symbols.sh
$(SYMBOL_INDEX_NAME
) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
220 $(MAKE
) -C
$(MOZ_BUILD_APP
)/installer codesighs
222 # defined in package-name.mk
223 export MOZ_SOURCE_STAMP
225 #XXX: this is a hack, since we don't want to clobber for MSVC
226 # PGO support, but we can't do this test in client.mk
227 ifneq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
228 # No point in clobbering if PGO has been explicitly disabled.
229 ifndef NO_PROFILE_GUIDED_OPTIMIZE
230 maybe_clobber_profiledbuild
: clean
232 maybe_clobber_profiledbuild
:
235 maybe_clobber_profiledbuild
:
236 $(RM
) $(DIST
)/bin
/*.pgc
237 find
$(DIST
)/$(MOZ_APP_NAME
) -name
"*.pgc" -exec mv
{} $(DIST
)/bin \
;
240 .PHONY
: maybe_clobber_profiledbuild
242 # Look for R_386_PC32 relocations in shared libs, these
243 # break x86_64 builds and SELinux users.
244 ifeq ($(OS_TARGET
)_
$(TARGET_XPCOM_ABI
),Linux_x86-gcc3
)
246 @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