bug 715586: checksums.py should generate sha1 and md5 checksums. r=catlee,ted
[gecko.git] / Makefile.in
blobbc9007e2840d0a0376ccb92047704cb0904acec4
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 mfbt \
66 $(NULL)
68 ifndef LIBXUL_SDK
69 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
70 tier_base_dirs += \
71 other-licenses/android \
72 other-licenses/skia-npapi \
73 $(NULL)
74 endif
76 ifdef MOZ_MEMORY
77 tier_base_dirs += memory/jemalloc
78 endif
79 tier_base_dirs += \
80 mozglue \
81 memory/mozalloc \
82 $(NULL)
83 endif
85 ifdef COMPILE_ENVIRONMENT
86 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
87 endif
90 include $(topsrcdir)/config/config.mk
92 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
93 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
94 config/autoconf.mk \
95 unallmakefiles mozilla-config.h \
96 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
97 $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
99 default alldep all:: $(topsrcdir)/configure config.status
100 $(RM) -r $(DIST)/sdk
101 $(RM) -r $(DIST)/include
102 $(RM) -r $(DIST)/private
103 $(RM) -r $(DIST)/public
104 $(RM) -r $(DIST)/bin/components
105 $(RM) -r _tests
107 $(topsrcdir)/configure: $(topsrcdir)/configure.in
108 @echo "STOP! configure.in has changed, and your configure is out of date."
109 @echo "Please rerun autoconf and re-configure your build directory."
110 @echo "To ignore this message, touch 'configure' in the source directory,"
111 @echo "but your build might not succeed."
112 @exit 1
114 config.status: $(topsrcdir)/configure
115 @echo "STOP! configure has changed and needs to be run in this build directory."
116 @echo "Please rerun configure."
117 @echo "To ignore this message, touch 'config.status' in the build directory,"
118 @echo "but your build might not succeed."
119 @exit 1
121 # Build pseudo-external modules first when export is explicitly called
122 export::
123 $(RM) -r $(DIST)/sdk
124 $(MAKE) -C config export
125 $(MAKE) tier_nspr
127 ifdef ENABLE_TESTS
128 # Additional makefile targets to call automated test suites
129 include $(topsrcdir)/testing/testsuite-targets.mk
130 endif
132 include $(topsrcdir)/config/rules.mk
134 distclean::
135 cat unallmakefiles | $(XARGS) rm -f
136 $(RM) unallmakefiles $(DIST_GARBAGE)
138 ifeq ($(OS_ARCH),WINNT)
139 # we want to copy PDB files on Windows
140 MAKE_SYM_STORE_ARGS := -c --vcs-info
141 ifdef PDBSTR_PATH
142 MAKE_SYM_STORE_ARGS += -i
143 endif
144 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).exe
145 # PDB files don't get moved to dist, so we need to scan the whole objdir
146 MAKE_SYM_STORE_PATH := .
147 endif
148 ifeq ($(OS_ARCH),Darwin)
149 # need to pass arch flags for universal builds
150 ifdef UNIVERSAL_BINARY
151 MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
152 MAKE_SYM_STORE_PATH := $(DIST)/universal
153 else
154 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
155 MAKE_SYM_STORE_PATH := $(DIST)/bin
156 endif
157 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
158 endif
159 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
160 MAKE_SYM_STORE_ARGS := -c --vcs-info
161 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
162 MAKE_SYM_STORE_PATH := $(DIST)/bin
163 endif
165 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
167 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
169 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
170 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
171 endif
173 SYMBOL_INDEX_NAME = \
174 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
176 buildsymbols:
177 ifdef MOZ_CRASHREPORTER
178 ifdef USE_ELF_HACK
179 ifeq (mobile,$(MOZ_BUILD_APP))
180 $(MAKE) -C mobile/xul/installer elfhack
181 else
182 $(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
183 endif
184 endif
185 echo building symbol store
186 $(RM) -r $(DIST)/crashreporter-symbols
187 $(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
188 $(NSINSTALL) -D $(DIST)/crashreporter-symbols
189 OBJCOPY="$(OBJCOPY)" \
190 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
191 $(MAKE_SYM_STORE_ARGS) \
192 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
193 $(DUMP_SYMS_BIN) \
194 $(DIST)/crashreporter-symbols \
195 $(MAKE_SYM_STORE_PATH) > \
196 $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
197 echo packing symbols
198 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
199 cd $(DIST)/crashreporter-symbols && \
200 zip -r9D "../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
201 cd $(DIST)/crashreporter-symbols && \
202 grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
203 mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
204 cd $(DIST)/crashreporter-symbols && \
205 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
206 endif # MOZ_CRASHREPORTER
208 uploadsymbols:
209 ifdef MOZ_CRASHREPORTER
210 $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
211 endif
213 codesighs:
214 $(MAKE) -C $(MOZ_BUILD_APP)/installer codesighs
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
225 else
226 maybe_clobber_profiledbuild:
227 endif
228 else
229 maybe_clobber_profiledbuild:
230 $(RM) $(DIST)/bin/*.pgc
231 find $(DIST)/$(MOZ_APP_NAME) -name "*.pgc" -exec mv {} $(DIST)/bin \;
232 endif
234 .PHONY: maybe_clobber_profiledbuild
236 # Look for R_386_PC32 relocations in shared libs, these
237 # break x86_64 builds and SELinux users.
238 ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3)
239 scheck::
240 @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
241 endif