bug 839193 - test for corresponding bug r=bent
[gecko.git] / Makefile.in
blob28e8e2068bdb23bc5b6d66955857661a5fca2ac3
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/.
6 DEPTH = @DEPTH@
7 topsrcdir = @top_srcdir@
8 srcdir = @srcdir@
9 VPATH = @srcdir@
11 ifndef .PYMAKE
12 ifeq (,$(MAKE_VERSION))
13 $(error GNU Make is required)
14 endif
15 ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION)))
16 $(error GNU Make 3.80 or higher is required)
17 endif
18 endif
20 include $(DEPTH)/config/autoconf.mk
22 default::
24 TIERS += base
27 # tier "base" - basic setup
29 tier_base_dirs = \
30 config \
31 build \
32 probes \
33 mfbt \
34 python \
35 $(NULL)
37 ifndef LIBXUL_SDK
38 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
39 tier_base_dirs += \
40 other-licenses/android \
41 $(NULL)
42 endif
43 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
44 tier_base_dirs += \
45 other-licenses/android \
46 $(NULL)
47 endif
49 ifdef MOZ_MEMORY
50 tier_base_dirs += memory
51 endif
52 ifndef MOZ_NATIVE_ZLIB
53 tier_base_dirs += modules/zlib
54 endif
55 tier_base_dirs += \
56 mozglue \
57 memory/mozalloc \
58 $(NULL)
59 endif
61 ifdef COMPILE_ENVIRONMENT
62 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
63 endif
66 include $(topsrcdir)/config/config.mk
68 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
69 DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
70 config/autoconf.mk \
71 unallmakefiles mozilla-config.h \
72 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
73 $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
75 default alldep all:: $(topsrcdir)/configure config.status
76 $(RM) -r $(DIST)/sdk
77 $(RM) -r $(DIST)/include
78 $(RM) -r $(DIST)/private
79 $(RM) -r $(DIST)/public
80 $(RM) $(DIST)/bin/chrome.manifest $(DIST)/bin/components/components.manifest
81 $(RM) -r _tests
83 $(topsrcdir)/configure: $(topsrcdir)/configure.in
84 @echo "STOP! configure.in has changed, and your configure is out of date."
85 @echo "Please rerun autoconf and re-configure your build directory."
86 @echo "To ignore this message, touch 'configure' in the source directory,"
87 @echo "but your build might not succeed."
88 @exit 1
90 config.status: $(topsrcdir)/configure
91 @echo "STOP! configure has changed and needs to be run in this build directory."
92 @echo "Please rerun configure."
93 @echo "To ignore this message, touch 'config.status' in the build directory,"
94 @echo "but your build might not succeed."
95 @exit 1
97 # Build pseudo-external modules first when export is explicitly called
98 export::
99 $(RM) -r $(DIST)/sdk
100 $(MAKE) -C config export
101 $(MAKE) tier_nspr
103 ifdef ENABLE_TESTS
104 # Additional makefile targets to call automated test suites
105 include $(topsrcdir)/testing/testsuite-targets.mk
106 endif
108 include $(topsrcdir)/config/rules.mk
110 distclean::
111 cat unallmakefiles | $(XARGS) rm -f
112 $(RM) unallmakefiles $(DIST_GARBAGE)
114 ifeq ($(OS_ARCH),WINNT)
115 # we want to copy PDB files on Windows
116 MAKE_SYM_STORE_ARGS := -c --vcs-info
117 ifdef PDBSTR_PATH
118 MAKE_SYM_STORE_ARGS += -i
119 endif
120 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).exe
121 # PDB files don't get moved to dist, so we need to scan the whole objdir
122 MAKE_SYM_STORE_PATH := .
123 endif
124 ifeq ($(OS_ARCH),Darwin)
125 # need to pass arch flags for universal builds
126 ifdef UNIVERSAL_BINARY
127 MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
128 MAKE_SYM_STORE_PATH := $(DIST)/universal
129 else
130 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
131 MAKE_SYM_STORE_PATH := $(DIST)/bin
132 endif
133 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
134 endif
135 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
136 MAKE_SYM_STORE_ARGS := -c --vcs-info
137 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
138 MAKE_SYM_STORE_PATH := $(DIST)/bin
139 endif
141 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
143 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
145 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
146 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
147 endif
149 SYMBOL_INDEX_NAME = \
150 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)-$(CPU_ARCH)$(EXTRA_BUILDID)-symbols.txt
152 buildsymbols:
153 ifdef MOZ_CRASHREPORTER
154 echo building symbol store
155 $(RM) -r $(DIST)/crashreporter-symbols
156 $(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
157 $(NSINSTALL) -D $(DIST)/crashreporter-symbols
158 OBJCOPY="$(OBJCOPY)" \
159 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
160 $(MAKE_SYM_STORE_ARGS) \
161 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
162 $(DUMP_SYMS_BIN) \
163 $(DIST)/crashreporter-symbols \
164 $(MAKE_SYM_STORE_PATH) | grep -iv test > \
165 $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
166 echo packing symbols
167 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
168 cd $(DIST)/crashreporter-symbols && \
169 zip -r9D "../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" . -x "*test*" -x "*Test*"
170 cd $(DIST)/crashreporter-symbols && \
171 grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
172 mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
173 cd $(DIST)/crashreporter-symbols && \
174 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt" -x "*test*" -x "*Test*"
175 endif # MOZ_CRASHREPORTER
177 uploadsymbols:
178 ifdef MOZ_CRASHREPORTER
179 $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
180 endif
182 codesighs:
183 $(MAKE) -C $(MOZ_BUILD_APP)/installer codesighs
185 # defined in package-name.mk
186 export MOZ_SOURCE_STAMP
188 #XXX: this is a hack, since we don't want to clobber for MSVC
189 # PGO support, but we can't do this test in client.mk
190 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
191 # No point in clobbering if PGO has been explicitly disabled.
192 ifndef NO_PROFILE_GUIDED_OPTIMIZE
193 maybe_clobber_profiledbuild: clean
194 else
195 maybe_clobber_profiledbuild:
196 endif
197 else
198 maybe_clobber_profiledbuild:
199 $(RM) $(DIST)/bin/*.pgc
200 find $(DIST)/$(MOZ_APP_NAME) -name "*.pgc" -exec mv {} $(DIST)/bin \;
201 endif
203 .PHONY: maybe_clobber_profiledbuild
205 # Look for R_386_PC32 relocations in shared libs, these
206 # break x86_64 builds and SELinux users.
207 ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3)
208 scheck::
209 @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
210 endif
212 js/src/Makefile: subsrcdir := js/src