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 | $(RM) -rf $(DIST)/sdk |
---|
39 | $(MAKE) -C config export |
---|
40 | $(MAKE) nspr |
---|
41 | $(MAKE) ldap |
---|
42 | $(MAKE) tier_0 |
---|
43 | $(MAKE) tier_1 |
---|
44 | $(MAKE) tier_2 |
---|
45 | $(MAKE) tier_9 |
---|
46 | ifdef MOZ_PSM |
---|
47 | $(MAKE) tier_40 |
---|
48 | endif |
---|
49 | $(MAKE) tier_50 |
---|
50 | ifdef MOZ_JSDEBUGGER |
---|
51 | $(MAKE) tier_93 |
---|
52 | endif |
---|
53 | ifdef MOZ_EXTENSIONS |
---|
54 | $(MAKE) tier_94 |
---|
55 | endif |
---|
56 | ifdef MOZ_MAIL_NEWS |
---|
57 | $(MAKE) tier_97 |
---|
58 | endif |
---|
59 | ifdef MOZ_CALENDAR |
---|
60 | $(MAKE) tier_98 |
---|
61 | endif |
---|
62 | $(MAKE) tier_99 |
---|
63 | |
---|
64 | # Make sure that the existing rulesets work |
---|
65 | DIRS = \ |
---|
66 | $(tier_0_dirs) \ |
---|
67 | $(tier_1_dirs) \ |
---|
68 | $(tier_2_dirs) \ |
---|
69 | $(tier_9_dirs) \ |
---|
70 | $(tier_40_dirs) \ |
---|
71 | $(tier_50_dirs) \ |
---|
72 | $(NULL) |
---|
73 | |
---|
74 | ifdef GC_LEAK_DETECTOR |
---|
75 | DIRS += gc/boehm |
---|
76 | endif |
---|
77 | |
---|
78 | ifdef MOZ_JSDEBUGGER |
---|
79 | DIRS += $(tier_93_dirs) |
---|
80 | endif |
---|
81 | ifdef MOZ_EXTENSIONS |
---|
82 | DIRS += $(tier_94_dirs) |
---|
83 | endif |
---|
84 | ifdef MOZ_MAIL_NEWS |
---|
85 | DIRS += $(tier_97_dirs) |
---|
86 | endif |
---|
87 | ifdef MOZ_CALENDAR |
---|
88 | DIRS += $(tier_98_dirs) |
---|
89 | endif |
---|
90 | |
---|
91 | DIRS += $(tier_99_dirs) |
---|
92 | |
---|
93 | # |
---|
94 | # tier 0 - base build config dirs |
---|
95 | # |
---|
96 | tier_0_dirs = \ |
---|
97 | config \ |
---|
98 | build \ |
---|
99 | $(NULL) |
---|
100 | |
---|
101 | # |
---|
102 | # tier 1 - 3rd party individual libraries |
---|
103 | # |
---|
104 | tier_1_dirs += dbm |
---|
105 | |
---|
106 | ifndef MOZ_NATIVE_JPEG |
---|
107 | tier_1_dirs += jpeg |
---|
108 | endif |
---|
109 | |
---|
110 | ifndef MOZ_NATIVE_ZLIB |
---|
111 | tier_1_dirs += modules/zlib |
---|
112 | endif |
---|
113 | |
---|
114 | # Installer needs standalone libjar, hence standalone zlib |
---|
115 | ifdef MOZ_INSTALLER |
---|
116 | tier_1_dirs += modules/zlib/standalone |
---|
117 | endif |
---|
118 | |
---|
119 | ifdef MOZ_INTERNAL_LIBART_LGPL |
---|
120 | tier_1_dirs += other-licenses/libart_lgpl |
---|
121 | endif |
---|
122 | |
---|
123 | # |
---|
124 | # tier 2 - base libraries |
---|
125 | # |
---|
126 | tier_2_dirs = \ |
---|
127 | js \ |
---|
128 | xpcom \ |
---|
129 | modules/libreg \ |
---|
130 | xpcom/obsolete \ |
---|
131 | $(NULL) |
---|
132 | |
---|
133 | ifdef NS_TRACE_MALLOC |
---|
134 | tier_2_dirs += tools/trace-malloc/lib tools/trace-malloc |
---|
135 | endif |
---|
136 | |
---|
137 | # |
---|
138 | # tier 9 - core components (necko,gecko) |
---|
139 | # |
---|
140 | |
---|
141 | tier_9_dirs += \ |
---|
142 | js/src/xpconnect \ |
---|
143 | intl \ |
---|
144 | modules/libjar \ |
---|
145 | $(NULL) |
---|
146 | |
---|
147 | ifdef MOZ_OJI |
---|
148 | tier_9_dirs += \ |
---|
149 | js/src/liveconnect \ |
---|
150 | modules/oji \ |
---|
151 | $(NULL) |
---|
152 | endif |
---|
153 | |
---|
154 | ifdef MOZ_ENABLE_XLIB |
---|
155 | tier_9_dirs += gfx/src/xlibrgb widget/src/xlibxtbin |
---|
156 | endif |
---|
157 | |
---|
158 | ifdef MOZ_ENABLE_GTK |
---|
159 | tier_9_dirs += widget/src/gtksuperwin widget/src/gtkxtbin |
---|
160 | endif |
---|
161 | |
---|
162 | ifdef MOZ_ENABLE_GTK2 |
---|
163 | tier_9_dirs += widget/src/gtkxtbin |
---|
164 | endif |
---|
165 | |
---|
166 | ifdef MOZ_IPCD |
---|
167 | tier_9_dirs += ipc/ipcd |
---|
168 | endif |
---|
169 | |
---|
170 | tier_9_dirs += \ |
---|
171 | modules/libutil \ |
---|
172 | netwerk \ |
---|
173 | uriloader \ |
---|
174 | modules/libpref \ |
---|
175 | modules/libimg \ |
---|
176 | caps \ |
---|
177 | rdf \ |
---|
178 | expat \ |
---|
179 | htmlparser \ |
---|
180 | gfx \ |
---|
181 | modules/libpr0n \ |
---|
182 | sun-java \ |
---|
183 | modules/plugin \ |
---|
184 | dom \ |
---|
185 | view \ |
---|
186 | widget \ |
---|
187 | content \ |
---|
188 | layout \ |
---|
189 | db \ |
---|
190 | xpfe/components/shistory \ |
---|
191 | docshell \ |
---|
192 | webshell \ |
---|
193 | profile \ |
---|
194 | embedding \ |
---|
195 | editor \ |
---|
196 | $(NULL) |
---|
197 | |
---|
198 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
199 | tier_9_dirs += xpfe/bootstrap/appleevents |
---|
200 | endif |
---|
201 | |
---|
202 | ifdef MOZ_THUNDERBIRD |
---|
203 | ifdef MOZ_USE_OFFICIAL_BRANDING |
---|
204 | tier_9_dirs += other-licenses/branding/thunderbird |
---|
205 | endif |
---|
206 | endif |
---|
207 | |
---|
208 | ifdef MOZ_PHOENIX |
---|
209 | ifdef MOZ_USE_OFFICIAL_BRANDING |
---|
210 | tier_9_dirs += other-licenses/branding/firefox |
---|
211 | endif |
---|
212 | endif |
---|
213 | |
---|
214 | tier_9_dirs += \ |
---|
215 | xpfe/appshell \ |
---|
216 | xpfe/browser/public \ |
---|
217 | xpfe/components/sidebar/public \ |
---|
218 | xpfe/components/xremote/public \ |
---|
219 | $(NULL) |
---|
220 | |
---|
221 | ifdef MOZ_XUL |
---|
222 | ifdef MOZ_XUL_APP |
---|
223 | tier_9_dirs += chrome |
---|
224 | else |
---|
225 | tier_9_dirs += rdf/chrome |
---|
226 | endif |
---|
227 | endif |
---|
228 | |
---|
229 | ifdef ACCESSIBILITY |
---|
230 | tier_9_dirs += accessible |
---|
231 | endif |
---|
232 | |
---|
233 | ifdef MOZ_LDAP_XPCOM |
---|
234 | tier_9_dirs += directory/xpcom |
---|
235 | endif |
---|
236 | |
---|
237 | ifndef MOZ_XUL |
---|
238 | tier_9_dirs += embedding/minimo/chromelite |
---|
239 | endif |
---|
240 | |
---|
241 | ifdef MOZ_ENABLE_GTK2 |
---|
242 | tier_9_dirs += toolkit/components/gnome |
---|
243 | endif |
---|
244 | |
---|
245 | # |
---|
246 | # tier 40 - security |
---|
247 | # |
---|
248 | ifdef MOZ_PSM |
---|
249 | tier_40_dirs += security/manager |
---|
250 | endif |
---|
251 | |
---|
252 | # |
---|
253 | # tier 50 - xpfe & toolkit |
---|
254 | # |
---|
255 | |
---|
256 | # This must preceed xpfe |
---|
257 | ifdef MOZ_JPROF |
---|
258 | tier_50_dirs += tools/jprof |
---|
259 | endif |
---|
260 | |
---|
261 | ifdef MOZ_XUL_APP |
---|
262 | tier_50_dirs += toolkit/components/history/public |
---|
263 | else |
---|
264 | tier_50_dirs += xpfe/components/history/public |
---|
265 | endif |
---|
266 | |
---|
267 | tier_50_dirs += xpfe themes |
---|
268 | |
---|
269 | ifdef MOZ_LEAKY |
---|
270 | tier_50_dirs += tools/leaky |
---|
271 | endif |
---|
272 | |
---|
273 | ifdef MOZ_MAPINFO |
---|
274 | tier_50_dirs += tools/codesighs |
---|
275 | endif |
---|
276 | |
---|
277 | ifneq (,$(MOZ_L10N_LANG)$(MOZ_L10N_TOOLS)) |
---|
278 | tier_50_dirs += l10n |
---|
279 | endif |
---|
280 | |
---|
281 | ifdef MOZ_XUL_APP |
---|
282 | tier_50_dirs += toolkit |
---|
283 | endif |
---|
284 | |
---|
285 | ifdef MOZ_PHOENIX |
---|
286 | #xpfe/components/search depends on nsIBookmarksService.idl |
---|
287 | #XXXBlake this shell path is a temp hack; toolkit shouldn't depend on browser |
---|
288 | tier_50_dirs += browser/components/bookmarks/public browser/components/shell/public |
---|
289 | endif |
---|
290 | |
---|
291 | # toolkit/xre/ depends on xpinstall, so it must be in tier 50 |
---|
292 | ifdef MOZ_XPINSTALL |
---|
293 | tier_50_dirs += xpinstall |
---|
294 | endif |
---|
295 | |
---|
296 | # |
---|
297 | # tier 9x - application features |
---|
298 | # |
---|
299 | |
---|
300 | ifdef MOZ_JSDEBUGGER |
---|
301 | tier_93_dirs += js/jsd |
---|
302 | endif |
---|
303 | |
---|
304 | ifdef MOZ_EXTENSIONS |
---|
305 | tier_94_dirs += extensions |
---|
306 | endif |
---|
307 | |
---|
308 | ifdef MOZ_MAIL_NEWS |
---|
309 | tier_97_dirs += mailnews |
---|
310 | endif |
---|
311 | |
---|
312 | ifdef MOZ_CALENDAR |
---|
313 | tier_98_dirs += other-licenses/libical calendar |
---|
314 | endif |
---|
315 | |
---|
316 | # |
---|
317 | # tier 99 - application binaries |
---|
318 | # |
---|
319 | |
---|
320 | ifdef MOZ_COMPONENTLIB |
---|
321 | tier_99_dirs += embedding/componentlib |
---|
322 | else |
---|
323 | ifneq (,$(MOZ_STATIC_COMPONENTS)$(MOZ_META_COMPONENTS)) |
---|
324 | tier_99_dirs += modules/staticmod |
---|
325 | endif |
---|
326 | endif # MOZ_COMPONENTLIB |
---|
327 | |
---|
328 | ifdef MOZ_PHOENIX |
---|
329 | tier_99_dirs += browser xpfe/bootstrap/init.d |
---|
330 | ifdef MOZ_USE_OFFICIAL_BRANDING |
---|
331 | tier_99_dirs += other-licenses/branding/firefox/content |
---|
332 | endif |
---|
333 | endif |
---|
334 | |
---|
335 | ifdef MOZ_THUNDERBIRD |
---|
336 | tier_99_dirs += mail xpfe/bootstrap/init.d |
---|
337 | ifdef MOZ_USE_OFFICIAL_BRANDING |
---|
338 | tier_99_dirs += other-licenses/branding/thunderbird/content |
---|
339 | endif |
---|
340 | endif |
---|
341 | |
---|
342 | ifdef MOZ_STANDALONE_COMPOSER |
---|
343 | tier_99_dirs += composer |
---|
344 | endif |
---|
345 | |
---|
346 | ifdef MOZ_XUL_APP |
---|
347 | ifdef MOZ_INSTALLER |
---|
348 | tier_99_dirs += toolkit/mozapps/installer |
---|
349 | endif |
---|
350 | else |
---|
351 | ifneq (,$(MOZ_XPFE_COMPONENTS)$(MOZ_XUL)) |
---|
352 | tier_99_dirs += xpfe/bootstrap |
---|
353 | endif |
---|
354 | endif |
---|
355 | |
---|
356 | ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)) |
---|
357 | tier_99_dirs += embedding/browser/gtk |
---|
358 | endif |
---|
359 | |
---|
360 | # viewer |
---|
361 | ifneq (,$(ENABLE_TESTS)) |
---|
362 | tier_99_dirs += webshell/tests |
---|
363 | endif |
---|
364 | |
---|
365 | # winembed, mfcembed |
---|
366 | ifeq ($(OS_ARCH),WINNT) |
---|
367 | ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL)) |
---|
368 | tier_99_dirs += embedding/tests |
---|
369 | endif |
---|
370 | endif |
---|
371 | |
---|
372 | # os2embed |
---|
373 | ifeq ($(OS_ARCH),OS2) |
---|
374 | ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL)) |
---|
375 | tier_99_dirs += embedding/tests |
---|
376 | endif |
---|
377 | endif |
---|
378 | |
---|
379 | else |
---|
380 | |
---|
381 | # Standalone build |
---|
382 | |
---|
383 | DIRS = $(BUILD_MODULE_DIRS) |
---|
384 | |
---|
385 | # Hack to generate xpidl Makefile |
---|
386 | ifneq ($(BUILD_MODULES),all) |
---|
387 | ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS))) |
---|
388 | DIRS := xpcom/typelib $(DIRS) |
---|
389 | SUBMAKEFILES := xpcom/typelib/Makefile |
---|
390 | endif |
---|
391 | endif |
---|
392 | |
---|
393 | default: $(SUBMAKEFILES) |
---|
394 | $(MAKE) export |
---|
395 | $(MAKE) libs |
---|
396 | |
---|
397 | endif # BUILD_MODULES == all |
---|
398 | |
---|
399 | STATIC_MAKEFILES := nsprpub directory/c-sdk security/nss |
---|
400 | |
---|
401 | GARBAGE_DIRS += dist |
---|
402 | DIST_GARBAGE = config.cache config.log config.status config-defs.h \ |
---|
403 | dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \ |
---|
404 | unallmakefiles mozilla-config.h \ |
---|
405 | $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out |
---|
406 | |
---|
407 | # Build pseudo-external modules first when export is explicitly called |
---|
408 | export:: |
---|
409 | $(RM) -rf $(DIST)/sdk |
---|
410 | $(MAKE) -C config export |
---|
411 | $(MAKE) nspr |
---|
412 | $(MAKE) ldap |
---|
413 | ifneq ($(BUILD_MODULES),all) |
---|
414 | ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS))) |
---|
415 | $(MAKE) -C xpcom/typelib |
---|
416 | $(MAKE) export-idl |
---|
417 | endif |
---|
418 | endif |
---|
419 | |
---|
420 | install:: |
---|
421 | ifndef MOZ_NATIVE_NSPR |
---|
422 | $(MAKE) -C nsprpub real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr |
---|
423 | $(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4)) |
---|
424 | $(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties) |
---|
425 | endif |
---|
426 | ifdef MOZ_LDAP_XPCOM |
---|
427 | $(MAKE) -C directory/c-sdk real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/ldap |
---|
428 | endif |
---|
429 | |
---|
430 | include $(topsrcdir)/config/rules.mk |
---|
431 | |
---|
432 | # Clean up after pseudo-external modules |
---|
433 | clean clobber realclean clobber_all distclean:: |
---|
434 | ifndef MOZ_NATIVE_NSPR |
---|
435 | $(MAKE) -C nsprpub $@ |
---|
436 | endif |
---|
437 | ifdef MOZ_LDAP_XPCOM |
---|
438 | $(MAKE) -C directory/c-sdk $@ |
---|
439 | endif |
---|
440 | |
---|
441 | tier_%: |
---|
442 | @echo "$@: $($@_dirs)" |
---|
443 | @$(EXIT_ON_ERROR) \ |
---|
444 | for d in $($@_dirs); do $(UPDATE_TITLE) \ |
---|
445 | $(MAKE) -C $$d export; \ |
---|
446 | done ; \ |
---|
447 | $(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include ;\ |
---|
448 | for d in $($@_dirs); do $(UPDATE_TITLE) \ |
---|
449 | $(MAKE) -C $$d libs; \ |
---|
450 | done |
---|
451 | # |
---|
452 | # Individual modules |
---|
453 | # |
---|
454 | boehm: |
---|
455 | ifdef GC_LEAK_DETECTOR |
---|
456 | $(MAKE) -C gc/boehm |
---|
457 | endif |
---|
458 | |
---|
459 | nspr: boehm |
---|
460 | ifndef MOZ_NATIVE_NSPR |
---|
461 | $(MAKE) -C nsprpub |
---|
462 | endif |
---|
463 | |
---|
464 | ldap: |
---|
465 | ifdef MOZ_LDAP_XPCOM |
---|
466 | $(MAKE) -C directory/c-sdk |
---|
467 | endif |
---|
468 | |
---|
469 | export:: |
---|
470 | @$(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include |
---|
471 | |
---|
472 | distclean:: |
---|
473 | cat unallmakefiles | $(XARGS) rm -f |
---|
474 | rm -f unallmakefiles $(DIST_GARBAGE) |
---|
475 | |
---|
476 | ifeq ($(OS_ARCH),WINNT) |
---|
477 | rebase: |
---|
478 | ifdef MOZILLA_OFFICIAL |
---|
479 | echo rebasing $(DIST) |
---|
480 | /bin/find $(DIST) -name "*.dll" > rebase.lst |
---|
481 | rebase -b 60000000 -R . -G rebase.lst |
---|
482 | rm rebase.lst |
---|
483 | endif |
---|
484 | |
---|
485 | splitsymbols: |
---|
486 | ifdef MOZILLA_OFFICIAL |
---|
487 | ifdef MOZ_DEBUG_SYMBOLS |
---|
488 | echo finding pdb files |
---|
489 | mkdir -p $(DIST)/$(BUILDID) |
---|
490 | -cp `/bin/find . -path "./dist" -prune -o -name "*.dll" | sed "s/\.dll$$/\.pdb/" | xargs` $(DIST)/$(BUILDID) |
---|
491 | -cp `/bin/find . -path "./dist" -prune -o -name "*.exe" | sed "s/\.exe$$/\.pdb/" | xargs` $(DIST)/$(BUILDID) |
---|
492 | -cp `/bin/find . -path "./dist" -prune -o -name "*.EXE" | sed "s/\.EXE$$/\.pdb/" | xargs` $(DIST)/$(BUILDID) |
---|
493 | endif # MOZ_DEBUG_SYMBOLS |
---|
494 | ifdef MOZ_PROFILE |
---|
495 | echo splitting symbols out of binaries |
---|
496 | /bin/find $(DIST) -name "*.dll" -exec splitsym {} \; |
---|
497 | /bin/find $(DIST) -name "*.exe" -exec splitsym {} \; |
---|
498 | /bin/find $(DIST) -name "*.EXE" -exec splitsym {} \; |
---|
499 | mkdir -p $(DIST)/$(BUILDID) |
---|
500 | /bin/find $(DIST) -name "*.dbg" -exec mv {} $(DIST)/$(BUILDID) \; |
---|
501 | endif # MOZ_PROFILE |
---|
502 | endif # MOZILLA_OFFICIAL |
---|
503 | |
---|
504 | signnss: |
---|
505 | ifdef MOZILLA_OFFICIAL |
---|
506 | echo signing NSS libs |
---|
507 | cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll |
---|
508 | endif # MOZILLA_OFFICIAL |
---|
509 | |
---|
510 | BUILDID = $(shell cat $(DEPTH)/config/build_number) |
---|
511 | deliver: splitsymbols rebase signnss |
---|
512 | |
---|
513 | endif # WINNT |
---|
514 | |
---|