1 | # |
---|
2 | # The contents of this file are subject to the Netscape Public |
---|
3 | # License Version 1.1 (the "License"); you may not use this file |
---|
4 | # except in compliance with the License. You may obtain a copy of |
---|
5 | # the License at http://www.mozilla.org/NPL/ |
---|
6 | # |
---|
7 | # Software distributed under the License is distributed on an "AS |
---|
8 | # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
---|
9 | # implied. See the License for the specific language governing |
---|
10 | # rights and limitations under the License. |
---|
11 | # |
---|
12 | # The Original Code is mozilla.org code. |
---|
13 | # |
---|
14 | # The Initial Developer of the Original Code is Netscape |
---|
15 | # Communications Corporation. Portions created by Netscape are |
---|
16 | # Copyright (C) 1998 Netscape Communications Corporation. All |
---|
17 | # Rights Reserved. |
---|
18 | # |
---|
19 | # Contributor(s): |
---|
20 | # |
---|
21 | |
---|
22 | DEPTH = . |
---|
23 | topsrcdir = @top_srcdir@ |
---|
24 | srcdir = @srcdir@ |
---|
25 | VPATH = @srcdir@ |
---|
26 | |
---|
27 | include $(DEPTH)/config/autoconf.mk |
---|
28 | |
---|
29 | include $(topsrcdir)/build/unix/modules.mk |
---|
30 | |
---|
31 | ifeq ($(BUILD_MODULES),all) |
---|
32 | # |
---|
33 | # And now for something completely different... |
---|
34 | # Divide the default build into tiers. |
---|
35 | # Tiers must be defined on module boundaries |
---|
36 | # |
---|
37 | default: $(SUBMAKEFILES) |
---|
38 | $(MAKE) -C config export |
---|
39 | $(MAKE) nspr |
---|
40 | $(MAKE) ldap |
---|
41 | $(MAKE) tier_0 |
---|
42 | $(MAKE) tier_1 |
---|
43 | $(MAKE) tier_2 |
---|
44 | $(MAKE) tier_9 |
---|
45 | ifdef MOZ_EXTENSIONS |
---|
46 | $(MAKE) tier_94 |
---|
47 | endif |
---|
48 | ifdef MOZ_PSM |
---|
49 | $(MAKE) tier_95 |
---|
50 | endif |
---|
51 | ifdef MOZ_MAIL_NEWS |
---|
52 | $(MAKE) tier_97 |
---|
53 | endif |
---|
54 | ifdef MOZ_CALENDAR |
---|
55 | $(MAKE) tier_98 |
---|
56 | endif |
---|
57 | $(MAKE) tier_99 |
---|
58 | |
---|
59 | # Make sure that the existing rulesets work |
---|
60 | DIRS = \ |
---|
61 | $(tier_0_dirs) \ |
---|
62 | $(tier_1_dirs) \ |
---|
63 | $(tier_2_dirs) \ |
---|
64 | $(tier_9_dirs) \ |
---|
65 | $(NULL) |
---|
66 | |
---|
67 | ifdef GC_LEAK_DETECTOR |
---|
68 | DIRS += gc/boehm |
---|
69 | endif |
---|
70 | |
---|
71 | ifdef MOZ_EXTENSIONS |
---|
72 | DIRS += $(tier_94_dirs) |
---|
73 | endif |
---|
74 | ifdef MOZ_PSM |
---|
75 | DIRS += $(tier_95_dirs) |
---|
76 | endif |
---|
77 | ifdef MOZ_MAIL_NEWS |
---|
78 | DIRS += $(tier_97_dirs) |
---|
79 | endif |
---|
80 | ifdef MOZ_CALENDAR |
---|
81 | DIRS += $(tier_98_dirs) |
---|
82 | endif |
---|
83 | |
---|
84 | DIRS += $(tier_99_dirs) |
---|
85 | |
---|
86 | # |
---|
87 | # tier 0 - base build config dirs |
---|
88 | # |
---|
89 | tier_0_dirs = \ |
---|
90 | config \ |
---|
91 | build \ |
---|
92 | include \ |
---|
93 | $(NULL) |
---|
94 | |
---|
95 | # |
---|
96 | # tier 1 - 3rd party individual libraries |
---|
97 | # |
---|
98 | tier_1_dirs += dbm |
---|
99 | |
---|
100 | ifndef MOZ_NATIVE_JPEG |
---|
101 | tier_1_dirs += jpeg |
---|
102 | endif |
---|
103 | |
---|
104 | ifndef MOZ_NATIVE_ZLIB |
---|
105 | tier_1_dirs += modules/zlib |
---|
106 | endif |
---|
107 | |
---|
108 | # Installer needs standalone libjar, hence standalone zlib |
---|
109 | ifdef MOZ_INSTALLER |
---|
110 | tier_1_dirs += modules/zlib/standalone |
---|
111 | endif |
---|
112 | |
---|
113 | ifdef MOZ_INTERNAL_LIBART_LGPL |
---|
114 | tier_1_dirs += other-licenses/libart_lgpl |
---|
115 | endif |
---|
116 | |
---|
117 | # |
---|
118 | # tier 2 - base libraries |
---|
119 | # |
---|
120 | tier_2_dirs = js |
---|
121 | |
---|
122 | # MacOSX needs to build lib for MoreFiles before xpcom |
---|
123 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
124 | tier_2_dirs += lib/mac/MoreFiles |
---|
125 | endif |
---|
126 | |
---|
127 | tier_2_dirs += \ |
---|
128 | modules/libreg \ |
---|
129 | string \ |
---|
130 | xpcom \ |
---|
131 | $(NULL) |
---|
132 | |
---|
133 | # |
---|
134 | # tier 9 - core components (necko,gecko) |
---|
135 | # |
---|
136 | |
---|
137 | tier_9_dirs += \ |
---|
138 | js/src/xpconnect \ |
---|
139 | intl \ |
---|
140 | modules/libjar \ |
---|
141 | $(NULL) |
---|
142 | |
---|
143 | ifdef MOZ_OJI |
---|
144 | tier_9_dirs += js/src/liveconnect |
---|
145 | endif |
---|
146 | |
---|
147 | ifdef MOZ_JSDEBUGGER |
---|
148 | tier_9_dirs += js/jsd |
---|
149 | endif |
---|
150 | |
---|
151 | ifdef MOZ_ENABLE_XLIB |
---|
152 | tier_9_dirs += gfx/src/xlibrgb widget/src/xlibxtbin |
---|
153 | endif |
---|
154 | |
---|
155 | ifdef MOZ_ENABLE_GTK |
---|
156 | tier_9_dirs += widget/src/gtksuperwin widget/src/gtkxtbin |
---|
157 | endif |
---|
158 | |
---|
159 | ifdef MOZ_ENABLE_GTK2 |
---|
160 | tier_9_dirs += widget/src/gtkxtbin |
---|
161 | endif |
---|
162 | |
---|
163 | tier_9_dirs += \ |
---|
164 | modules/libutil \ |
---|
165 | netwerk \ |
---|
166 | modules/mpfilelocprovider \ |
---|
167 | uriloader \ |
---|
168 | modules/libpref \ |
---|
169 | modules/libimg \ |
---|
170 | modules/oji \ |
---|
171 | caps \ |
---|
172 | rdf \ |
---|
173 | expat \ |
---|
174 | htmlparser \ |
---|
175 | gfx \ |
---|
176 | modules/libpr0n \ |
---|
177 | modules/plugin \ |
---|
178 | dom \ |
---|
179 | view \ |
---|
180 | widget \ |
---|
181 | content \ |
---|
182 | layout \ |
---|
183 | db \ |
---|
184 | docshell \ |
---|
185 | webshell \ |
---|
186 | embedding \ |
---|
187 | editor \ |
---|
188 | sun-java \ |
---|
189 | profile \ |
---|
190 | themes \ |
---|
191 | $(NULL) |
---|
192 | |
---|
193 | ifdef ACCESSIBILITY |
---|
194 | tier_9_dirs += accessible |
---|
195 | endif |
---|
196 | |
---|
197 | ifdef MOZ_LDAP_XPCOM |
---|
198 | tier_9_dirs += directory/xpcom |
---|
199 | endif |
---|
200 | |
---|
201 | # This must preceed xpfe |
---|
202 | ifdef MOZ_JPROF |
---|
203 | tier_9_dirs += tools/jprof |
---|
204 | endif |
---|
205 | |
---|
206 | tier_9_dirs += xpfe xpinstall |
---|
207 | |
---|
208 | ifdef MOZ_LEAKY |
---|
209 | tier_9_dirs += tools/leaky |
---|
210 | endif |
---|
211 | |
---|
212 | ifdef NS_TRACE_MALLOC |
---|
213 | tier_9_dirs += tools/trace-malloc |
---|
214 | endif |
---|
215 | |
---|
216 | ifdef MOZ_MAPINFO |
---|
217 | tier_9_dirs += tools/codesighs |
---|
218 | endif |
---|
219 | |
---|
220 | tier_9_dirs += l10n |
---|
221 | |
---|
222 | ifdef MOZ_PHOENIX |
---|
223 | tier_9_dirs += toolkit |
---|
224 | endif |
---|
225 | |
---|
226 | # |
---|
227 | # tier 9x - application features |
---|
228 | # |
---|
229 | |
---|
230 | ifdef MOZ_EXTENSIONS |
---|
231 | tier_94_dirs += extensions |
---|
232 | endif |
---|
233 | |
---|
234 | ifdef MOZ_PSM |
---|
235 | tier_95_dirs += security/manager |
---|
236 | endif |
---|
237 | |
---|
238 | ifdef MOZ_MAIL_NEWS |
---|
239 | tier_97_dirs += mailnews |
---|
240 | endif |
---|
241 | |
---|
242 | ifdef MOZ_CALENDAR |
---|
243 | tier_98_dirs += calendar |
---|
244 | endif |
---|
245 | |
---|
246 | # |
---|
247 | # tier 99 - application binaries |
---|
248 | # |
---|
249 | |
---|
250 | ifneq (,$(MOZ_STATIC_COMPONENTS)$(MOZ_META_COMPONENTS)) |
---|
251 | tier_99_dirs += modules/staticmod |
---|
252 | endif |
---|
253 | |
---|
254 | ifdef MOZ_PHOENIX |
---|
255 | tier_99_dirs += browser |
---|
256 | else |
---|
257 | tier_99_dirs += xpfe/bootstrap |
---|
258 | endif |
---|
259 | |
---|
260 | ifdef MOZ_ENABLE_GTK |
---|
261 | tier_99_dirs += embedding/browser/gtk/tests |
---|
262 | endif |
---|
263 | |
---|
264 | else |
---|
265 | |
---|
266 | # Standalone build |
---|
267 | |
---|
268 | DIRS = $(BUILD_MODULE_DIRS) |
---|
269 | |
---|
270 | # Hack to generate xpidl Makefile |
---|
271 | ifneq ($(BUILD_MODULES),all) |
---|
272 | ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS))) |
---|
273 | DIRS := xpcom/typelib $(DIRS) |
---|
274 | SUBMAKEFILES := xpcom/typelib/Makefile |
---|
275 | endif |
---|
276 | endif |
---|
277 | |
---|
278 | default: $(SUBMAKEFILES) |
---|
279 | $(MAKE) export |
---|
280 | $(MAKE) libs |
---|
281 | |
---|
282 | endif # BUILD_MODULES == all |
---|
283 | |
---|
284 | STATIC_MAKEFILES := nsprpub directory/c-sdk security/nss |
---|
285 | |
---|
286 | GARBAGE_DIRS += dist |
---|
287 | DIST_GARBAGE = config.cache config.log config.status config-defs.h \ |
---|
288 | dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \ |
---|
289 | unallmakefiles mozilla-config.h \ |
---|
290 | $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out |
---|
291 | |
---|
292 | # Build pseudo-external modules first when export is explicitly called |
---|
293 | export:: |
---|
294 | $(MAKE) -C config export |
---|
295 | $(MAKE) nspr |
---|
296 | $(MAKE) ldap |
---|
297 | ifneq ($(BUILD_MODULES),all) |
---|
298 | ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS))) |
---|
299 | $(MAKE) -C xpcom/typelib |
---|
300 | $(MAKE) export-idl |
---|
301 | endif |
---|
302 | endif |
---|
303 | |
---|
304 | install:: |
---|
305 | ifndef MOZ_NATIVE_NSPR |
---|
306 | $(MAKE) -C nsprpub real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr |
---|
307 | $(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4)) |
---|
308 | $(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties) |
---|
309 | endif |
---|
310 | ifdef MOZ_LDAP_XPCOM |
---|
311 | $(MAKE) -C directory/c-sdk real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/ldap |
---|
312 | endif |
---|
313 | |
---|
314 | include $(topsrcdir)/config/rules.mk |
---|
315 | |
---|
316 | # Clean up after pseudo-external modules |
---|
317 | clean clobber realclean clobber_all distclean:: |
---|
318 | ifndef MOZ_NATIVE_NSPR |
---|
319 | $(MAKE) -C nsprpub $@ |
---|
320 | endif |
---|
321 | ifdef MOZ_LDAP_XPCOM |
---|
322 | $(MAKE) -C directory/c-sdk $@ |
---|
323 | endif |
---|
324 | |
---|
325 | tier_%: |
---|
326 | @echo "$@: $($@_dirs)" |
---|
327 | @$(EXIT_ON_ERROR) \ |
---|
328 | for d in $($@_dirs); do $(UPDATE_TITLE) \ |
---|
329 | $(MAKE) -C $$d export; \ |
---|
330 | done ; \ |
---|
331 | $(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include ;\ |
---|
332 | for d in $($@_dirs); do $(UPDATE_TITLE) \ |
---|
333 | $(MAKE) -C $$d libs; \ |
---|
334 | done |
---|
335 | # |
---|
336 | # Individual modules |
---|
337 | # |
---|
338 | boehm: |
---|
339 | ifdef GC_LEAK_DETECTOR |
---|
340 | $(MAKE) -C gc/boehm |
---|
341 | endif |
---|
342 | |
---|
343 | nspr: boehm |
---|
344 | ifndef MOZ_NATIVE_NSPR |
---|
345 | $(MAKE) -C nsprpub |
---|
346 | endif |
---|
347 | |
---|
348 | ldap: |
---|
349 | ifdef MOZ_LDAP_XPCOM |
---|
350 | $(MAKE) -C directory/c-sdk |
---|
351 | endif |
---|
352 | |
---|
353 | export:: |
---|
354 | @$(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include |
---|
355 | |
---|
356 | distclean:: |
---|
357 | cat unallmakefiles | $(XARGS) rm -f |
---|
358 | rm -f unallmakefiles $(DIST_GARBAGE) |
---|
359 | |
---|
360 | ifeq ($(OS_ARCH),WINNT) |
---|
361 | rebase: |
---|
362 | ifdef MOZILLA_OFFICIAL |
---|
363 | echo rebasing $(DIST) |
---|
364 | /bin/find $(DIST) -name "*.dll" > rebase.lst |
---|
365 | rebase -b 60000000 -R . -G rebase.lst |
---|
366 | rm rebase.lst |
---|
367 | endif |
---|
368 | |
---|
369 | splitsymbols: |
---|
370 | ifdef MOZILLA_OFFICIAL |
---|
371 | echo splitting symbols out of binaries |
---|
372 | /bin/find $(DIST) -name "*.dll" -exec splitsym {} \; |
---|
373 | /bin/find $(DIST) -name "*.exe" -exec splitsym {} \; |
---|
374 | /bin/find $(DIST) -name "*.EXE" -exec splitsym {} \; |
---|
375 | endif # MOZILLA_OFFICIAL |
---|
376 | |
---|
377 | deliver: splitsymbols rebase |
---|
378 | |
---|
379 | endif # WINNT |
---|
380 | |
---|