Bug 550643 - Minor improvements to parsemark.py. r=jorendorff.
[mozilla-central.git] / Makefile.in
blob9016fd0ff55afc33bb2fde30b34fed907c3511cb
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 \
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:: $(topsrcdir)/configure config.status
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 $(topsrcdir)/configure: $(topsrcdir)/configure.in
100 @echo "STOP! configure.in has changed, and your configure is out of date."
101 @echo "Please rerun autoconf and re-configure your build directory."
102 @echo "To ignore this message, touch 'configure' in the source directory,"
103 @echo "but your build might not succeed."
104 @exit 1
106 config.status: $(topsrcdir)/configure
107 @echo "STOP! configure has changed and needs to be run in this build directory."
108 @echo "Please rerun configure."
109 @echo "To ignore this message, touch 'config.status' in the build directory,"
110 @echo "but your build might not succeed."
111 @exit 1
113 # Build pseudo-external modules first when export is explicitly called
114 export::
115 $(RM) -rf $(DIST)/sdk
116 $(MAKE) -C config export
117 $(MAKE) tier_nspr
119 ifdef ENABLE_TESTS
120 # Additional makefile targets to call automated test suites
121 include $(topsrcdir)/testing/testsuite-targets.mk
122 else
123 # OS X Universal builds will want to call this, so stub it out
124 package-tests:
125 endif
127 include $(topsrcdir)/config/rules.mk
129 # After we build tier toolkit, go back and build the tools from previous dirs
130 tier_toolkit::
131 $(MAKE) tools_tier_js
132 $(MAKE) tools_tier_xpcom
133 $(MAKE) tools_tier_necko
134 $(MAKE) tools_tier_gecko
135 $(MAKE) tools_tier_toolkit
137 ifeq (netwerk,$(MOZ_BUILD_APP))
138 tier_necko::
139 $(EXIT_ON_ERROR) \
140 $(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
141 endif
143 distclean::
144 cat unallmakefiles | $(XARGS) rm -f
145 rm -f unallmakefiles $(DIST_GARBAGE)
147 ifeq ($(OS_ARCH),WINNT)
148 rebase:
149 ifdef MOZILLA_OFFICIAL
150 echo rebasing $(DIST)
151 /bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
152 rebase -b 60000000 -R . -G rebase.lst
153 rm rebase.lst
154 endif
155 endif # WINNT
157 ifeq ($(OS_ARCH),WINNT)
158 # we want to copy PDB files on Windows
159 MAKE_SYM_STORE_ARGS := -c
160 ifdef PDBSTR_PATH
161 MAKE_SYM_STORE_ARGS += -i
162 endif
163 ifeq (,$(CYGWIN_WRAPPER))
164 # this doesn't work with Cygwin Python
165 MAKE_SYM_STORE_ARGS += --vcs-info
166 endif
167 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
168 # PDB files don't get moved to dist, so we need to scan the whole objdir
169 MAKE_SYM_STORE_PATH := .
170 endif
171 ifeq ($(OS_ARCH),Darwin)
172 # need to pass arch flags for universal builds
173 ifdef UNIVERSAL_BINARY
174 MAKE_SYM_STORE_ARGS := -c -a "ppc i386" --vcs-info
175 MAKE_SYM_STORE_PATH := $(DIST)/universal
176 else
177 MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
178 MAKE_SYM_STORE_PATH := $(DIST)/bin
179 endif
180 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
181 endif
182 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
183 MAKE_SYM_STORE_ARGS := -c --vcs-info
184 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
185 MAKE_SYM_STORE_PATH := $(DIST)/bin
186 endif
188 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
190 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
192 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
193 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
194 endif
196 SYMBOL_INDEX_NAME = \
197 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
199 buildsymbols:
200 ifdef MOZ_CRASHREPORTER
201 echo building symbol store
202 $(RM) -rf $(DIST)/crashreporter-symbols
203 $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
204 $(NSINSTALL) -D $(DIST)/crashreporter-symbols
205 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
206 $(MAKE_SYM_STORE_ARGS) \
207 $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
208 $(DUMP_SYMS_BIN) \
209 $(DIST)/crashreporter-symbols \
210 $(MAKE_SYM_STORE_PATH) > \
211 $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
212 echo packing symbols
213 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
214 cd $(DIST)/crashreporter-symbols && \
215 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
216 else
217 ifdef WINCE
218 ifdef SYMBOLSTORE_PATH
219 echo building symbol store with symstore.exe
220 $(RM) -rf $(DIST)/symbols
221 $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
222 $(NSINSTALL) -D $(DIST)/symbols
223 $(SYMBOLSTORE_PATH) add -r -f "$(subst /,\,$(shell pwd -W))\*.PDB" \
224 -s $(DIST)/symbols/ -t "$(MOZ_PKG_APPNAME)" -v "$(MOZ_PKG_VERSION)"
225 echo packing symbols
226 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
227 cd $(DIST)/symbols && \
228 zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" .
229 endif # SYMBOLSTORE_PATH
230 endif # WINCE
231 endif # MOZ_CRASHREPORTER
233 uploadsymbols:
234 ifdef MOZ_CRASHREPORTER
235 $(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip"
236 endif
238 ifeq ($(OS_ARCH),WINNT)
239 signnss:
240 ifdef MOZILLA_OFFICIAL
241 echo signing NSS libs
242 cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
243 cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
244 cd $(DIST)/bin; ./shlibsign.exe -v -i nssdbm3.dll
245 endif # MOZILLA_OFFICIAL
247 deliver: rebase signnss
249 endif # WINNT
251 ifneq (,$(wildcard $(DIST)/bin/application.ini))
252 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
253 else
254 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
255 endif
257 MOZ_SOURCE_STAMP = $(shell hg -R $(srcdir) parent --template="{node|short}\n" 2>/dev/null)
258 export MOZ_SOURCE_STAMP
260 #XXX: this is a hack, since we don't want to clobber for MSVC
261 # PGO support, but we can't do this test in client.mk
262 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
263 # No point in clobbering if PGO has been explicitly disabled.
264 ifndef NO_PROFILE_GUIDED_OPTIMIZE
265 maybe_clobber_profiledbuild: clean
266 else
267 maybe_clobber_profiledbuild:
268 endif
269 else
270 maybe_clobber_profiledbuild:
271 endif
273 .PHONY: maybe_clobber_profiledbuild