bug 563317: Install Visual C++ 2010 on build slaves - includable vs2010 mozconfig...
[gecko.git] / Makefile.in
blob3b9f3234818bb409163bcf8b9a01afaeb9752417
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
13 # License.
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.
22 # Contributor(s):
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 *****
38 DEPTH = .
39 topsrcdir = @top_srcdir@
40 srcdir = @srcdir@
41 VPATH = @srcdir@
43 ifndef .PYMAKE
44 ifeq (,$(MAKE_VERSION))
45 $(error GNU Make is required)
46 endif
47 ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION)))
48 $(error GNU Make 3.80 or higher is required)
49 endif
50 endif
52 include $(DEPTH)/config/autoconf.mk
54 default::
56 TIERS += base
59 # tier "base" - basic setup
61 tier_base_dirs = \
62 config \
63 build \
64 probes \
65 $(NULL)
67 ifndef LIBXUL_SDK
68 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
69 tier_base_dirs += other-licenses/android
70 endif
72 tier_base_dirs += memory
73 endif
75 ifdef COMPILE_ENVIRONMENT
76 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
77 endif
80 include $(topsrcdir)/config/config.mk
82 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
83 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
84 config/autoconf.mk \
85 unallmakefiles mozilla-config.h \
86 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
87 $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
89 default alldep all:: $(topsrcdir)/configure config.status
90 $(RM) -r $(DIST)/sdk
91 $(RM) -r $(DIST)/include
92 $(RM) -r $(DIST)/private
93 $(RM) -r $(DIST)/public
94 $(RM) -r $(DIST)/bin/components
95 $(RM) -r _tests
97 $(topsrcdir)/configure: $(topsrcdir)/configure.in
98 @echo "STOP! configure.in has changed, and your configure is out of date."
99 @echo "Please rerun autoconf and re-configure your build directory."
100 @echo "To ignore this message, touch 'configure' in the source directory,"
101 @echo "but your build might not succeed."
102 @exit 1
104 config.status: $(topsrcdir)/configure
105 @echo "STOP! configure has changed and needs to be run in this build directory."
106 @echo "Please rerun configure."
107 @echo "To ignore this message, touch 'config.status' in the build directory,"
108 @echo "but your build might not succeed."
109 @exit 1
111 # Build pseudo-external modules first when export is explicitly called
112 export::
113 $(RM) -r $(DIST)/sdk
114 $(MAKE) -C config export
115 $(MAKE) tier_nspr
117 ifdef ENABLE_TESTS
118 # Additional makefile targets to call automated test suites
119 include $(topsrcdir)/testing/testsuite-targets.mk
120 endif
122 include $(topsrcdir)/config/rules.mk
124 distclean::
125 cat unallmakefiles | $(XARGS) rm -f
126 $(RM) unallmakefiles $(DIST_GARBAGE)
128 ifeq ($(OS_ARCH),WINNT)
129 # we want to copy PDB files on Windows
130 MAKE_SYM_STORE_ARGS := -c --vcs-info
131 ifdef PDBSTR_PATH
132 MAKE_SYM_STORE_ARGS += -i
133 endif
134 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).exe
135 # PDB files don't get moved to dist, so we need to scan the whole objdir
136 MAKE_SYM_STORE_PATH := .
137 endif
138 ifeq ($(OS_ARCH),Darwin)
139 # need to pass arch flags for universal builds
140 ifdef UNIVERSAL_BINARY
141 MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
142 MAKE_SYM_STORE_PATH := $(DIST)/universal
143 else
144 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
145 MAKE_SYM_STORE_PATH := $(DIST)/bin
146 endif
147 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
148 endif
149 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
150 MAKE_SYM_STORE_ARGS := -c --vcs-info
151 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
152 MAKE_SYM_STORE_PATH := $(DIST)/bin
153 endif
155 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
157 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
159 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
160 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
161 endif
163 SYMBOL_INDEX_NAME = \
164 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
166 buildsymbols:
167 ifdef MOZ_CRASHREPORTER
168 ifdef USE_ELF_HACK
169 $(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
170 endif
171 echo building symbol store
172 $(RM) -r $(DIST)/crashreporter-symbols
173 $(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
174 $(NSINSTALL) -D $(DIST)/crashreporter-symbols
175 OBJCOPY="$(OBJCOPY)" \
176 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
177 $(MAKE_SYM_STORE_ARGS) \
178 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
179 $(DUMP_SYMS_BIN) \
180 $(DIST)/crashreporter-symbols \
181 $(MAKE_SYM_STORE_PATH) > \
182 $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
183 echo packing symbols
184 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
185 cd $(DIST)/crashreporter-symbols && \
186 zip -r9D "../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
187 cd $(DIST)/crashreporter-symbols && \
188 grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
189 mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
190 cd $(DIST)/crashreporter-symbols && \
191 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
192 endif # MOZ_CRASHREPORTER
194 uploadsymbols:
195 ifdef MOZ_CRASHREPORTER
196 $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
197 endif
199 codesighs:
200 $(MAKE) -C $(MOZ_BUILD_APP)/installer codesighs
202 # defined in package-name.mk
203 export MOZ_SOURCE_STAMP
205 #XXX: this is a hack, since we don't want to clobber for MSVC
206 # PGO support, but we can't do this test in client.mk
207 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
208 # No point in clobbering if PGO has been explicitly disabled.
209 ifndef NO_PROFILE_GUIDED_OPTIMIZE
210 maybe_clobber_profiledbuild: clean
211 else
212 maybe_clobber_profiledbuild:
213 endif
214 else
215 maybe_clobber_profiledbuild:
216 $(RM) $(DIST)/bin/*.pgc
217 find $(DIST)/$(MOZ_APP_NAME) -name "*.pgc" -exec mv {} $(DIST)/bin \;
218 endif
220 .PHONY: maybe_clobber_profiledbuild
222 # Look for R_386_PC32 relocations in shared libs, these
223 # break x86_64 builds and SELinux users.
224 ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3)
225 scheck::
226 @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
227 endif