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