Bug 915213 - Support chrome hit testing in the metrofx front end. r=bbondy
[gecko.git] / Makefile.in
blob465bba049a435866b9aacf8fb9bceccaa4170b3e
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 ifndef .PYMAKE
7 ifeq (,$(MAKE_VERSION))
8 $(error GNU Make is required)
9 endif
10 ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION)))
11 $(error GNU Make 3.80 or higher is required)
12 endif
13 endif
15 export TOPLEVEL_BUILD := 1
17 default::
19 ifdef COMPILE_ENVIRONMENT
20 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
21 endif
24 include $(topsrcdir)/config/config.mk
26 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
27 DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
28 config/autoconf.mk \
29 mozilla-config.h \
30 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
31 .mozconfig.mk
33 ifndef MOZ_PROFILE_USE
34 # We need to explicitly put backend.RecursiveMakeBackend.built here
35 # otherwise the rule in rules.mk doesn't run early enough.
36 libs export tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built js-config-status
37 endif
39 CLOBBER: $(topsrcdir)/CLOBBER
40 @echo "STOP! The CLOBBER file has changed."
41 @echo "Please run the build through a sanctioned build wrapper, such as"
42 @echo "'mach build' or client.mk."
43 @exit 1
45 $(topsrcdir)/configure: $(topsrcdir)/configure.in
46 @echo "STOP! configure.in has changed, and your configure is out of date."
47 @echo "Please rerun autoconf and re-configure your build directory."
48 @echo "To ignore this message, touch 'configure' in the source directory,"
49 @echo "but your build might not succeed."
50 @exit 1
52 config.status: $(topsrcdir)/configure
53 @echo "STOP! configure has changed and needs to be run in this build directory."
54 @echo "Please rerun configure."
55 @echo "To ignore this message, touch 'config.status' in the build directory,"
56 @echo "but your build might not succeed."
57 @exit 1
59 .PHONY: js-config-status
60 js-config-status:
61 $(call SUBMAKE,backend.RecursiveMakeBackend.built,js/src,1)
63 install_manifests := bin idl include public private sdk
64 install_manifest_depends = \
65 CLOBBER \
66 $(topsrcdir)/configure \
67 config.status \
68 backend.RecursiveMakeBackend.built \
69 js-config-status \
70 $(NULL)
72 .PHONY: install-manifests
73 install-manifests: $(addprefix install-dist-,$(install_manifests))
75 .PHONY: $(addprefix install-dist-,$(install_manifests))
76 $(addprefix install-dist-,$(install_manifests)): install-dist-%: $(install_manifest_depends)
77 $(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$(DIST)/$* _build_manifests/install/dist_$* js/src/_build_manifests/install/dist_$*)
79 .PHONY: install-tests
80 install-manifests: install-tests
81 install-tests: $(install_manifest_depends)
82 $(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests js/src/_build_manifests/install/tests)
84 # Windows PGO builds don't perform a clean before the 2nd pass. So, we want
85 # to preserve content for the 2nd pass on Windows. Everywhere else, we always
86 # process the install manifests as part of export.
87 ifdef MOZ_PROFILE_USE
88 ifndef NO_PROFILE_GUIDED_OPTIMIZE
89 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
90 export:: install-manifests
91 endif
92 endif
93 else # !MOZ_PROFILE_USE (normal build)
94 export:: install-manifests
95 endif
97 # For historical reasons that are unknown, $(DIST)/sdk is always blown away
98 # with no regard for PGO passes. This decision could probably be revisited.
99 export:: install-dist-sdk
101 ifdef ENABLE_TESTS
102 # Additional makefile targets to call automated test suites
103 include $(topsrcdir)/testing/testsuite-targets.mk
104 endif
106 default all::
107 $(call BUILDSTATUS,TIERS export $(if $(MOZ_PSEUDO_DERECURSE),compile )libs tools)
109 include $(topsrcdir)/config/rules.mk
111 distclean::
112 $(RM) $(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 # MOZ_SOURCE_STAMP is defined in package-name.mk with a deferred assignment.
183 # exporting it makes make run its $(shell) command for each invoked submake,
184 # so transform it to an immediate assignment.
185 MOZ_SOURCE_STAMP := $(MOZ_SOURCE_STAMP)
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
214 ifdef ENABLE_TESTS
215 # Incorporate static tier directories into tests. This should be incorporated
216 # into moz.build files someday.
217 check::
218 $(call SUBMAKE,$@,js/src)
219 endif
221 ifdef MOZ_PSEUDO_DERECURSE
222 # Interdependencies for parallel export.
223 js/xpconnect/src/export: config/makefiles/precompile/export
224 accessible/src/xpcom/export: config/makefiles/precompile/export
225 js/src/export: mfbt/export
226 endif