Merging backout
[mozilla-central.git] / Makefile.in
blob58ed733d7bb06ba7f59500ad8ffad88ef29ccd8b
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 include $(DEPTH)/config/autoconf.mk
45 default::
47 TIERS += base
50 # tier "base" - basic setup
52 tier_base_dirs = \
53 config \
54 build \
55 probes \
56 $(NULL)
58 ifdef MOZ_MEMORY
59 tier_base_dirs += memory/jemalloc
60 endif
62 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
64 TIERS += testharness
66 # test harnesses
67 ifdef ENABLE_TESTS
68 tier_testharness_dirs += testing/xpcshell
69 endif
71 include $(topsrcdir)/config/config.mk
73 GARBAGE_DIRS += dist _javagen _profile _tests staticlib
74 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
75 dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
76 unallmakefiles mozilla-config.h \
77 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
78 $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
80 default alldep all::
81 $(RM) -rf $(DIST)/sdk
82 $(RM) -rf $(DIST)/include
83 $(RM) -rf $(DIST)/private
84 $(RM) -rf $(DIST)/public
85 $(RM) -rf $(DIST)/bin/components
86 $(RM) -rf _tests
88 # Build pseudo-external modules first when export is explicitly called
89 export::
90 $(RM) -rf $(DIST)/sdk
91 $(MAKE) -C config export
92 $(MAKE) tier_nspr
94 ifdef ENABLE_TESTS
95 # Additional makefile targets to call automated test suites
96 include $(topsrcdir)/testing/testsuite-targets.mk
97 endif
99 include $(topsrcdir)/config/rules.mk
101 # After we build tier toolkit, go back and build the tools from previous dirs
102 tier_toolkit::
103 $(MAKE) tools_tier_js
104 $(MAKE) tools_tier_xpcom
105 $(MAKE) tools_tier_necko
106 $(MAKE) tools_tier_gecko
107 $(MAKE) tools_tier_toolkit
109 ifeq (netwerk,$(MOZ_BUILD_APP))
110 tier_necko::
111 $(EXIT_ON_ERROR) \
112 $(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
113 endif
115 distclean::
116 cat unallmakefiles | $(XARGS) rm -f
117 rm -f unallmakefiles $(DIST_GARBAGE)
119 ifeq ($(OS_ARCH),WINNT)
120 rebase:
121 ifdef MOZILLA_OFFICIAL
122 echo rebasing $(DIST)
123 /bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
124 rebase -b 60000000 -R . -G rebase.lst
125 rm rebase.lst
126 endif
128 splitsymbols:
129 ifdef MOZILLA_OFFICIAL
130 ifdef MOZ_DEBUG_SYMBOLS
131 echo finding pdb files
132 mkdir -p $(DIST)/$(BUILDID)
133 -cp `/bin/find . -path "./dist" -prune -o -name "*.dll" | sed "s/\.dll$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
134 -cp `/bin/find . -path "./dist" -prune -o -name "*.exe" | sed "s/\.exe$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
135 -cp `/bin/find . -path "./dist" -prune -o -name "*.EXE" | sed "s/\.EXE$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
136 endif # MOZ_DEBUG_SYMBOLS
137 ifdef MOZ_PROFILE
138 echo splitting symbols out of binaries
139 /bin/find $(DIST) -name "*.dll" -exec splitsym {} \;
140 /bin/find $(DIST) -name "*.exe" -exec splitsym {} \;
141 /bin/find $(DIST) -name "*.EXE" -exec splitsym {} \;
142 mkdir -p $(DIST)/$(BUILDID)
143 /bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \;
144 endif # MOZ_PROFILE
145 endif # MOZILLA_OFFICIAL
146 endif # WINNT
148 ifeq ($(OS_ARCH),WINNT)
149 # we want to copy PDB files on Windows
150 MAKE_SYM_STORE_ARGS := -c
151 ifdef PDBSTR_PATH
152 MAKE_SYM_STORE_ARGS += -i
153 endif
154 ifeq (,$(CYGWIN_WRAPPER))
155 # this doesn't work with Cygwin Python
156 MAKE_SYM_STORE_ARGS += --vcs-info
157 endif
158 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
159 # PDB files don't get moved to dist, so we need to scan the whole objdir
160 MAKE_SYM_STORE_PATH := .
161 endif
162 ifeq ($(OS_ARCH),Darwin)
163 # need to pass arch flags for universal builds
164 ifdef UNIVERSAL_BINARY
165 MAKE_SYM_STORE_ARGS := -a "ppc i386" --vcs-info
166 MAKE_SYM_STORE_PATH := $(DIST)/universal
167 else
168 MAKE_SYM_STORE_ARGS := -a $(OS_TEST) --vcs-info
169 MAKE_SYM_STORE_PATH := $(DIST)/bin
170 endif
171 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
172 endif
173 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
174 MAKE_SYM_STORE_ARGS := --vcs-info
175 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
176 MAKE_SYM_STORE_PATH := $(DIST)/bin
177 endif
179 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
181 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
183 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
184 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
185 endif
187 SYMBOL_INDEX_NAME = \
188 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
190 buildsymbols:
191 ifdef MOZ_CRASHREPORTER
192 echo building symbol store
193 mkdir -p $(DIST)/crashreporter-symbols/$(BUILDID)
194 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
195 $(MAKE_SYM_STORE_ARGS) \
196 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
197 $(DUMP_SYMS_BIN) \
198 $(DIST)/crashreporter-symbols/$(BUILDID) \
199 $(MAKE_SYM_STORE_PATH) > \
200 $(DIST)/crashreporter-symbols/$(BUILDID)/$(SYMBOL_INDEX_NAME)
201 echo packing symbols
202 mkdir -p $(topsrcdir)/../$(BUILDID)
203 cd $(DIST)/crashreporter-symbols/$(BUILDID) && \
204 zip -r9D ../../$(SYMBOL_ARCHIVE_BASENAME).zip .
205 endif # MOZ_CRASHREPORTER
207 uploadsymbols:
208 ifdef MOZ_CRASHREPORTER
209 $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip
210 endif
212 ifeq ($(OS_ARCH),WINNT)
213 signnss:
214 ifdef MOZILLA_OFFICIAL
215 echo signing NSS libs
216 cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
217 cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
218 endif # MOZILLA_OFFICIAL
220 deliver: splitsymbols rebase signnss
222 endif # WINNT
224 ifneq (,$(wildcard $(DIST)/bin/application.ini))
225 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
226 else
227 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
228 endif
230 #XXX: this is a hack, since we don't want to clobber for MSVC
231 # PGO support, but we can't do this test in client.mk
232 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
233 # No point in clobbering if PGO has been explicitly disabled.
234 ifndef NO_PROFILE_GUIDED_OPTIMIZE
235 maybe_clobber_profiledbuild: clobber_all
236 else
237 maybe_clobber_profiledbuild:
238 endif
239 else
240 maybe_clobber_profiledbuild:
241 endif
243 .PHONY: maybe_clobber_profiledbuild