merge backout of 41c421f97869
[mozilla-central.git] / Makefile.in
blob695dad6b741dab7c348c5e810f03986a46503c1c
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 ifdef MOZ_MEMORY
68 tier_base_dirs += memory/jemalloc
69 endif
71 ifdef COMPILE_ENVIRONMENT
72 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
73 endif
75 TIERS += testharness
77 # test harnesses
78 ifdef ENABLE_TESTS
79 tier_testharness_dirs += testing/xpcshell
80 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 dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.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 default alldep all::
92 $(RM) -rf $(DIST)/sdk
93 $(RM) -rf $(DIST)/include
94 $(RM) -rf $(DIST)/private
95 $(RM) -rf $(DIST)/public
96 $(RM) -rf $(DIST)/bin/components
97 $(RM) -rf _tests
99 # Build pseudo-external modules first when export is explicitly called
100 export::
101 $(RM) -rf $(DIST)/sdk
102 $(MAKE) -C config export
103 $(MAKE) tier_nspr
105 ifdef ENABLE_TESTS
106 # Additional makefile targets to call automated test suites
107 include $(topsrcdir)/testing/testsuite-targets.mk
108 else
109 # OS X Universal builds will want to call this, so stub it out
110 package-tests:
111 endif
113 include $(topsrcdir)/config/rules.mk
115 # After we build tier toolkit, go back and build the tools from previous dirs
116 tier_toolkit::
117 $(MAKE) tools_tier_js
118 $(MAKE) tools_tier_xpcom
119 $(MAKE) tools_tier_necko
120 $(MAKE) tools_tier_gecko
121 $(MAKE) tools_tier_toolkit
123 ifeq (netwerk,$(MOZ_BUILD_APP))
124 tier_necko::
125 $(EXIT_ON_ERROR) \
126 $(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
127 endif
129 distclean::
130 cat unallmakefiles | $(XARGS) rm -f
131 rm -f unallmakefiles $(DIST_GARBAGE)
133 ifeq ($(OS_ARCH),WINNT)
134 rebase:
135 ifdef MOZILLA_OFFICIAL
136 echo rebasing $(DIST)
137 /bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
138 rebase -b 60000000 -R . -G rebase.lst
139 rm rebase.lst
140 endif
141 endif # WINNT
143 ifeq ($(OS_ARCH),WINNT)
144 # we want to copy PDB files on Windows
145 MAKE_SYM_STORE_ARGS := -c
146 ifdef PDBSTR_PATH
147 MAKE_SYM_STORE_ARGS += -i
148 endif
149 ifeq (,$(CYGWIN_WRAPPER))
150 # this doesn't work with Cygwin Python
151 MAKE_SYM_STORE_ARGS += --vcs-info
152 endif
153 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
154 # PDB files don't get moved to dist, so we need to scan the whole objdir
155 MAKE_SYM_STORE_PATH := .
156 endif
157 ifeq ($(OS_ARCH),Darwin)
158 # need to pass arch flags for universal builds
159 ifdef UNIVERSAL_BINARY
160 MAKE_SYM_STORE_ARGS := -c -a "ppc i386" --vcs-info
161 MAKE_SYM_STORE_PATH := $(DIST)/universal
162 else
163 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
164 MAKE_SYM_STORE_PATH := $(DIST)/bin
165 endif
166 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
167 endif
168 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
169 MAKE_SYM_STORE_ARGS := -c --vcs-info
170 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
171 MAKE_SYM_STORE_PATH := $(DIST)/bin
172 endif
174 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
176 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
178 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
179 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
180 endif
182 SYMBOL_INDEX_NAME = \
183 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
185 buildsymbols:
186 ifdef MOZ_CRASHREPORTER
187 echo building symbol store
188 $(RM) -rf $(DIST)/crashreporter-symbols
189 $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
190 $(NSINSTALL) -D $(DIST)/crashreporter-symbols
191 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
192 $(MAKE_SYM_STORE_ARGS) \
193 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
194 $(DUMP_SYMS_BIN) \
195 $(DIST)/crashreporter-symbols \
196 $(MAKE_SYM_STORE_PATH) > \
197 $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
198 echo packing symbols
199 cd $(DIST)/crashreporter-symbols && \
200 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
201 endif # MOZ_CRASHREPORTER
203 uploadsymbols:
204 ifdef MOZ_CRASHREPORTER
205 $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
206 endif
208 ifeq ($(OS_ARCH),WINNT)
209 signnss:
210 ifdef MOZILLA_OFFICIAL
211 echo signing NSS libs
212 cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
213 cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
214 cd $(DIST)/bin; ./shlibsign.exe -v -i nssdbm3.dll
215 endif # MOZILLA_OFFICIAL
217 deliver: rebase signnss
219 endif # WINNT
221 ifneq (,$(wildcard $(DIST)/bin/application.ini))
222 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
223 else
224 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
225 endif
227 #XXX: this is a hack, since we don't want to clobber for MSVC
228 # PGO support, but we can't do this test in client.mk
229 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
230 # No point in clobbering if PGO has been explicitly disabled.
231 ifndef NO_PROFILE_GUIDED_OPTIMIZE
232 maybe_clobber_profiledbuild: clobber_all
233 else
234 maybe_clobber_profiledbuild:
235 endif
236 else
237 maybe_clobber_profiledbuild:
238 endif
240 .PHONY: maybe_clobber_profiledbuild