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 | $(NULL) |
---|
93 | |
---|
94 | # |
---|
95 | # tier 1 - 3rd party individual libraries |
---|
96 | # |
---|
97 | tier_1_dirs += dbm |
---|
98 | |
---|
99 | ifndef MOZ_NATIVE_JPEG |
---|
100 | tier_1_dirs += jpeg |
---|
101 | endif |
---|
102 | |
---|
103 | ifndef MOZ_NATIVE_ZLIB |
---|
104 | tier_1_dirs += modules/zlib |
---|
105 | endif |
---|
106 | |
---|
107 | # Installer needs standalone libjar, hence standalone zlib |
---|
108 | ifdef MOZ_INSTALLER |
---|
109 | tier_1_dirs += modules/zlib/standalone |
---|
110 | endif |
---|
111 | |
---|
112 | ifdef MOZ_INTERNAL_LIBART_LGPL |
---|
113 | tier_1_dirs += other-licenses/libart_lgpl |
---|
114 | endif |
---|
115 | |
---|
116 | # |
---|
117 | # tier 2 - base libraries |
---|
118 | # |
---|
119 | tier_2_dirs = js |
---|
120 | |
---|
121 | # MacOSX needs to build lib for MoreFiles before xpcom |
---|
122 | ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) |
---|
123 | tier_2_dirs += lib/mac/MoreFiles |
---|
124 | endif |
---|
125 | |
---|
126 | tier_2_dirs += \ |
---|
127 | modules/libreg \ |
---|
128 | string \ |
---|
129 | xpcom \ |
---|
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_JSDEBUGGER |
---|
155 | tier_9_dirs += js/jsd |
---|
156 | endif |
---|
157 | |
---|
158 | ifdef MOZ_ENABLE_XLIB |
---|
159 | tier_9_dirs += gfx/src/xlibrgb widget/src/xlibxtbin |
---|
160 | endif |
---|
161 | |
---|
162 | ifdef MOZ_ENABLE_GTK |
---|
163 | tier_9_dirs += widget/src/gtksuperwin widget/src/gtkxtbin |
---|
164 | endif |
---|
165 | |
---|
166 | ifdef MOZ_ENABLE_GTK2 |
---|
167 | tier_9_dirs += widget/src/gtkxtbin |
---|
168 | endif |
---|
169 | |
---|
170 | ifdef MOZ_IPCD |
---|
171 | tier_9_dirs += ipc/ipcd |
---|
172 | endif |
---|
173 | |
---|
174 | tier_9_dirs += \ |
---|
175 | modules/libutil \ |
---|
176 | netwerk \ |
---|
177 | uriloader \ |
---|
178 | modules/libpref \ |
---|
179 | modules/libimg \ |
---|
180 | caps \ |
---|
181 | rdf \ |
---|
182 | expat \ |
---|
183 | htmlparser \ |
---|
184 | gfx \ |
---|
185 | modules/libpr0n \ |
---|
186 | sun-java \ |
---|
187 | modules/plugin \ |
---|
188 | dom \ |
---|
189 | view \ |
---|
190 | widget \ |
---|
191 | content \ |
---|
192 | layout \ |
---|
193 | db \ |
---|
194 | xpfe/components/shistory \ |
---|
195 | docshell \ |
---|
196 | webshell \ |
---|
197 | profile \ |
---|
198 | embedding \ |
---|
199 | editor \ |
---|
200 | themes \ |
---|
201 | $(NULL) |
---|
202 | |
---|
203 | ifdef ACCESSIBILITY |
---|
204 | tier_9_dirs += accessible |
---|
205 | endif |
---|
206 | |
---|
207 | ifdef MOZ_LDAP_XPCOM |
---|
208 | tier_9_dirs += directory/xpcom |
---|
209 | endif |
---|
210 | |
---|
211 | # This must preceed xpfe |
---|
212 | ifdef MOZ_JPROF |
---|
213 | tier_9_dirs += tools/jprof |
---|
214 | endif |
---|
215 | |
---|
216 | tier_9_dirs += xpfe |
---|
217 | |
---|
218 | ifdef MOZ_XPINSTALL |
---|
219 | tier_9_dirs += xpinstall |
---|
220 | endif |
---|
221 | |
---|
222 | ifdef MOZ_LEAKY |
---|
223 | tier_9_dirs += tools/leaky |
---|
224 | endif |
---|
225 | |
---|
226 | ifdef MOZ_MAPINFO |
---|
227 | tier_9_dirs += tools/codesighs |
---|
228 | endif |
---|
229 | |
---|
230 | ifneq (,$(MOZ_L10N_LANG)$(MOZ_L10N_TOOLS)) |
---|
231 | tier_9_dirs += l10n |
---|
232 | endif |
---|
233 | |
---|
234 | ifdef MOZ_PHOENIX |
---|
235 | tier_9_dirs += toolkit |
---|
236 | # remove this when bug 201821 is fixed |
---|
237 | tier_9_dirs += browser/components/bookmarks/public |
---|
238 | endif |
---|
239 | |
---|
240 | # |
---|
241 | # tier 9x - application features |
---|
242 | # |
---|
243 | |
---|
244 | ifdef MOZ_EXTENSIONS |
---|
245 | tier_94_dirs += extensions |
---|
246 | endif |
---|
247 | |
---|
248 | ifdef MOZ_PSM |
---|
249 | tier_95_dirs += security/manager |
---|
250 | endif |
---|
251 | |
---|
252 | ifdef MOZ_MAIL_NEWS |
---|
253 | tier_97_dirs += mailnews |
---|
254 | endif |
---|
255 | |
---|
256 | ifdef MOZ_CALENDAR |
---|
257 | tier_98_dirs += other-licenses/libical calendar |
---|
258 | endif |
---|
259 | |
---|
260 | # |
---|
261 | # tier 99 - application binaries |
---|
262 | # |
---|
263 | |
---|
264 | ifneq (,$(MOZ_STATIC_COMPONENTS)$(MOZ_META_COMPONENTS)) |
---|
265 | tier_99_dirs += modules/staticmod |
---|
266 | endif |
---|
267 | |
---|
268 | ifdef MOZ_PHOENIX |
---|
269 | tier_99_dirs += browser |
---|
270 | endif |
---|
271 | |
---|
272 | ifdef MOZ_THUNDERBIRD |
---|
273 | tier_99_dirs += toolkit/xre mail |
---|
274 | endif |
---|
275 | |
---|
276 | ifdef MOZ_XUL_APP |
---|
277 | else |
---|
278 | ifneq (,$(MOZ_XPFE_COMPONENTS)$(MOZ_XUL)) |
---|
279 | tier_99_dirs += xpfe/bootstrap |
---|
280 | endif |
---|
281 | endif |
---|
282 | |
---|
283 | ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)) |
---|
284 | tier_99_dirs += embedding/browser/gtk |
---|
285 | endif |
---|
286 | |
---|
287 | # viewer |
---|
288 | ifneq (,$(ENABLE_TESTS)) |
---|
289 | tier_99_dirs += webshell/tests |
---|
290 | endif |
---|
291 | |
---|
292 | # winembed, mfcembed |
---|
293 | ifeq ($(OS_ARCH),WINNT) |
---|
294 | ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL)) |
---|
295 | tier_99_dirs += embedding/tests |
---|
296 | endif |
---|
297 | endif |
---|
298 | |
---|
299 | # os2embed |
---|
300 | ifeq ($(OS_ARCH),OS2) |
---|
301 | ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL)) |
---|
302 | tier_99_dirs += embedding/tests |
---|
303 | endif |
---|
304 | endif |
---|
305 | |
---|
306 | else |
---|
307 | |
---|
308 | # Standalone build |
---|
309 | |
---|
310 | DIRS = $(BUILD_MODULE_DIRS) |
---|
311 | |
---|
312 | # Hack to generate xpidl Makefile |
---|
313 | ifneq ($(BUILD_MODULES),all) |
---|
314 | ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS))) |
---|
315 | DIRS := xpcom/typelib $(DIRS) |
---|
316 | SUBMAKEFILES := xpcom/typelib/Makefile |
---|
317 | endif |
---|
318 | endif |
---|
319 | |
---|
320 | default: $(SUBMAKEFILES) |
---|
321 | $(MAKE) export |
---|
322 | $(MAKE) libs |
---|
323 | |
---|
324 | endif # BUILD_MODULES == all |
---|
325 | |
---|
326 | STATIC_MAKEFILES := nsprpub directory/c-sdk security/nss |
---|
327 | |
---|
328 | GARBAGE_DIRS += dist |
---|
329 | DIST_GARBAGE = config.cache config.log config.status config-defs.h \ |
---|
330 | dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \ |
---|
331 | unallmakefiles mozilla-config.h \ |
---|
332 | $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out |
---|
333 | |
---|
334 | # Build pseudo-external modules first when export is explicitly called |
---|
335 | export:: |
---|
336 | $(MAKE) -C config export |
---|
337 | $(MAKE) nspr |
---|
338 | $(MAKE) ldap |
---|
339 | ifneq ($(BUILD_MODULES),all) |
---|
340 | ifneq (,$(findstring xpcom, $(BUILD_MODULE_DIRS))) |
---|
341 | $(MAKE) -C xpcom/typelib |
---|
342 | $(MAKE) export-idl |
---|
343 | endif |
---|
344 | endif |
---|
345 | |
---|
346 | install:: |
---|
347 | ifndef MOZ_NATIVE_NSPR |
---|
348 | $(MAKE) -C nsprpub real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr |
---|
349 | $(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4)) |
---|
350 | $(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties) |
---|
351 | endif |
---|
352 | ifdef MOZ_LDAP_XPCOM |
---|
353 | $(MAKE) -C directory/c-sdk real_install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/ldap |
---|
354 | endif |
---|
355 | |
---|
356 | include $(topsrcdir)/config/rules.mk |
---|
357 | |
---|
358 | # Clean up after pseudo-external modules |
---|
359 | clean clobber realclean clobber_all distclean:: |
---|
360 | ifndef MOZ_NATIVE_NSPR |
---|
361 | $(MAKE) -C nsprpub $@ |
---|
362 | endif |
---|
363 | ifdef MOZ_LDAP_XPCOM |
---|
364 | $(MAKE) -C directory/c-sdk $@ |
---|
365 | endif |
---|
366 | |
---|
367 | tier_%: |
---|
368 | @echo "$@: $($@_dirs)" |
---|
369 | @$(EXIT_ON_ERROR) \ |
---|
370 | for d in $($@_dirs); do $(UPDATE_TITLE) \ |
---|
371 | $(MAKE) -C $$d export; \ |
---|
372 | done ; \ |
---|
373 | $(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include ;\ |
---|
374 | for d in $($@_dirs); do $(UPDATE_TITLE) \ |
---|
375 | $(MAKE) -C $$d libs; \ |
---|
376 | done |
---|
377 | # |
---|
378 | # Individual modules |
---|
379 | # |
---|
380 | boehm: |
---|
381 | ifdef GC_LEAK_DETECTOR |
---|
382 | $(MAKE) -C gc/boehm |
---|
383 | endif |
---|
384 | |
---|
385 | nspr: boehm |
---|
386 | ifndef MOZ_NATIVE_NSPR |
---|
387 | $(MAKE) -C nsprpub |
---|
388 | endif |
---|
389 | |
---|
390 | ldap: |
---|
391 | ifdef MOZ_LDAP_XPCOM |
---|
392 | $(MAKE) -C directory/c-sdk |
---|
393 | endif |
---|
394 | |
---|
395 | export:: |
---|
396 | @$(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include |
---|
397 | |
---|
398 | distclean:: |
---|
399 | cat unallmakefiles | $(XARGS) rm -f |
---|
400 | rm -f unallmakefiles $(DIST_GARBAGE) |
---|
401 | |
---|
402 | ifeq ($(OS_ARCH),WINNT) |
---|
403 | rebase: |
---|
404 | ifdef MOZILLA_OFFICIAL |
---|
405 | echo rebasing $(DIST) |
---|
406 | /bin/find $(DIST) -name "*.dll" > rebase.lst |
---|
407 | rebase -b 60000000 -R . -G rebase.lst |
---|
408 | rm rebase.lst |
---|
409 | endif |
---|
410 | |
---|
411 | splitsymbols: |
---|
412 | ifdef MOZILLA_OFFICIAL |
---|
413 | echo splitting symbols out of binaries |
---|
414 | /bin/find $(DIST) -name "*.dll" -exec splitsym {} \; |
---|
415 | /bin/find $(DIST) -name "*.exe" -exec splitsym {} \; |
---|
416 | /bin/find $(DIST) -name "*.EXE" -exec splitsym {} \; |
---|
417 | endif # MOZILLA_OFFICIAL |
---|
418 | |
---|
419 | signnss: |
---|
420 | ifdef MOZILLA_OFFICIAL |
---|
421 | echo signing NSS libs |
---|
422 | cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll |
---|
423 | endif # MOZILLA_OFFICIAL |
---|
424 | |
---|
425 | deliver: splitsymbols rebase signnss |
---|
426 | |
---|
427 | endif # WINNT |
---|
428 | |
---|