1 | # The contents of this file are subject to the Netscape Public |
---|
2 | # License Version 1.1 (the "License"); you may not use this file |
---|
3 | # except in compliance with the License. You may obtain a copy of |
---|
4 | # the License at http://www.mozilla.org/NPL/ |
---|
5 | # |
---|
6 | # Software distributed under the License is distributed on an "AS |
---|
7 | # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
---|
8 | # implied. See the License for the specific language governing |
---|
9 | # rights and limitations under the License. |
---|
10 | # |
---|
11 | # The Original Code is mozilla.org code. |
---|
12 | # |
---|
13 | # The Initial Developer of the Original Code is Netscape |
---|
14 | # Communications Corporation. Portions created by Netscape are |
---|
15 | # Copyright (C) 1998 Netscape Communications Corporation. All |
---|
16 | # Rights Reserved. |
---|
17 | # |
---|
18 | # Contributor(s): Stephen Lamm |
---|
19 | |
---|
20 | # Build the Mozilla client. |
---|
21 | # |
---|
22 | # This needs CVSROOT set to work, e.g., |
---|
23 | # setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot |
---|
24 | # or |
---|
25 | # setenv CVSROOT :pserver:username%somedomain.org@cvs.mozilla.org:/cvsroot |
---|
26 | # |
---|
27 | # To checkout and build a tree, |
---|
28 | # 1. cvs co mozilla/client.mk |
---|
29 | # 2. cd mozilla |
---|
30 | # 3. gmake -f client.mk |
---|
31 | # |
---|
32 | # Other targets (gmake -f client.mk [targets...]), |
---|
33 | # checkout |
---|
34 | # build |
---|
35 | # clean (realclean is now the same as clean) |
---|
36 | # distclean |
---|
37 | # |
---|
38 | # See http://www.mozilla.org/build/unix.html for more information. |
---|
39 | # |
---|
40 | # Options: |
---|
41 | # MOZ_OBJDIR - Destination object directory |
---|
42 | # MOZ_CO_DATE - Date tag to use for checkout (default: none) |
---|
43 | # MOZ_CO_MODULE - Module to checkout (default: SeaMonkeyAll) |
---|
44 | # MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3) |
---|
45 | # MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P) |
---|
46 | # MOZ_MAKE_FLAGS - Flags to pass to $(MAKE) |
---|
47 | # MOZ_CO_BRANCH - Branch tag (Deprecated. Use MOZ_CO_TAG below.) |
---|
48 | # |
---|
49 | |
---|
50 | ####################################################################### |
---|
51 | # Checkout Tags |
---|
52 | # |
---|
53 | # For branches, uncomment the MOZ_CO_TAG line with the proper tag, |
---|
54 | # and commit this file on that tag. |
---|
55 | MOZ_CO_TAG = MOZILLA_1_5_RELEASE |
---|
56 | NSPR_CO_TAG = MOZILLA_1_5_RELEASE |
---|
57 | PSM_CO_TAG = MOZILLA_1_5_RELEASE |
---|
58 | NSS_CO_TAG = MOZILLA_1_5_RELEASE |
---|
59 | LDAPCSDK_CO_TAG = MOZILLA_1_5_RELEASE |
---|
60 | ACCESSIBLE_CO_TAG = MOZILLA_1_5_RELEASE |
---|
61 | IMGLIB2_CO_TAG = MOZILLA_1_5_RELEASE |
---|
62 | IPC_CO_TAG = MOZILLA_1_5_RELEASE |
---|
63 | TOOLKIT_CO_TAG = MOZILLA_1_5_RELEASE |
---|
64 | BROWSER_CO_TAG = MOZILLA_1_5_RELEASE |
---|
65 | MAIL_CO_TAG = MOZILLA_1_5_RELEASE |
---|
66 | BUILD_MODULES = all |
---|
67 | |
---|
68 | ####################################################################### |
---|
69 | # Defines |
---|
70 | # |
---|
71 | CVS = cvs |
---|
72 | |
---|
73 | CWD := $(shell pwd) |
---|
74 | |
---|
75 | ifeq "$(CWD)" "/" |
---|
76 | CWD := /. |
---|
77 | endif |
---|
78 | |
---|
79 | ifneq (, $(wildcard client.mk)) |
---|
80 | # Ran from mozilla directory |
---|
81 | ROOTDIR := $(shell dirname $(CWD)) |
---|
82 | TOPSRCDIR := $(CWD) |
---|
83 | else |
---|
84 | # Ran from mozilla/.. directory (?) |
---|
85 | ROOTDIR := $(CWD) |
---|
86 | TOPSRCDIR := $(CWD)/mozilla |
---|
87 | endif |
---|
88 | |
---|
89 | # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't |
---|
90 | # work; replace first instance with one forward slash |
---|
91 | TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%') |
---|
92 | |
---|
93 | ifndef TOPSRCDIR_MOZ |
---|
94 | TOPSRCDIR_MOZ=$(TOPSRCDIR) |
---|
95 | endif |
---|
96 | |
---|
97 | # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/" |
---|
98 | DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://') |
---|
99 | ifeq ($(DIRNAME),) |
---|
100 | ROOTDIR := /. |
---|
101 | endif |
---|
102 | |
---|
103 | AUTOCONF := autoconf |
---|
104 | MKDIR := mkdir |
---|
105 | SH := /bin/sh |
---|
106 | ifndef MAKE |
---|
107 | MAKE := gmake |
---|
108 | endif |
---|
109 | |
---|
110 | CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess) |
---|
111 | ifdef CONFIG_GUESS_SCRIPT |
---|
112 | CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT)) |
---|
113 | else |
---|
114 | _IS_FIRST_CHECKOUT := 1 |
---|
115 | endif |
---|
116 | |
---|
117 | #################################### |
---|
118 | # CVS |
---|
119 | |
---|
120 | # Add the CVS root to CVS_FLAGS if needed |
---|
121 | CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null) |
---|
122 | ifneq ($(CVS_ROOT_IN_TREE),) |
---|
123 | ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT)) |
---|
124 | CVS_FLAGS := -d $(CVS_ROOT_IN_TREE) |
---|
125 | endif |
---|
126 | endif |
---|
127 | |
---|
128 | CVSCO = $(strip $(CVS) $(CVS_FLAGS) co $(CVS_CO_FLAGS)) |
---|
129 | CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log |
---|
130 | CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%) |
---|
131 | |
---|
132 | ifdef MOZ_CO_TAG |
---|
133 | CVS_CO_FLAGS := -r $(MOZ_CO_TAG) |
---|
134 | endif |
---|
135 | |
---|
136 | #################################### |
---|
137 | # Load mozconfig Options |
---|
138 | |
---|
139 | # See build pages, http://www.mozilla.org/build/unix.html, |
---|
140 | # for how to set up mozconfig. |
---|
141 | MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk |
---|
142 | MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find |
---|
143 | MOZCONFIG_MODULES := mozilla/build/unix/modules.mk mozilla/build/unix/uniq.pl |
---|
144 | run_for_side_effects := \ |
---|
145 | $(shell cd $(ROOTDIR); \ |
---|
146 | if test "$(_IS_FIRST_CHECKOUT)"; then \ |
---|
147 | $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \ |
---|
148 | else true; \ |
---|
149 | fi; \ |
---|
150 | $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out) |
---|
151 | include $(TOPSRCDIR)/.mozconfig.mk |
---|
152 | include $(TOPSRCDIR)/build/unix/modules.mk |
---|
153 | |
---|
154 | #################################### |
---|
155 | # Options that may come from mozconfig |
---|
156 | |
---|
157 | # Change CVS flags if anonymous root is requested |
---|
158 | ifdef MOZ_CO_USE_MIRROR |
---|
159 | CVS_FLAGS := -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot |
---|
160 | endif |
---|
161 | |
---|
162 | # MOZ_CVS_FLAGS - Basic CVS flags |
---|
163 | ifeq "$(origin MOZ_CVS_FLAGS)" "undefined" |
---|
164 | CVS_FLAGS := $(CVS_FLAGS) -q -z 3 |
---|
165 | else |
---|
166 | CVS_FLAGS := $(MOZ_CVS_FLAGS) |
---|
167 | endif |
---|
168 | |
---|
169 | # This option is deprecated. The best way to have client.mk pull a tag |
---|
170 | # is to set MOZ_CO_TAG (see above) and commit that change on the tag. |
---|
171 | ifdef MOZ_CO_BRANCH |
---|
172 | $(warning Use MOZ_CO_TAG instead of MOZ_CO_BRANCH) |
---|
173 | CVS_CO_FLAGS := -r $(MOZ_CO_BRANCH) |
---|
174 | endif |
---|
175 | |
---|
176 | # MOZ_CO_FLAGS - Anything that we should use on all checkouts |
---|
177 | ifeq "$(origin MOZ_CO_FLAGS)" "undefined" |
---|
178 | CVS_CO_FLAGS := $(CVS_CO_FLAGS) -P |
---|
179 | else |
---|
180 | CVS_CO_FLAGS := $(CVS_CO_FLAGS) $(MOZ_CO_FLAGS) |
---|
181 | endif |
---|
182 | |
---|
183 | ifdef MOZ_CO_DATE |
---|
184 | CVS_CO_DATE_FLAGS := -D "$(MOZ_CO_DATE)" |
---|
185 | endif |
---|
186 | |
---|
187 | ifdef MOZ_OBJDIR |
---|
188 | OBJDIR := $(MOZ_OBJDIR) |
---|
189 | MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR) |
---|
190 | else |
---|
191 | OBJDIR := $(TOPSRCDIR) |
---|
192 | MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS) |
---|
193 | endif |
---|
194 | |
---|
195 | #################################### |
---|
196 | # CVS defines for PSM |
---|
197 | # |
---|
198 | PSM_CO_MODULE= mozilla/security/manager |
---|
199 | PSM_CO_FLAGS := -P -A |
---|
200 | ifdef MOZ_CO_FLAGS |
---|
201 | PSM_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
202 | endif |
---|
203 | ifdef PSM_CO_TAG |
---|
204 | PSM_CO_FLAGS := $(PSM_CO_FLAGS) -r $(PSM_CO_TAG) |
---|
205 | endif |
---|
206 | CVSCO_PSM = $(CVS) $(CVS_FLAGS) co $(PSM_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(PSM_CO_MODULE) |
---|
207 | |
---|
208 | #################################### |
---|
209 | # CVS defines for NSS |
---|
210 | # |
---|
211 | NSS_CO_MODULE = mozilla/security/nss \ |
---|
212 | mozilla/security/coreconf \ |
---|
213 | $(NULL) |
---|
214 | |
---|
215 | NSS_CO_FLAGS := -P |
---|
216 | ifdef MOZ_CO_FLAGS |
---|
217 | NSS_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
218 | endif |
---|
219 | ifdef NSS_CO_TAG |
---|
220 | NSS_CO_FLAGS := $(NSS_CO_FLAGS) -r $(NSS_CO_TAG) |
---|
221 | endif |
---|
222 | # Cannot pull static tags by date |
---|
223 | ifeq ($(NSS_CO_TAG),NSS_CLIENT_TAG) |
---|
224 | CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE) |
---|
225 | else |
---|
226 | CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE) |
---|
227 | endif |
---|
228 | |
---|
229 | #################################### |
---|
230 | # CVS defines for NSPR |
---|
231 | # |
---|
232 | NSPR_CO_MODULE = mozilla/nsprpub |
---|
233 | NSPR_CO_FLAGS := -P |
---|
234 | ifdef MOZ_CO_FLAGS |
---|
235 | NSPR_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
236 | endif |
---|
237 | ifdef NSPR_CO_TAG |
---|
238 | NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) -r $(NSPR_CO_TAG) |
---|
239 | endif |
---|
240 | # Cannot pull static tags by date |
---|
241 | ifeq ($(NSPR_CO_TAG),NSPRPUB_CLIENT_TAG) |
---|
242 | CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE) |
---|
243 | else |
---|
244 | CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE) |
---|
245 | endif |
---|
246 | |
---|
247 | #################################### |
---|
248 | # CVS defines for the C LDAP SDK |
---|
249 | # |
---|
250 | LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk |
---|
251 | LDAPCSDK_CO_FLAGS := -P |
---|
252 | ifdef MOZ_CO_FLAGS |
---|
253 | LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
254 | endif |
---|
255 | ifdef LDAPCSDK_CO_TAG |
---|
256 | LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) -r $(LDAPCSDK_CO_TAG) |
---|
257 | endif |
---|
258 | CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE) |
---|
259 | |
---|
260 | #################################### |
---|
261 | # CVS defines for the C LDAP SDK |
---|
262 | # |
---|
263 | ACCESSIBLE_CO_MODULE = mozilla/accessible |
---|
264 | ACCESSIBLE_CO_FLAGS := -P |
---|
265 | ifdef MOZ_CO_FLAGS |
---|
266 | ACCESSIBLE_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
267 | endif |
---|
268 | ifdef ACCESSIBLE_CO_TAG |
---|
269 | ACCESSIBLE_CO_FLAGS := $(ACCESSIBLE_CO_FLAGS) -r $(ACCESSIBLE_CO_TAG) |
---|
270 | endif |
---|
271 | CVSCO_ACCESSIBLE = $(CVS) $(CVS_FLAGS) co $(ACCESSIBLE_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(ACCESSIBLE_CO_MODULE) |
---|
272 | |
---|
273 | |
---|
274 | #################################### |
---|
275 | # CVS defines for new image library |
---|
276 | # |
---|
277 | IMGLIB2_CO_MODULE = mozilla/modules/libpr0n |
---|
278 | IMGLIB2_CO_FLAGS := -P |
---|
279 | ifdef MOZ_CO_FLAGS |
---|
280 | IMGLIB2_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
281 | endif |
---|
282 | ifdef IMGLIB2_CO_TAG |
---|
283 | IMGLIB2_CO_FLAGS := $(IMGLIB2_CO_FLAGS) -r $(IMGLIB2_CO_TAG) |
---|
284 | endif |
---|
285 | CVSCO_IMGLIB2 = $(CVS) $(CVS_FLAGS) co $(IMGLIB2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IMGLIB2_CO_MODULE) |
---|
286 | |
---|
287 | #################################### |
---|
288 | # CVS defines for ipc module |
---|
289 | # |
---|
290 | IPC_CO_MODULE = mozilla/ipc/ipcd |
---|
291 | IPC_CO_FLAGS := -P |
---|
292 | ifdef MOZ_CO_FLAGS |
---|
293 | IPC_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
294 | endif |
---|
295 | ifdef IPC_CO_TAG |
---|
296 | IPC_CO_FLAGS := $(IPC_CO_FLAGS) -r $(IPC_CO_TAG) |
---|
297 | endif |
---|
298 | CVSCO_IPC = $(CVS) $(CVS_FLAGS) co $(IPC_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IPC_CO_MODULE) |
---|
299 | |
---|
300 | #################################### |
---|
301 | # CVS defines for Calendar |
---|
302 | # |
---|
303 | CVSCO_CALENDAR := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/calendar mozilla/other-licenses/libical |
---|
304 | |
---|
305 | #################################### |
---|
306 | # CVS defines for SeaMonkey |
---|
307 | # |
---|
308 | ifeq ($(MOZ_CO_MODULE),) |
---|
309 | MOZ_CO_MODULE := SeaMonkeyAll |
---|
310 | endif |
---|
311 | CVSCO_SEAMONKEY := $(CVSCO) $(CVS_CO_DATE_FLAGS) $(MOZ_CO_MODULE) |
---|
312 | |
---|
313 | #################################### |
---|
314 | # CVS defines for standalone modules |
---|
315 | # |
---|
316 | ifeq ($(BUILD_MODULES),all) |
---|
317 | CHECKOUT_STANDALONE := true |
---|
318 | CHECKOUT_STANDALONE_NOSUBDIRS := true |
---|
319 | else |
---|
320 | STANDALONE_CO_MODULE := $(filter-out $(NSPRPUB_DIR) security directory/c-sdk, $(BUILD_MODULE_CVS)) |
---|
321 | STANDALONE_CO_MODULE += allmakefiles.sh client.mk aclocal.m4 configure configure.in |
---|
322 | STANDALONE_CO_MODULE += Makefile.in |
---|
323 | STANDALONE_CO_MODULE := $(addprefix mozilla/, $(STANDALONE_CO_MODULE)) |
---|
324 | CHECKOUT_STANDALONE := cvs_co $(CVSCO) $(CVS_CO_DATE_FLAGS) $(STANDALONE_CO_MODULE) |
---|
325 | |
---|
326 | NOSUBDIRS_MODULE := $(addprefix mozilla/, $(BUILD_MODULE_CVS_NS)) |
---|
327 | ifneq ($(NOSUBDIRS_MODULE),) |
---|
328 | CHECKOUT_STANDALONE_NOSUBDIRS := cvs_co $(CVSCO) -l $(CVS_CO_DATE_FLAGS) $(NOSUBDIRS_MODULE) |
---|
329 | else |
---|
330 | CHECKOUT_STANDALONE_NOSUBDIRS := true |
---|
331 | endif |
---|
332 | |
---|
333 | CVSCO_SEAMONKEY := |
---|
334 | ifeq (,$(filter $(NSPRPUB_DIR), $(BUILD_MODULE_CVS))) |
---|
335 | CVSCO_NSPR := |
---|
336 | endif |
---|
337 | ifeq (,$(filter security security/manager, $(BUILD_MODULE_CVS))) |
---|
338 | CVSCO_PSM := |
---|
339 | CVSCO_NSS := |
---|
340 | endif |
---|
341 | ifeq (,$(filter directory/c-sdk, $(BUILD_MODULE_CVS))) |
---|
342 | CVSCO_LDAPCSDK := |
---|
343 | endif |
---|
344 | ifeq (,$(filter accessible, $(BUILD_MODULE_CVS))) |
---|
345 | CVSCO_ACCESSIBLE := |
---|
346 | endif |
---|
347 | ifeq (,$(filter modules/libpr0n, $(BUILD_MODULE_CVS))) |
---|
348 | CVSCO_IMGLIB2 := |
---|
349 | endif |
---|
350 | ifeq (,$(filter ipc, $(BUILD_MODULE_CVS))) |
---|
351 | CVSCO_IPC := |
---|
352 | endif |
---|
353 | ifeq (,$(filter calendar other-licenses/libical, $(BUILD_MODULE_CVS))) |
---|
354 | CVSCO_CALENDAR := |
---|
355 | endif |
---|
356 | endif |
---|
357 | |
---|
358 | #################################### |
---|
359 | # CVS defined for libart (pulled and built if MOZ_INTERNAL_LIBART_LGPL is set) |
---|
360 | # |
---|
361 | CVSCO_LIBART := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/other-licenses/libart_lgpl |
---|
362 | |
---|
363 | ifdef MOZ_INTERNAL_LIBART_LGPL |
---|
364 | FASTUPDATE_LIBART := fast_update $(CVSCO_LIBART) |
---|
365 | CHECKOUT_LIBART := cvs_co $(CVSCO_LIBART) |
---|
366 | else |
---|
367 | CHECKOUT_LIBART := true |
---|
368 | FASTUPDATE_LIBART := true |
---|
369 | endif |
---|
370 | |
---|
371 | #################################### |
---|
372 | # CVS defines for Phoenix (pulled and built if MOZ_PHOENIX is set) |
---|
373 | # |
---|
374 | BROWSER_CO_FLAGS := -P |
---|
375 | ifdef MOZ_CO_FLAGS |
---|
376 | BROWSER_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
377 | endif |
---|
378 | ifdef BROWSER_CO_TAG |
---|
379 | BROWSER_CO_FLAGS := $(BROWSER_CO_FLAGS) -r $(BROWSER_CO_TAG) |
---|
380 | endif |
---|
381 | |
---|
382 | CVSCO_PHOENIX := $(CVS) $(CVS_FLAGS) co $(BROWSER_CO_FLAGS) $(CVS_CO_DATE_FLAGS) mozilla/browser |
---|
383 | |
---|
384 | ifdef MOZ_PHOENIX |
---|
385 | FASTUPDATE_PHOENIX := fast_update $(CVSCO_PHOENIX) |
---|
386 | CHECKOUT_PHOENIX := cvs_co $(CVSCO_PHOENIX) |
---|
387 | MOZ_XUL_APP = 1 |
---|
388 | else |
---|
389 | CHECKOUT_PHOENIX := true |
---|
390 | FASTUPDATE_PHOENIX := true |
---|
391 | endif |
---|
392 | |
---|
393 | #################################### |
---|
394 | # CVS defines for Thunderbird (pulled and built if MOZ_THUNDERBIRD is set) |
---|
395 | # |
---|
396 | |
---|
397 | MAIL_CO_FLAGS := -P |
---|
398 | ifdef MOZ_CO_FLAGS |
---|
399 | MAIL_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
400 | endif |
---|
401 | ifdef MAIL_CO_TAG |
---|
402 | MAIL_CO_FLAGS := $(MAIL_CO_FLAGS) -r $(MAIL_CO_TAG) |
---|
403 | endif |
---|
404 | |
---|
405 | CVSCO_THUNDERBIRD := $(CVS) $(CVS_FLAGS) co $(MAIL_CO_FLAGS) $(CVS_CO_DATE_FLAGS) mozilla/mail |
---|
406 | ifdef MOZ_THUNDERBIRD |
---|
407 | FASTUPDATE_THUNDERBIRD := fast_update $(CVSCO_THUNDERBIRD) |
---|
408 | CHECKOUT_THUNDERBIRD := cvs_co $(CVSCO_THUNDERBIRD) |
---|
409 | MOZ_XUL_APP = 1 |
---|
410 | else |
---|
411 | FASTUPDATE_THUNDERBIRD := true |
---|
412 | CHECKOUT_THUNDERBIRD := true |
---|
413 | endif |
---|
414 | |
---|
415 | #################################### |
---|
416 | # CVS defines for mozilla/toolkit (pulled and built if MOZ_XUL_APP is set) |
---|
417 | # |
---|
418 | |
---|
419 | TOOLKIT_CO_FLAGS := -P |
---|
420 | ifdef MOZ_CO_FLAGS |
---|
421 | TOOLKIT_CO_FLAGS := $(MOZ_CO_FLAGS) |
---|
422 | endif |
---|
423 | ifdef TOOLKIT_CO_TAG |
---|
424 | TOOLKIT_CO_FLAGS := $(TOOLKIT_CO_FLAGS) -r $(TOOLKIT_CO_TAG) |
---|
425 | endif |
---|
426 | |
---|
427 | CVSCO_MOZTOOLKIT := $(CVS) $(CVS_FLAGS) co $(TOOLKIT_CO_FLAGS) $(CVS_CO_DATE_FLAGS) mozilla/toolkit mozilla/chrome |
---|
428 | ifdef MOZ_XUL_APP |
---|
429 | FASTUPDATE_MOZTOOLKIT := fast_update $(CVSCO_MOZTOOLKIT) |
---|
430 | CHECKOUT_MOZTOOLKIT := cvs_co $(CVSCO_MOZTOOLKIT) |
---|
431 | else |
---|
432 | FASTUPDATE_MOZTOOLKIT := true |
---|
433 | CHECKOUT_MOZTOOLKIT := true |
---|
434 | endif |
---|
435 | |
---|
436 | #################################### |
---|
437 | # CVS defines for codesighs (pulled and built if MOZ_MAPINFO is set) |
---|
438 | # |
---|
439 | CVSCO_CODESIGHS := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/tools/codesighs |
---|
440 | |
---|
441 | ifdef MOZ_MAPINFO |
---|
442 | FASTUPDATE_CODESIGHS := fast_update $(CVSCO_CODESIGHS) |
---|
443 | CHECKOUT_CODESIGHS := cvs_co $(CVSCO_CODESIGHS) |
---|
444 | else |
---|
445 | CHECKOUT_CODESIGHS := true |
---|
446 | FASTUPDATE_CODESIGHS := true |
---|
447 | endif |
---|
448 | |
---|
449 | ####################################################################### |
---|
450 | # Rules |
---|
451 | # |
---|
452 | |
---|
453 | # Print out any options loaded from mozconfig. |
---|
454 | all build checkout clean depend distclean export libs install realclean:: |
---|
455 | @if test -f .mozconfig.out; then \ |
---|
456 | cat .mozconfig.out; \ |
---|
457 | rm -f .mozconfig.out; \ |
---|
458 | else true; \ |
---|
459 | fi |
---|
460 | |
---|
461 | ifdef _IS_FIRST_CHECKOUT |
---|
462 | all:: checkout build |
---|
463 | else |
---|
464 | all:: checkout alldep |
---|
465 | endif |
---|
466 | |
---|
467 | # Windows equivalents |
---|
468 | pull_all: checkout |
---|
469 | build_all: build |
---|
470 | build_all_dep: alldep |
---|
471 | build_all_depend: alldep |
---|
472 | clobber clobber_all: clean |
---|
473 | pull_and_build_all: checkout alldep |
---|
474 | |
---|
475 | # Do everything from scratch |
---|
476 | everything: checkout clean build |
---|
477 | |
---|
478 | #################################### |
---|
479 | # CVS checkout |
---|
480 | # |
---|
481 | checkout:: |
---|
482 | # @: Backup the last checkout log. |
---|
483 | @if test -f $(CVSCO_LOGFILE) ; then \ |
---|
484 | mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \ |
---|
485 | else true; \ |
---|
486 | fi |
---|
487 | ifdef RUN_AUTOCONF_LOCALLY |
---|
488 | @echo "Removing local configures" ; \ |
---|
489 | cd $(ROOTDIR) && \ |
---|
490 | $(RM) -f mozilla/configure mozilla/nsprpub/configure \ |
---|
491 | mozilla/directory/c-sdk/configure |
---|
492 | endif |
---|
493 | @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE) |
---|
494 | @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \ |
---|
495 | cd $(ROOTDIR) && \ |
---|
496 | $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES) |
---|
497 | @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout |
---|
498 | |
---|
499 | real_checkout: |
---|
500 | # @: Start the checkout. Split the output to the tty and a log file. \ |
---|
501 | # : If it fails, touch an error file because "tee" hides the error. |
---|
502 | @failed=.cvs-failed.tmp; rm -f $$failed*; \ |
---|
503 | cvs_co() { echo "$$@" ; \ |
---|
504 | ("$$@" || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \ |
---|
505 | if test -f $$failed; then false; else true; fi; }; \ |
---|
506 | $(CHECKOUT_STANDALONE) && \ |
---|
507 | $(CHECKOUT_STANDALONE_NOSUBDIRS) && \ |
---|
508 | cvs_co $(CVSCO_NSPR) && \ |
---|
509 | cvs_co $(CVSCO_NSS) && \ |
---|
510 | cvs_co $(CVSCO_PSM) && \ |
---|
511 | cvs_co $(CVSCO_LDAPCSDK) && \ |
---|
512 | cvs_co $(CVSCO_ACCESSIBLE) && \ |
---|
513 | cvs_co $(CVSCO_IMGLIB2) && \ |
---|
514 | cvs_co $(CVSCO_IPC) && \ |
---|
515 | cvs_co $(CVSCO_CALENDAR) && \ |
---|
516 | $(CHECKOUT_LIBART) && \ |
---|
517 | $(CHECKOUT_MOZTOOLKIT) && \ |
---|
518 | $(CHECKOUT_PHOENIX) && \ |
---|
519 | $(CHECKOUT_THUNDERBIRD) && \ |
---|
520 | $(CHECKOUT_CODESIGHS) && \ |
---|
521 | cvs_co $(CVSCO_SEAMONKEY) |
---|
522 | @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE) |
---|
523 | # update the NSS checkout timestamp |
---|
524 | @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \ |
---|
525 | touch $(TOPSRCDIR)/security/manager/.nss.checkout; \ |
---|
526 | fi |
---|
527 | # @: Check the log for conflicts. ; |
---|
528 | @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\ |
---|
529 | if test "$$conflicts" ; then \ |
---|
530 | echo "$(MAKE): *** Conflicts during checkout." ;\ |
---|
531 | echo "$$conflicts" ;\ |
---|
532 | echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\ |
---|
533 | false; \ |
---|
534 | else true; \ |
---|
535 | fi |
---|
536 | ifdef RUN_AUTOCONF_LOCALLY |
---|
537 | @echo Generating configures using $(AUTOCONF) ; \ |
---|
538 | cd $(TOPSRCDIR) && $(AUTOCONF) && \ |
---|
539 | cd $(TOPSRCDIR)/nsprpub && $(AUTOCONF) && \ |
---|
540 | cd $(TOPSRCDIR)/directory/c-sdk && $(AUTOCONF) |
---|
541 | endif |
---|
542 | |
---|
543 | fast-update: |
---|
544 | # @: Backup the last checkout log. |
---|
545 | @if test -f $(CVSCO_LOGFILE) ; then \ |
---|
546 | mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \ |
---|
547 | else true; \ |
---|
548 | fi |
---|
549 | ifdef RUN_AUTOCONF_LOCALLY |
---|
550 | @echo "Removing local configures" ; \ |
---|
551 | cd $(ROOTDIR) && \ |
---|
552 | $(RM) -f mozilla/configure mozilla/nsprpub/configure \ |
---|
553 | mozilla/directory/c-sdk/configure |
---|
554 | endif |
---|
555 | @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE) |
---|
556 | @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \ |
---|
557 | cd $(ROOTDIR) && \ |
---|
558 | $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES) |
---|
559 | @cd $(TOPSRCDIR) && \ |
---|
560 | $(MAKE) -f client.mk real_fast-update |
---|
561 | |
---|
562 | real_fast-update: |
---|
563 | # @: Start the update. Split the output to the tty and a log file. \ |
---|
564 | # : If it fails, touch an error file because "tee" hides the error. |
---|
565 | @failed=.fast_update-failed.tmp; rm -f $$failed*; \ |
---|
566 | fast_update() { (config/cvsco-fast-update.pl $$@ || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \ |
---|
567 | if test -f $$failed; then false; else true; fi; }; \ |
---|
568 | cvs_co() { echo "$$@" ; \ |
---|
569 | ("$$@" || touch $$failed) 2>&1 | tee -a $(CVSCO_LOGFILE) && \ |
---|
570 | if test -f $$failed; then false; else true; fi; }; \ |
---|
571 | fast_update $(CVSCO_NSPR) && \ |
---|
572 | cd $(ROOTDIR) && \ |
---|
573 | failed=mozilla/.fast_update-failed.tmp && \ |
---|
574 | cvs_co $(CVSCO_NSS) && \ |
---|
575 | failed=.fast_update-failed.tmp && \ |
---|
576 | cd mozilla && \ |
---|
577 | fast_update $(CVSCO_PSM) && \ |
---|
578 | fast_update $(CVSCO_LDAPCSDK) && \ |
---|
579 | fast_update $(CVSCO_ACCESSIBLE) && \ |
---|
580 | fast_update $(CVSCO_IMGLIB2) && \ |
---|
581 | fast_update $(CVSCO_IPC) && \ |
---|
582 | fast_update $(CVSCO_CALENDAR) && \ |
---|
583 | $(FASTUPDATE_LIBART) && \ |
---|
584 | $(FASTUPDATE_MOZTOOLKIT) && \ |
---|
585 | $(FASTUPDATE_PHOENIX) && \ |
---|
586 | $(FASTUPDATE_THUNDERBIRD) && \ |
---|
587 | $(FASTUPDATE_CODESIGHS) && \ |
---|
588 | fast_update $(CVSCO_SEAMONKEY) |
---|
589 | @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE) |
---|
590 | # update the NSS checkout timestamp |
---|
591 | @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \ |
---|
592 | touch $(TOPSRCDIR)/security/manager/.nss.checkout; \ |
---|
593 | fi |
---|
594 | # @: Check the log for conflicts. ; |
---|
595 | @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\ |
---|
596 | if test "$$conflicts" ; then \ |
---|
597 | echo "$(MAKE): *** Conflicts during fast-update." ;\ |
---|
598 | echo "$$conflicts" ;\ |
---|
599 | echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\ |
---|
600 | false; \ |
---|
601 | else true; \ |
---|
602 | fi |
---|
603 | ifdef RUN_AUTOCONF_LOCALLY |
---|
604 | @echo Generating configures using $(AUTOCONF) ; \ |
---|
605 | cd $(TOPSRCDIR) && $(AUTOCONF) && \ |
---|
606 | cd $(TOPSRCDIR)/nsprpub && $(AUTOCONF) && \ |
---|
607 | cd $(TOPSRCDIR)/directory/c-sdk && $(AUTOCONF) |
---|
608 | endif |
---|
609 | |
---|
610 | #################################### |
---|
611 | # Web configure |
---|
612 | |
---|
613 | WEBCONFIG_FILE := $(HOME)/.mozconfig |
---|
614 | |
---|
615 | MOZCONFIG2CONFIGURATOR := build/autoconf/mozconfig2configurator |
---|
616 | webconfig: |
---|
617 | @cd $(TOPSRCDIR); \ |
---|
618 | url=`$(MOZCONFIG2CONFIGURATOR) $(TOPSRCDIR)`; \ |
---|
619 | echo Running mozilla with the following url: ;\ |
---|
620 | echo ;\ |
---|
621 | echo $$url ;\ |
---|
622 | mozilla -remote "openURL($$url)" || \ |
---|
623 | netscape -remote "openURL($$url)" || \ |
---|
624 | mozilla $$url || \ |
---|
625 | netscape $$url ;\ |
---|
626 | echo ;\ |
---|
627 | echo 1. Fill out the form on the browser. ;\ |
---|
628 | echo 2. Save the results to $(WEBCONFIG_FILE) |
---|
629 | |
---|
630 | ##################################################### |
---|
631 | # First Checkout |
---|
632 | |
---|
633 | ifdef _IS_FIRST_CHECKOUT |
---|
634 | # First time, do build target in a new process to pick up new files. |
---|
635 | build:: |
---|
636 | $(MAKE) -f $(TOPSRCDIR)/client.mk build |
---|
637 | else |
---|
638 | |
---|
639 | ##################################################### |
---|
640 | # After First Checkout |
---|
641 | |
---|
642 | |
---|
643 | #################################### |
---|
644 | # Configure |
---|
645 | |
---|
646 | CONFIG_STATUS := $(wildcard $(OBJDIR)/config.status) |
---|
647 | CONFIG_CACHE := $(wildcard $(OBJDIR)/config.cache) |
---|
648 | |
---|
649 | ifdef RUN_AUTOCONF_LOCALLY |
---|
650 | EXTRA_CONFIG_DEPS := \ |
---|
651 | $(TOPSRCDIR)/aclocal.m4 \ |
---|
652 | $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \ |
---|
653 | $(NULL) |
---|
654 | |
---|
655 | $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS) |
---|
656 | @echo Generating $@ using autoconf |
---|
657 | cd $(TOPSRCDIR); $(AUTOCONF) |
---|
658 | endif |
---|
659 | |
---|
660 | CONFIG_STATUS_DEPS_L10N := $(wildcard $(TOPSRCDIR)/l10n/makefiles.all) |
---|
661 | |
---|
662 | CONFIG_STATUS_DEPS := \ |
---|
663 | $(TOPSRCDIR)/configure \ |
---|
664 | $(TOPSRCDIR)/allmakefiles.sh \ |
---|
665 | $(TOPSRCDIR)/.mozconfig.mk \ |
---|
666 | $(wildcard $(TOPSRCDIR)/nsprpub/configure) \ |
---|
667 | $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \ |
---|
668 | $(wildcard $(TOPSRCDIR)/mailnews/makefiles) \ |
---|
669 | $(CONFIG_STATUS_DEPS_L10N) \ |
---|
670 | $(wildcard $(TOPSRCDIR)/themes/makefiles) \ |
---|
671 | $(NULL) |
---|
672 | |
---|
673 | # configure uses the program name to determine @srcdir@. Calling it without |
---|
674 | # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full |
---|
675 | # path of $(TOPSRCDIR). |
---|
676 | ifeq ($(TOPSRCDIR),$(OBJDIR)) |
---|
677 | CONFIGURE := ./configure |
---|
678 | else |
---|
679 | CONFIGURE := $(TOPSRCDIR)/configure |
---|
680 | endif |
---|
681 | |
---|
682 | ifdef MOZ_TOOLS |
---|
683 | CONFIGURE := $(TOPSRCDIR)/configure |
---|
684 | endif |
---|
685 | |
---|
686 | $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS) |
---|
687 | @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi |
---|
688 | @echo cd $(OBJDIR); |
---|
689 | @echo $(CONFIGURE) $(CONFIGURE_ARGS) |
---|
690 | @cd $(OBJDIR) && $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \ |
---|
691 | || ( echo "*** Fix above errors and then restart with\ |
---|
692 | \"$(MAKE) -f client.mk build\"" && exit 1 ) |
---|
693 | @touch $(OBJDIR)/Makefile |
---|
694 | |
---|
695 | ifdef CONFIG_STATUS |
---|
696 | $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in |
---|
697 | cd $(OBJDIR); \ |
---|
698 | CONFIG_FILES=config/autoconf.mk ./config.status |
---|
699 | endif |
---|
700 | |
---|
701 | |
---|
702 | #################################### |
---|
703 | # Depend |
---|
704 | |
---|
705 | depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status |
---|
706 | $(MOZ_MAKE) export && $(MOZ_MAKE) depend |
---|
707 | |
---|
708 | #################################### |
---|
709 | # Build it |
---|
710 | |
---|
711 | build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status |
---|
712 | $(MOZ_MAKE) |
---|
713 | |
---|
714 | #################################### |
---|
715 | # Other targets |
---|
716 | |
---|
717 | # Pass these target onto the real build system |
---|
718 | install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status |
---|
719 | $(MOZ_MAKE) $@ |
---|
720 | |
---|
721 | cleansrcdir: |
---|
722 | @cd $(TOPSRCDIR); \ |
---|
723 | if [ -f webshell/embed/gtk/Makefile ]; then \ |
---|
724 | $(MAKE) -C webshell/embed/gtk distclean; \ |
---|
725 | fi; \ |
---|
726 | if [ -f Makefile ]; then \ |
---|
727 | $(MAKE) distclean ; \ |
---|
728 | else \ |
---|
729 | echo "Removing object files from srcdir..."; \ |
---|
730 | rm -fr `find . -type d \( -name .deps -print -o -name CVS \ |
---|
731 | -o -exec test ! -d {}/CVS \; \) -prune \ |
---|
732 | -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \ |
---|
733 | build/autoconf/clean-config.sh; \ |
---|
734 | fi; |
---|
735 | |
---|
736 | # (! IS_FIRST_CHECKOUT) |
---|
737 | endif |
---|
738 | |
---|
739 | echo_objdir: |
---|
740 | @echo $(OBJDIR) |
---|
741 | |
---|
742 | .PHONY: checkout real_checkout depend build export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything |
---|