Save all modification
[mozilla-1.9/m8.git] / Makefile.in
blob8a166b14f98e07f5f41c78d4b76461a745e43928
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 include $(topsrcdir)/config/config.mk
47 default alldep all::
48 $(RM) -rf $(DIST)/sdk
49 $(RM) -rf $(DIST)/include
50 $(RM) -rf _tests
51 $(MAKE) -C config export
53 TIERS += base
56 # tier "base" - basic setup
58 tier_base_dirs = \
59 config \
60 build \
61 $(NULL)
63 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
65 TIERS += testharness
67 # test harnesses
68 ifdef ENABLE_TESTS
69 tier_testharness_dirs += tools/test-harness
70 endif
72 GARBAGE_DIRS += dist
73 DIST_GARBAGE = config.cache config.log config.status config-defs.h \
74 dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
75 unallmakefiles mozilla-config.h \
76 gfx/gfx-config.h netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
77 $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
79 # Build pseudo-external modules first when export is explicitly called
80 export::
81 $(RM) -rf $(DIST)/sdk
82 $(MAKE) -C config export
83 $(MAKE) tier_nspr
85 include $(topsrcdir)/config/rules.mk
87 # After we build tier toolkit, go back and build the tools from previous dirs
88 tier_toolkit::
89 $(MAKE) tools_tier_js
90 $(MAKE) tools_tier_xpcom
91 $(MAKE) tools_tier_necko
92 $(MAKE) tools_tier_gecko
93 $(MAKE) tools_tier_toolkit
95 ifeq (netwerk,$(MOZ_BUILD_APP))
96 tier_necko::
97 $(EXIT_ON_ERROR) \
98 $(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
99 endif
101 distclean::
102 cat unallmakefiles | $(XARGS) rm -f
103 rm -f unallmakefiles $(DIST_GARBAGE)
105 ifeq ($(OS_ARCH),WINNT)
106 rebase:
107 ifdef MOZILLA_OFFICIAL
108 echo rebasing $(DIST)
109 /bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
110 rebase -b 60000000 -R . -G rebase.lst
111 rm rebase.lst
112 endif
114 splitsymbols:
115 ifdef MOZILLA_OFFICIAL
116 ifdef MOZ_DEBUG_SYMBOLS
117 echo finding pdb files
118 mkdir -p $(DIST)/$(BUILDID)
119 -cp `/bin/find . -path "./dist" -prune -o -name "*.dll" | sed "s/\.dll$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
120 -cp `/bin/find . -path "./dist" -prune -o -name "*.exe" | sed "s/\.exe$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
121 -cp `/bin/find . -path "./dist" -prune -o -name "*.EXE" | sed "s/\.EXE$$/\.pdb/" | xargs` $(DIST)/$(BUILDID)
122 endif # MOZ_DEBUG_SYMBOLS
123 ifdef MOZ_PROFILE
124 echo splitting symbols out of binaries
125 /bin/find $(DIST) -name "*.dll" -exec splitsym {} \;
126 /bin/find $(DIST) -name "*.exe" -exec splitsym {} \;
127 /bin/find $(DIST) -name "*.EXE" -exec splitsym {} \;
128 mkdir -p $(DIST)/$(BUILDID)
129 /bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \;
130 endif # MOZ_PROFILE
131 endif # MOZILLA_OFFICIAL
132 endif # WINNT
134 ifeq ($(OS_ARCH),WINNT)
135 # we want to copy PDB files on Windows
136 MAKE_SYM_STORE_ARGS := -c
137 ifeq (,$(CYGWIN_WRAPPER))
138 # this doesn't work with Cygwin Python
139 MAKE_SYM_STORE_ARGS += --vcs-info
140 endif
141 DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.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 := -a "ppc i386" --vcs-info
149 MAKE_SYM_STORE_PATH := $(DIST)/universal
150 else
151 MAKE_SYM_STORE_ARGS := -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 ($(OS_ARCH),Linux)
157 MAKE_SYM_STORE_ARGS := --vcs-info
158 DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
159 MAKE_SYM_STORE_PATH := $(DIST)/bin
160 endif
162 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
163 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
164 endif
166 SYMBOL_ARCHIVE_BASENAME := \
167 $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)
169 buildsymbols:
170 ifdef MOZ_CRASHREPORTER
171 echo building symbol store
172 mkdir -p $(DIST)/crashreporter-symbols/$(BUILDID)
173 $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
174 $(MAKE_SYM_STORE_ARGS) -s $(topsrcdir) $(DUMP_SYMS_BIN) \
175 $(DIST)/crashreporter-symbols/$(BUILDID) \
176 $(MAKE_SYM_STORE_PATH) > \
177 $(DIST)/crashreporter-symbols/$(BUILDID)/$(SYMBOL_ARCHIVE_BASENAME)-symbols.txt
178 echo packing symbols
179 mkdir -p $(topsrcdir)/../$(BUILDID)
180 cd $(DIST)/crashreporter-symbols/$(BUILDID) && \
181 zip -r9D ../crashreporter-symbols-$(SYMBOL_ARCHIVE_BASENAME).zip .
182 mv $(DIST)/crashreporter-symbols/crashreporter-symbols-$(SYMBOL_ARCHIVE_BASENAME).zip \
183 $(topsrcdir)/../$(BUILDID)
184 endif # MOZ_CRASHREPORTER
186 uploadsymbols:
187 ifdef MOZ_CRASHREPORTER
188 $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(topsrcdir)/../$(BUILDID)/crashreporter-symbols-$(SYMBOL_ARCHIVE_BASENAME).zip
189 endif
191 ifeq ($(OS_ARCH),WINNT)
192 signnss:
193 ifdef MOZILLA_OFFICIAL
194 echo signing NSS libs
195 cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
196 cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
197 endif # MOZILLA_OFFICIAL
199 deliver: splitsymbols rebase signnss
201 endif # WINNT
203 ifneq (,$(wildcard $(DIST)/bin/application.ini))
204 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
205 else
206 BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
207 endif