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
68 ifdef COMPILE_ENVIRONMENT
69 include $(topsrcdir
)/$(MOZ_BUILD_APP
)/build.mk
76 tier_testharness_dirs
+= testing
/xpcshell
79 include $(topsrcdir
)/config
/config.mk
81 GARBAGE_DIRS
+= dist _javagen _profile _tests staticlib
82 DIST_GARBAGE
= config.cache config.log config.status config-defs.h \
83 dependencies.beos config
/autoconf.mk \
84 unallmakefiles mozilla-config.h \
85 netwerk
/necko-config.h xpcom
/xpcom-config.h xpcom
/xpcom-private.h \
86 $(topsrcdir
)/.mozconfig.mk
$(topsrcdir
)/.mozconfig.out
90 $(PYTHON
) $(topsrcdir
)/build
/mobile
/devicemanager-utils.py copy
$(DIST
)/bin
93 default alldep
all:: $(topsrcdir
)/configure config.status
95 $(RM
) -rf
$(DIST
)/include
96 $(RM
) -rf
$(DIST
)/private
97 $(RM
) -rf
$(DIST
)/public
98 $(RM
) -rf
$(DIST
)/bin
/components
101 $(topsrcdir
)/configure
: $(topsrcdir
)/configure.in
102 @echo
"STOP! configure.in has changed, and your configure is out of date."
103 @echo
"Please rerun autoconf and re-configure your build directory."
104 @echo
"To ignore this message, touch 'configure' in the source directory,"
105 @echo
"but your build might not succeed."
108 config.status
: $(topsrcdir
)/configure
109 @echo
"STOP! configure has changed and needs to be run in this build directory."
110 @echo
"Please rerun configure."
111 @echo
"To ignore this message, touch 'config.status' in the build directory,"
112 @echo
"but your build might not succeed."
115 # Build pseudo-external modules first when export is explicitly called
117 $(RM
) -rf
$(DIST
)/sdk
118 $(MAKE
) -C config
export
122 # Additional makefile targets to call automated test suites
123 include $(topsrcdir
)/testing
/testsuite-targets.mk
125 # OS X Universal builds will want to call this, so stub it out
129 include $(topsrcdir
)/config
/rules.mk
132 cat unallmakefiles |
$(XARGS
) rm -f
133 rm -f unallmakefiles
$(DIST_GARBAGE
)
135 ifeq ($(OS_ARCH
),WINNT
)
136 # we want to copy PDB files on Windows
137 MAKE_SYM_STORE_ARGS
:= -c
139 MAKE_SYM_STORE_ARGS
+= -i
141 ifeq (,$(CYGWIN_WRAPPER
))
142 # this doesn't work with Cygwin Python
143 MAKE_SYM_STORE_ARGS
+= --vcs-info
145 DUMP_SYMS_BIN ?
= $(topsrcdir
)/toolkit
/crashreporter
/tools
/win32
/dump_syms.exe
146 # PDB files don't get moved to dist, so we need to scan the whole objdir
147 MAKE_SYM_STORE_PATH
:= .
149 ifeq ($(OS_ARCH
),Darwin
)
150 # need to pass arch flags for universal builds
151 ifdef UNIVERSAL_BINARY
152 MAKE_SYM_STORE_ARGS
:= -c
-a
"ppc i386" --vcs-info
153 MAKE_SYM_STORE_PATH
:= $(DIST
)/universal
155 MAKE_SYM_STORE_ARGS
:= -c
-a
$(OS_TEST
) --vcs-info
156 MAKE_SYM_STORE_PATH
:= $(DIST
)/bin
158 DUMP_SYMS_BIN ?
= $(DIST
)/host
/bin
/dump_syms
160 ifeq (,$(filter-out Linux SunOS
,$(OS_ARCH
)))
161 MAKE_SYM_STORE_ARGS
:= -c
--vcs-info
162 DUMP_SYMS_BIN ?
= $(DIST
)/host
/bin
/dump_syms
163 MAKE_SYM_STORE_PATH
:= $(DIST
)/bin
166 SYM_STORE_SOURCE_DIRS
:= $(topsrcdir
)
168 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
170 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
171 EXTRA_BUILDID
:= -$(MOZ_SYMBOLS_EXTRA_BUILDID
)
174 SYMBOL_INDEX_NAME
= \
175 $(MOZ_APP_NAME
)-$(MOZ_APP_VERSION
)-$(OS_ARCH
)-$(BUILDID
)$(EXTRA_BUILDID
)-symbols.txt
178 ifdef MOZ_CRASHREPORTER
179 echo building symbol store
180 $(RM
) -rf
$(DIST
)/crashreporter-symbols
181 $(RM
) -f
"$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
182 $(NSINSTALL
) -D
$(DIST
)/crashreporter-symbols
183 $(PYTHON
) $(topsrcdir
)/toolkit
/crashreporter
/tools
/symbolstore.py \
184 $(MAKE_SYM_STORE_ARGS
) \
185 $(foreach dir,$(SYM_STORE_SOURCE_DIRS
),-s
$(dir)) \
187 $(DIST
)/crashreporter-symbols \
188 $(MAKE_SYM_STORE_PATH
) > \
189 $(DIST
)/crashreporter-symbols
/$(SYMBOL_INDEX_NAME
)
191 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
192 cd
$(DIST
)/crashreporter-symbols
&& \
193 zip
-r9D
"../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
196 ifdef SYMBOLSTORE_PATH
197 echo building symbol store with symstore.exe
198 $(RM
) -rf
$(DIST
)/symbols
199 $(RM
) -f
"$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
200 $(NSINSTALL
) -D
$(DIST
)/symbols
201 $(SYMBOLSTORE_PATH
) add
-r
-f
"$(subst /,\,$(shell pwd -W))\*.PDB" \
202 -s
$(DIST
)/symbols
/ -t
"$(MOZ_PKG_APPNAME)" -v
"$(MOZ_PKG_VERSION)"
204 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
205 cd
$(DIST
)/symbols
&& \
206 zip
-r9D
"../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
207 endif # SYMBOLSTORE_PATH
209 endif # MOZ_CRASHREPORTER
212 ifdef MOZ_CRASHREPORTER
213 $(SHELL
) $(topsrcdir
)/toolkit
/crashreporter
/tools
/upload_symbols.sh
"$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
216 # defined in package-name.mk
217 export MOZ_SOURCE_STAMP
219 #XXX: this is a hack, since we don't want to clobber for MSVC
220 # PGO support, but we can't do this test in client.mk
221 ifneq ($(OS_ARCH
)_
$(GNU_CC
), WINNT_
)
222 # No point in clobbering if PGO has been explicitly disabled.
223 ifndef NO_PROFILE_GUIDED_OPTIMIZE
224 maybe_clobber_profiledbuild
: clean
226 maybe_clobber_profiledbuild
:
229 maybe_clobber_profiledbuild
:
232 .PHONY
: maybe_clobber_profiledbuild