bug 313956: expand installer .exe contents to make complete mar. r=ted.
[gecko.git] / Makefile.in
blob8f5d33bdca7b82e7a05171e4e7b42c2c40644afe
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 tier_base_dirs += \
69 memory \
70 $(NULL)
71 ifeq ($(OS_TARGET),Android)
72 tier_base_dirs += other-licenses/android
73 endif
75 endif
77 ifdef COMPILE_ENVIRONMENT
78 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
79 endif
82 include $(topsrcdir)/config/config.mk
84 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
85 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
86 config/autoconf.mk \
87 unallmakefiles mozilla-config.h \
88 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
89 $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
91 ifdef WINCE
92 check::
93 $(PYTHON) $(topsrcdir)/build/mobile/devicemanager-utils.py copy $(DIST)/bin
94 endif
96 default alldep all:: $(topsrcdir)/configure config.status
97 $(RM) -rf $(DIST)/sdk
98 $(RM) -rf $(DIST)/include
99 $(RM) -rf $(DIST)/private
100 $(RM) -rf $(DIST)/public
101 $(RM) -rf $(DIST)/bin/components
102 $(RM) -rf _tests
104 $(topsrcdir)/configure: $(topsrcdir)/configure.in
105 @echo "STOP! configure.in has changed, and your configure is out of date."
106 @echo "Please rerun autoconf and re-configure your build directory."
107 @echo "To ignore this message, touch 'configure' in the source directory,"
108 @echo "but your build might not succeed."
109 @exit 1
111 config.status: $(topsrcdir)/configure
112 @echo "STOP! configure has changed and needs to be run in this build directory."
113 @echo "Please rerun configure."
114 @echo "To ignore this message, touch 'config.status' in the build directory,"
115 @echo "but your build might not succeed."
116 @exit 1
118 # Build pseudo-external modules first when export is explicitly called
119 export::
120 $(RM) -rf $(DIST)/sdk
121 $(MAKE) -C config export
122 $(MAKE) tier_nspr
124 ifdef ENABLE_TESTS
125 # Additional makefile targets to call automated test suites
126 include $(topsrcdir)/testing/testsuite-targets.mk
127 endif
129 include $(topsrcdir)/config/rules.mk
131 distclean::
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 --vcs-info
138 ifdef PDBSTR_PATH
139 MAKE_SYM_STORE_ARGS += -i
140 endif
141 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).exe
142 # PDB files don't get moved to dist, so we need to scan the whole objdir
143 MAKE_SYM_STORE_PATH := .
144 endif
145 ifeq ($(OS_ARCH),Darwin)
146 # need to pass arch flags for universal builds
147 ifdef UNIVERSAL_BINARY
148 MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
149 MAKE_SYM_STORE_PATH := $(DIST)/universal
150 else
151 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
152 MAKE_SYM_STORE_PATH := $(DIST)/bin
153 endif
154 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
155 endif
156 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
157 MAKE_SYM_STORE_ARGS := -c --vcs-info
158 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
159 MAKE_SYM_STORE_PATH := $(DIST)/bin
160 endif
162 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
164 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
166 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
167 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
168 endif
170 export SYMBOL_INDEX_NAME = \
171 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
173 buildsymbols:
174 ifdef MOZ_CRASHREPORTER
175 ifdef USE_ELF_HACK
176 $(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
177 endif
178 echo building symbol store
179 $(RM) -rf $(DIST)/crashreporter-symbols
180 $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
181 $(NSINSTALL) -D $(DIST)/crashreporter-symbols
182 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
183 $(MAKE_SYM_STORE_ARGS) \
184 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
185 $(DUMP_SYMS_BIN) \
186 $(DIST)/crashreporter-symbols \
187 $(MAKE_SYM_STORE_PATH) > \
188 $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
189 echo packing symbols
190 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
191 cd $(DIST)/crashreporter-symbols && \
192 zip -r9D "../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
193 cd $(DIST)/crashreporter-symbols && \
194 grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
195 mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
196 cd $(DIST)/crashreporter-symbols && \
197 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
198 else
199 ifdef WINCE
200 ifdef SYMBOLSTORE_PATH
201 echo building symbol store with symstore.exe
202 $(RM) -rf $(DIST)/symbols
203 $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
204 $(NSINSTALL) -D $(DIST)/symbols
205 $(SYMBOLSTORE_PATH) add -r -f "$(subst /,\,$(shell pwd -W))\*.PDB" \
206 -s $(DIST)/symbols/ -t "$(MOZ_PKG_APPNAME)" -v "$(MOZ_PKG_VERSION)"
207 echo packing symbols
208 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
209 cd $(DIST)/symbols && \
210 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
211 endif # SYMBOLSTORE_PATH
212 endif # WINCE
213 endif # MOZ_CRASHREPORTER
215 uploadsymbols:
216 ifdef MOZ_CRASHREPORTER
217 $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
218 endif
220 # defined in package-name.mk
221 export MOZ_SOURCE_STAMP
223 #XXX: this is a hack, since we don't want to clobber for MSVC
224 # PGO support, but we can't do this test in client.mk
225 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
226 # No point in clobbering if PGO has been explicitly disabled.
227 ifndef NO_PROFILE_GUIDED_OPTIMIZE
228 maybe_clobber_profiledbuild: clean
229 else
230 maybe_clobber_profiledbuild:
231 endif
232 else
233 maybe_clobber_profiledbuild:
234 endif
236 .PHONY: maybe_clobber_profiledbuild
238 # Look for R_386_PC32 relocations in shared libs, these
239 # break x86_64 builds and SELinux users.
240 ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3)
241 scheck::
242 @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
243 endif