source: trunk/third/firefox/client.mk @ 22304

Revision 22304, 25.1 KB checked in by rbasch, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r22303, which included commits to RCS files with non-trunk default branches.
Line 
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#   MOZ_CO_LOCALES       - localizations to pull (MOZ_CO_LOCALES="de-DE pt-BR")
49#   LOCALES_CVSROOT      - CVSROOT to use to pull localizations
50#
51
52#######################################################################
53# Checkout Tags
54#
55# For branches, uncomment the MOZ_CO_TAG line with the proper tag,
56# and commit this file on that tag.
57MOZ_CO_TAG = FIREFOX_1_0_7_RELEASE
58NSPR_CO_TAG = FIREFOX_1_0_7_RELEASE
59PSM_CO_TAG = FIREFOX_1_0_7_RELEASE
60NSS_CO_TAG = FIREFOX_1_0_7_RELEASE
61LDAPCSDK_CO_TAG = FIREFOX_1_0_7_RELEASE
62ACCESSIBLE_CO_TAG = FIREFOX_1_0_7_RELEASE
63IMGLIB2_CO_TAG = FIREFOX_1_0_7_RELEASE
64IPC_CO_TAG = FIREFOX_1_0_7_RELEASE
65TOOLKIT_CO_TAG = FIREFOX_1_0_7_RELEASE
66BROWSER_CO_TAG = FIREFOX_1_0_7_RELEASE
67MAIL_CO_TAG = FIREFOX_1_0_7_RELEASE
68STANDALONE_COMPOSER_CO_TAG = FIREFOX_1_0_7_RELEASE
69LOCALES_CO_TAG = FIREFOX_1_0_7_RELEASE
70BUILD_MODULES = all
71
72#######################################################################
73# Defines
74#
75CVS = cvs
76
77CWD := $(shell pwd)
78
79ifeq "$(CWD)" "/"
80CWD   := /.
81endif
82
83ifneq (, $(wildcard client.mk))
84# Ran from mozilla directory
85ROOTDIR   := $(shell dirname $(CWD))
86TOPSRCDIR := $(CWD)
87else
88# Ran from mozilla/.. directory (?)
89ROOTDIR   := $(CWD)
90TOPSRCDIR := $(CWD)/mozilla
91endif
92
93# on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
94#  work;  replace first instance with one forward slash
95TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
96
97ifndef TOPSRCDIR_MOZ
98TOPSRCDIR_MOZ=$(TOPSRCDIR)
99endif
100
101# if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
102DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
103ifeq ($(DIRNAME),)
104ROOTDIR := /.
105endif
106
107AUTOCONF := autoconf
108MKDIR := mkdir
109SH := /bin/sh
110ifndef MAKE
111MAKE := gmake
112endif
113
114CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
115ifdef CONFIG_GUESS_SCRIPT
116  CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
117else
118  _IS_FIRST_CHECKOUT := 1
119endif
120
121####################################
122# CVS
123
124# Add the CVS root to CVS_FLAGS if needed
125CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
126ifneq ($(CVS_ROOT_IN_TREE),)
127ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
128  CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
129endif
130endif
131
132CVSCO = $(strip $(CVS) $(CVS_FLAGS) co $(CVS_CO_FLAGS))
133CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
134CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
135
136ifdef MOZ_CO_TAG
137  CVS_CO_FLAGS := -r $(MOZ_CO_TAG)
138endif
139
140# if LOCALES_CVSROOT is not specified, set it here
141# (and let mozconfig override it)
142LOCALES_CVSROOT ?= :pserver:anonymous@cvs-mirror.mozilla.org:/l10n
143
144####################################
145# Load mozconfig Options
146
147# See build pages, http://www.mozilla.org/build/unix.html,
148# for how to set up mozconfig.
149MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
150MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
151MOZCONFIG_MODULES := mozilla/build/unix/modules.mk mozilla/build/unix/uniq.pl
152run_for_side_effects := \
153  $(shell cd $(ROOTDIR); \
154     if test "$(_IS_FIRST_CHECKOUT)"; then \
155        $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
156     else true; \
157     fi; \
158     $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
159include $(TOPSRCDIR)/.mozconfig.mk
160include $(TOPSRCDIR)/build/unix/modules.mk
161
162####################################
163# Options that may come from mozconfig
164
165# Change CVS flags if anonymous root is requested
166ifdef MOZ_CO_USE_MIRROR
167  CVS_FLAGS := -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
168endif
169
170# MOZ_CVS_FLAGS - Basic CVS flags
171ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
172  CVS_FLAGS := $(CVS_FLAGS) -q -z 3
173else
174  CVS_FLAGS := $(MOZ_CVS_FLAGS)
175endif
176
177# This option is deprecated. The best way to have client.mk pull a tag
178# is to set MOZ_CO_TAG (see above) and commit that change on the tag.
179ifdef MOZ_CO_BRANCH
180  $(warning Use MOZ_CO_TAG instead of MOZ_CO_BRANCH)
181  CVS_CO_FLAGS := -r $(MOZ_CO_BRANCH)
182endif
183
184# MOZ_CO_FLAGS - Anything that we should use on all checkouts
185ifeq "$(origin MOZ_CO_FLAGS)" "undefined"
186  CVS_CO_FLAGS := $(CVS_CO_FLAGS) -P
187else
188  CVS_CO_FLAGS := $(CVS_CO_FLAGS) $(MOZ_CO_FLAGS)
189endif
190
191ifdef MOZ_CO_DATE
192  CVS_CO_DATE_FLAGS := -D "$(MOZ_CO_DATE)"
193endif
194
195ifdef MOZ_OBJDIR
196  OBJDIR := $(MOZ_OBJDIR)
197  MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
198else
199  OBJDIR := $(TOPSRCDIR)
200  MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
201endif
202
203####################################
204# CVS defines for PSM
205#
206PSM_CO_MODULE= mozilla/security/manager
207PSM_CO_FLAGS := -P -A
208ifdef MOZ_CO_FLAGS
209  PSM_CO_FLAGS := $(MOZ_CO_FLAGS)
210endif
211ifdef PSM_CO_TAG
212  PSM_CO_FLAGS := $(PSM_CO_FLAGS) -r $(PSM_CO_TAG)
213endif
214CVSCO_PSM = $(CVS) $(CVS_FLAGS) co $(PSM_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(PSM_CO_MODULE)
215
216####################################
217# CVS defines for NSS
218#
219NSS_CO_MODULE = mozilla/security/nss \
220                mozilla/security/coreconf \
221                $(NULL)
222
223NSS_CO_FLAGS := -P
224ifdef MOZ_CO_FLAGS
225  NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
226endif
227ifdef NSS_CO_TAG
228   NSS_CO_FLAGS := $(NSS_CO_FLAGS) -r $(NSS_CO_TAG)
229endif
230# Cannot pull static tags by date
231ifeq ($(NSS_CO_TAG),NSS_CLIENT_TAG)
232CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
233else
234CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
235endif
236
237####################################
238# CVS defines for NSPR
239#
240NSPR_CO_MODULE = mozilla/nsprpub
241NSPR_CO_FLAGS := -P
242ifdef MOZ_CO_FLAGS
243  NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
244endif
245ifdef NSPR_CO_TAG
246  NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) -r $(NSPR_CO_TAG)
247endif
248# Cannot pull static tags by date
249ifeq ($(NSPR_CO_TAG),NSPRPUB_CLIENT_TAG)
250CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
251else
252CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
253endif
254
255####################################
256# CVS defines for the C LDAP SDK
257#
258LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
259LDAPCSDK_CO_FLAGS := -P
260ifdef MOZ_CO_FLAGS
261  LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
262endif
263ifdef LDAPCSDK_CO_TAG
264  LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) -r $(LDAPCSDK_CO_TAG)
265endif
266CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
267
268####################################
269# CVS defines for the C LDAP SDK
270#
271ACCESSIBLE_CO_MODULE = mozilla/accessible
272ACCESSIBLE_CO_FLAGS := -P
273ifdef MOZ_CO_FLAGS
274  ACCESSIBLE_CO_FLAGS := $(MOZ_CO_FLAGS)
275endif
276ifdef ACCESSIBLE_CO_TAG
277  ACCESSIBLE_CO_FLAGS := $(ACCESSIBLE_CO_FLAGS) -r $(ACCESSIBLE_CO_TAG)
278endif
279CVSCO_ACCESSIBLE = $(CVS) $(CVS_FLAGS) co $(ACCESSIBLE_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(ACCESSIBLE_CO_MODULE)
280
281
282####################################
283# CVS defines for new image library
284#
285IMGLIB2_CO_MODULE = mozilla/modules/libpr0n
286IMGLIB2_CO_FLAGS := -P
287ifdef MOZ_CO_FLAGS
288  IMGLIB2_CO_FLAGS := $(MOZ_CO_FLAGS)
289endif
290ifdef IMGLIB2_CO_TAG
291  IMGLIB2_CO_FLAGS := $(IMGLIB2_CO_FLAGS) -r $(IMGLIB2_CO_TAG)
292endif
293CVSCO_IMGLIB2 = $(CVS) $(CVS_FLAGS) co $(IMGLIB2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IMGLIB2_CO_MODULE)
294
295####################################
296# CVS defines for ipc module
297#
298IPC_CO_MODULE = mozilla/ipc/ipcd
299IPC_CO_FLAGS := -P -A
300ifdef MOZ_CO_FLAGS
301  IPC_CO_FLAGS := $(MOZ_CO_FLAGS)
302endif
303ifdef IPC_CO_TAG
304  IPC_CO_FLAGS := $(IPC_CO_FLAGS) -r $(IPC_CO_TAG)
305endif
306CVSCO_IPC = $(CVS) $(CVS_FLAGS) co $(IPC_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IPC_CO_MODULE)
307
308####################################
309# CVS defines for Calendar
310#
311CVSCO_CALENDAR := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/calendar mozilla/other-licenses/libical
312
313####################################
314# CVS defines for SeaMonkey
315#
316ifeq ($(MOZ_CO_MODULE),)
317  MOZ_CO_MODULE := SeaMonkeyAll
318endif
319CVSCO_SEAMONKEY := $(CVSCO) $(CVS_CO_DATE_FLAGS) $(MOZ_CO_MODULE)
320
321####################################
322# CVS defines for standalone modules
323#
324ifeq ($(BUILD_MODULES),all)
325  CHECKOUT_STANDALONE := true
326  CHECKOUT_STANDALONE_NOSUBDIRS := true
327else
328  STANDALONE_CO_MODULE := $(filter-out $(NSPRPUB_DIR) security directory/c-sdk, $(BUILD_MODULE_CVS))
329  STANDALONE_CO_MODULE += allmakefiles.sh client.mk aclocal.m4 configure configure.in
330  STANDALONE_CO_MODULE += Makefile.in
331  STANDALONE_CO_MODULE := $(addprefix mozilla/, $(STANDALONE_CO_MODULE))
332  CHECKOUT_STANDALONE := cvs_co $(CVSCO) $(CVS_CO_DATE_FLAGS) $(STANDALONE_CO_MODULE)
333
334  NOSUBDIRS_MODULE := $(addprefix mozilla/, $(BUILD_MODULE_CVS_NS))
335ifneq ($(NOSUBDIRS_MODULE),)
336  CHECKOUT_STANDALONE_NOSUBDIRS := cvs_co $(CVSCO) -l $(CVS_CO_DATE_FLAGS) $(NOSUBDIRS_MODULE)
337else
338  CHECKOUT_STANDALONE_NOSUBDIRS := true
339endif
340
341CVSCO_SEAMONKEY :=
342ifeq (,$(filter $(NSPRPUB_DIR), $(BUILD_MODULE_CVS)))
343  CVSCO_NSPR :=
344endif
345ifeq (,$(filter security security/manager, $(BUILD_MODULE_CVS)))
346  CVSCO_PSM :=
347  CVSCO_NSS :=
348endif
349ifeq (,$(filter directory/c-sdk, $(BUILD_MODULE_CVS)))
350  CVSCO_LDAPCSDK :=
351endif
352ifeq (,$(filter accessible, $(BUILD_MODULE_CVS)))
353  CVSCO_ACCESSIBLE :=
354endif
355ifeq (,$(filter modules/libpr0n, $(BUILD_MODULE_CVS)))
356  CVSCO_IMGLIB2 :=
357endif
358ifeq (,$(filter ipc, $(BUILD_MODULE_CVS)))
359  CVSCO_IPC :=
360endif
361ifeq (,$(filter calendar other-licenses/libical, $(BUILD_MODULE_CVS)))
362  CVSCO_CALENDAR :=
363endif
364endif
365
366####################################
367# CVS defined for libart (pulled and built if MOZ_INTERNAL_LIBART_LGPL is set)
368#
369CVSCO_LIBART := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/other-licenses/libart_lgpl
370
371ifdef MOZ_INTERNAL_LIBART_LGPL
372FASTUPDATE_LIBART := fast_update $(CVSCO_LIBART)
373CHECKOUT_LIBART := cvs_co $(CVSCO_LIBART)
374else
375CHECKOUT_LIBART := true
376FASTUPDATE_LIBART := true
377endif
378
379####################################
380# CVS defines for Phoenix (pulled and built if MOZ_PHOENIX is set)
381#
382BROWSER_CO_FLAGS := -P
383ifdef MOZ_CO_FLAGS
384  BROWSER_CO_FLAGS := $(MOZ_CO_FLAGS)
385endif
386ifdef BROWSER_CO_TAG
387  BROWSER_CO_FLAGS := $(BROWSER_CO_FLAGS) -r $(BROWSER_CO_TAG)
388endif
389
390BROWSER_CO_DIRS := mozilla/browser mozilla/other-licenses/branding/firefox mozilla/other-licenses/7zstub/firefox
391
392CVSCO_PHOENIX := $(CVS) $(CVS_FLAGS) co $(BROWSER_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(BROWSER_CO_DIRS)
393
394ifdef MOZ_PHOENIX
395FASTUPDATE_PHOENIX := fast_update $(CVSCO_PHOENIX)
396CHECKOUT_PHOENIX := cvs_co $(CVSCO_PHOENIX)
397MOZ_XUL_APP = 1
398LOCALE_DIRS += mozilla/browser/locales
399else
400CHECKOUT_PHOENIX := true
401FASTUPDATE_PHOENIX := true
402endif
403
404####################################
405# CVS defines for Thunderbird (pulled and built if MOZ_THUNDERBIRD is set)
406#
407
408MAIL_CO_FLAGS := -P
409ifdef MOZ_CO_FLAGS
410  MAIL_CO_FLAGS := $(MOZ_CO_FLAGS)
411endif
412ifdef MAIL_CO_TAG
413  MAIL_CO_FLAGS := $(MAIL_CO_FLAGS) -r $(MAIL_CO_TAG)
414endif
415
416MAIL_CO_DIRS := mozilla/mail mozilla/other-licenses/branding/thunderbird mozilla/other-licenses/7zstub/thunderbird
417
418CVSCO_THUNDERBIRD := $(CVS) $(CVS_FLAGS) co $(MAIL_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MAIL_CO_DIRS)
419ifdef MOZ_THUNDERBIRD
420FASTUPDATE_THUNDERBIRD := fast_update $(CVSCO_THUNDERBIRD)
421CHECKOUT_THUNDERBIRD := cvs_co $(CVSCO_THUNDERBIRD)
422MOZ_XUL_APP = 1
423LOCALE_DIRS += mozilla/mail/locales
424else
425FASTUPDATE_THUNDERBIRD := true
426CHECKOUT_THUNDERBIRD := true
427endif
428
429####################################
430# CVS defines for Standalone Composer (pulled and built if MOZ_STANDALONE_COMPOSER is set)
431#
432
433STANDALONE_COMPOSER_CO_FLAGS := -P
434ifdef MOZ_CO_FLAGS
435  STANDALONE_COMPOSER_CO_FLAGS := $(MOZ_CO_FLAGS)
436endif
437ifdef STANDALONE_COMPOSER_CO_TAG
438  STANDALONE_COMPOSER_CO_FLAGS := $(STANDALONE_COMPOSER_CO_FLAGS) -r $(STANDALONE_COMPOSER_CO_TAG)
439endif
440
441CVSCO_STANDALONE_COMPOSER := $(CVS) $(CVS_FLAGS) co $(STANDALONE_COMPOSER_CO_FLAGS) $(CVS_CO_DATE_FLAGS) mozilla/composer
442ifdef MOZ_STANDALONE_COMPOSER
443FASTUPDATE_STANDALONE_COMPOSER:= fast_update $(CVSCO_STANDALONE_COMPOSER)
444CHECKOUT_STANDALONE_COMPOSER:= cvs_co $(CVSCO_STANDALONE_COMPOSER)
445MOZ_XUL_APP = 1
446LOCALE_DIRS += mozilla/composer/locales
447else
448FASTUPDATE_STANDALONE_COMPOSER:= true
449CHECKOUT_STANDALONE_COMPOSER:= true
450endif
451
452####################################
453# CVS defines for mozilla/toolkit
454#
455
456TOOLKIT_CO_FLAGS := -P
457ifdef MOZ_CO_FLAGS
458  TOOLKIT_CO_FLAGS := $(MOZ_CO_FLAGS)
459endif
460ifdef TOOLKIT_CO_TAG
461  TOOLKIT_CO_FLAGS := $(TOOLKIT_CO_FLAGS) -r $(TOOLKIT_CO_TAG)
462endif
463
464CVSCO_MOZTOOLKIT := $(CVS) $(CVS_FLAGS) co $(TOOLKIT_CO_FLAGS) $(CVS_CO_DATE_FLAGS)  mozilla/toolkit mozilla/chrome
465FASTUPDATE_MOZTOOLKIT := fast_update $(CVSCO_MOZTOOLKIT)
466CHECKOUT_MOZTOOLKIT := cvs_co $(CVSCO_MOZTOOLKIT)
467LOCALE_DIRS += mozilla/toolkit/locales
468
469####################################
470# CVS defines for codesighs (pulled and built if MOZ_MAPINFO is set)
471#
472CVSCO_CODESIGHS := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/tools/codesighs
473
474ifdef MOZ_MAPINFO
475FASTUPDATE_CODESIGHS := fast_update $(CVSCO_CODESIGHS)
476CHECKOUT_CODESIGHS := cvs_co $(CVSCO_CODESIGHS)
477else
478CHECKOUT_CODESIGHS := true
479FASTUPDATE_CODESIGHS := true
480endif
481
482###################################
483# CVS defines for locales
484#
485LOCALES_CO_FLAGS := -P
486
487ifdef LOCALES_CO_TAG
488  LOCALES_CO_FLAGS := $(LOCALES_CO_FLAGS) -r $(LOCALES_CO_TAG)
489endif
490
491ifndef MOZ_CO_LOCALES
492LOCK_LOCALES := true
493FASTUPDATE_LOCALES := true
494CHECKOUT_LOCALES := true
495UNLOCK_LOCALES := true
496else
497ifeq (all,$(MOZ_CO_LOCALES))
498MOZCONFIG_MODULES += $(addsuffix /all-locales,$(LOCALE_DIRS))
499
500LOCK_LOCALES := \
501  for dir in $(LOCALE_DIRS); do \
502    for locale in `cat $$dir/all-locales`; do \
503      mv $$dir/$$locale $$dir/$$locale-tmp || true; \
504    done; \
505  done
506
507FASTUPDATE_LOCALES := \
508  for dir in $(LOCALE_DIRS); do \
509    for locale in `cat $$dir/all-locales`; do \
510      fast_update $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(CVS_CO_DATE_FLAGS) $$dir/$$locale; \
511    done; \
512  done
513
514CHECKOUT_LOCALES := \
515  for dir in $(LOCALE_DIRS); do \
516    for locale in `cat $$dir/all-locales`; do \
517      cvs_co $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $$dir/$$locale; \
518    done; \
519  done
520
521UNLOCK_LOCALES := \
522  for dir in $(LOCALE_DIRS); do \
523    for locale in `cat $$dir/all-locales`; do \
524      mv $$dir/$$locale-tmp $$dir/$$locale || true; \
525    done; \
526  done
527else
528LOCALE_CO_DIRS = $(foreach locale,$(MOZ_CO_LOCALES),$(addsuffix /$(locale),$(LOCALE_DIRS)))
529
530CVSCO_LOCALES := $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LOCALE_CO_DIRS)
531
532LOCK_LOCALES := for dir in $(LOCALE_CO_DIRS); do mv $$dir $$dir-tmp || true; done
533FASTUPDATE_LOCALES := fast_update $(CVSCO_LOCALES)
534CHECKOUT_LOCALES := cvs_co $(CVSCO_LOCALES)
535UNLOCK_LOCALES := for dir in $(LOCALE_CO_DIRS); do mv $$dir-tmp $$dir || true; done
536endif
537endif #MOZ_CO_LOCALES
538
539#######################################################################
540# Rules
541#
542
543# Print out any options loaded from mozconfig.
544all build checkout clean depend distclean export libs install realclean::
545        @if test -f .mozconfig.out; then \
546          cat .mozconfig.out; \
547          rm -f .mozconfig.out; \
548        else true; \
549        fi
550
551ifdef _IS_FIRST_CHECKOUT
552all:: checkout build
553else
554all:: checkout alldep
555endif
556
557# Windows equivalents
558pull_all: checkout
559build_all: build
560build_all_dep: alldep
561build_all_depend: alldep
562clobber clobber_all: clean
563pull_and_build_all: checkout alldep
564
565# Do everything from scratch
566everything: checkout clean build
567
568####################################
569# CVS checkout
570#
571checkout::
572#       @: Backup the last checkout log.
573        @if test -f $(CVSCO_LOGFILE) ; then \
574          mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
575        else true; \
576        fi
577ifdef RUN_AUTOCONF_LOCALLY
578        @echo "Removing local configures" ; \
579        cd $(ROOTDIR) && \
580        $(RM) -f mozilla/configure mozilla/nsprpub/configure \
581                mozilla/directory/c-sdk/configure
582endif
583        @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
584        @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
585        cd $(ROOTDIR) && \
586        $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
587        @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
588
589#       Start the checkout. Split the output to the tty and a log file.
590
591real_checkout:
592        @set -e; \
593        cvs_co() { set -e; echo "$$@" ; \
594          "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
595        $(LOCK_LOCALES); \
596        $(CHECKOUT_STANDALONE); \
597        $(CHECKOUT_STANDALONE_NOSUBDIRS); \
598        cvs_co $(CVSCO_NSPR); \
599        cvs_co $(CVSCO_NSS); \
600        cvs_co $(CVSCO_PSM); \
601        cvs_co $(CVSCO_LDAPCSDK); \
602        cvs_co $(CVSCO_ACCESSIBLE); \
603        cvs_co $(CVSCO_IMGLIB2); \
604        cvs_co $(CVSCO_IPC); \
605        cvs_co $(CVSCO_CALENDAR); \
606        $(CHECKOUT_LIBART); \
607        $(CHECKOUT_MOZTOOLKIT); \
608        $(CHECKOUT_PHOENIX); \
609        $(CHECKOUT_THUNDERBIRD); \
610        $(CHECKOUT_STANDALONE_COMPOSER); \
611        $(CHECKOUT_CODESIGHS); \
612        $(UNLOCK_LOCALES); \
613        $(CHECKOUT_LOCALES); \
614        cvs_co $(CVSCO_SEAMONKEY);
615        @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
616# update the NSS checkout timestamp
617        @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
618                touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
619        fi
620#       @: Check the log for conflicts. ;
621        @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
622        if test "$$conflicts" ; then \
623          echo "$(MAKE): *** Conflicts during checkout." ;\
624          echo "$$conflicts" ;\
625          echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
626          false; \
627        else true; \
628        fi
629ifdef RUN_AUTOCONF_LOCALLY
630        @echo Generating configures using $(AUTOCONF) ; \
631        cd $(TOPSRCDIR) && $(AUTOCONF) && \
632        cd $(TOPSRCDIR)/nsprpub && $(AUTOCONF) && \
633        cd $(TOPSRCDIR)/directory/c-sdk && $(AUTOCONF)
634endif
635
636fast-update:
637#       @: Backup the last checkout log.
638        @if test -f $(CVSCO_LOGFILE) ; then \
639          mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
640        else true; \
641        fi
642ifdef RUN_AUTOCONF_LOCALLY
643        @echo "Removing local configures" ; \
644        cd $(ROOTDIR) && \
645        $(RM) -f mozilla/configure mozilla/nsprpub/configure \
646                mozilla/directory/c-sdk/configure
647endif
648        @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
649        @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
650        cd $(ROOTDIR) && \
651        $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
652        @cd $(TOPSRCDIR) && \
653        $(MAKE) -f client.mk real_fast-update
654
655# Start the update. Split the output to the tty and a log file.
656real_fast-update:
657        @set -e; \
658        fast_update() { set -e; config/cvsco-fast-update.pl $$@ 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
659        cvs_co() { set -e; echo "$$@" ; \
660          "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
661        fast_update $(CVSCO_NSPR); \
662        cd $(ROOTDIR); \
663        cvs_co $(CVSCO_NSS); \
664        $(LOCK_LOCALES); \
665        cd mozilla; \
666        fast_update $(CVSCO_PSM); \
667        fast_update $(CVSCO_LDAPCSDK); \
668        fast_update $(CVSCO_ACCESSIBLE); \
669        fast_update $(CVSCO_IMGLIB2); \
670        fast_update $(CVSCO_IPC); \
671        fast_update $(CVSCO_CALENDAR); \
672        $(FASTUPDATE_LIBART); \
673        $(FASTUPDATE_MOZTOOLKIT); \
674        $(FASTUPDATE_PHOENIX); \
675        $(FASTUPDATE_THUNDERBIRD); \
676        $(FASTUPDATE_STANDALONE_COMPOSER); \
677        $(FASTUPDATE_CODESIGHS); \
678        cd $(ROOTDIR); \
679        $(UNLOCK_LOCALES); \
680        cd mozilla; \
681        $(FASTUPDATE_LOCALES); \
682        fast_update $(CVSCO_SEAMONKEY);
683        @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
684# update the NSS checkout timestamp
685        @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
686                touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
687        fi
688#       @: Check the log for conflicts. ;
689        @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
690        if test "$$conflicts" ; then \
691          echo "$(MAKE): *** Conflicts during fast-update." ;\
692          echo "$$conflicts" ;\
693          echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
694          false; \
695        else true; \
696        fi
697ifdef RUN_AUTOCONF_LOCALLY
698        @echo Generating configures using $(AUTOCONF) ; \
699        cd $(TOPSRCDIR) && $(AUTOCONF) && \
700        cd $(TOPSRCDIR)/nsprpub && $(AUTOCONF) && \
701        cd $(TOPSRCDIR)/directory/c-sdk && $(AUTOCONF)
702endif
703
704####################################
705# Web configure
706
707WEBCONFIG_FILE  := $(HOME)/.mozconfig
708
709MOZCONFIG2CONFIGURATOR := build/autoconf/mozconfig2configurator
710webconfig:
711        @cd $(TOPSRCDIR); \
712        url=`$(MOZCONFIG2CONFIGURATOR) $(TOPSRCDIR)`; \
713        echo Running mozilla with the following url: ;\
714        echo ;\
715        echo $$url ;\
716        mozilla -remote "openURL($$url)" || \
717        netscape -remote "openURL($$url)" || \
718        mozilla $$url || \
719        netscape $$url ;\
720        echo ;\
721        echo   1. Fill out the form on the browser. ;\
722        echo   2. Save the results to $(WEBCONFIG_FILE)
723
724#####################################################
725# First Checkout
726
727ifdef _IS_FIRST_CHECKOUT
728# First time, do build target in a new process to pick up new files.
729build::
730        $(MAKE) -f $(TOPSRCDIR)/client.mk build
731else
732
733#####################################################
734# After First Checkout
735
736
737####################################
738# Configure
739
740CONFIG_STATUS := $(wildcard $(OBJDIR)/config.status)
741CONFIG_CACHE  := $(wildcard $(OBJDIR)/config.cache)
742
743ifdef RUN_AUTOCONF_LOCALLY
744EXTRA_CONFIG_DEPS := \
745        $(TOPSRCDIR)/aclocal.m4 \
746        $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
747        $(NULL)
748
749$(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
750        @echo Generating $@ using autoconf
751        cd $(TOPSRCDIR); $(AUTOCONF)
752endif
753
754CONFIG_STATUS_DEPS_L10N := $(wildcard $(TOPSRCDIR)/l10n/makefiles.all)
755
756CONFIG_STATUS_DEPS := \
757        $(TOPSRCDIR)/configure \
758        $(TOPSRCDIR)/allmakefiles.sh \
759        $(TOPSRCDIR)/.mozconfig.mk \
760        $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
761        $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
762        $(wildcard $(TOPSRCDIR)/mailnews/makefiles) \
763        $(CONFIG_STATUS_DEPS_L10N) \
764        $(wildcard $(TOPSRCDIR)/themes/makefiles) \
765        $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
766        $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
767        $(NULL)
768
769# configure uses the program name to determine @srcdir@. Calling it without
770#   $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
771#   path of $(TOPSRCDIR).
772ifeq ($(TOPSRCDIR),$(OBJDIR))
773  CONFIGURE := ./configure
774else
775  CONFIGURE := $(TOPSRCDIR)/configure
776endif
777
778ifdef MOZ_TOOLS
779  CONFIGURE := $(TOPSRCDIR)/configure
780endif
781
782$(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
783        @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
784        @echo cd $(OBJDIR);
785        @echo $(CONFIGURE) $(CONFIGURE_ARGS)
786        @cd $(OBJDIR) && $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
787          || ( echo "*** Fix above errors and then restart with\
788               \"$(MAKE) -f client.mk build\"" && exit 1 )
789        @touch $(OBJDIR)/Makefile
790
791ifdef CONFIG_STATUS
792$(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
793        cd $(OBJDIR); \
794          CONFIG_FILES=config/autoconf.mk ./config.status
795endif
796
797
798####################################
799# Depend
800
801depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
802        $(MOZ_MAKE) export && $(MOZ_MAKE) depend
803
804####################################
805# Build it
806
807configure:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
808
809####################################
810# Build it
811
812build::  $(OBJDIR)/Makefile $(OBJDIR)/config.status
813        $(MOZ_MAKE)
814
815####################################
816# Profile-feedback build (gcc only)
817#  To use this, you should set the following variables in your mozconfig
818#    mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
819#
820#  The profile script should exercise the functionality to be included
821#  in the profile feedback.
822
823profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
824        $(MOZ_MAKE) MOZ_PROFILE_GENERATE=1
825        OBJDIR=${OBJDIR} $(PROFILE_GEN_SCRIPT)
826        $(MOZ_MAKE) clobber_all
827        $(MOZ_MAKE) MOZ_PROFILE_USE=1
828        find $(OBJDIR) -name "*.da" -exec rm {} \;
829
830####################################
831# Other targets
832
833# Pass these target onto the real build system
834install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
835        $(MOZ_MAKE) $@
836
837cleansrcdir:
838        @cd $(TOPSRCDIR); \
839        if [ -f webshell/embed/gtk/Makefile ]; then \
840          $(MAKE) -C webshell/embed/gtk distclean; \
841        fi; \
842        if [ -f Makefile ]; then \
843          $(MAKE) distclean ; \
844        else \
845          echo "Removing object files from srcdir..."; \
846          rm -fr `find . -type d \( -name .deps -print -o -name CVS \
847                  -o -exec test ! -d {}/CVS \; \) -prune \
848                  -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
849           build/autoconf/clean-config.sh; \
850        fi;
851
852# (! IS_FIRST_CHECKOUT)
853endif
854
855echo_objdir:
856        @echo $(OBJDIR)
857
858.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
Note: See TracBrowser for help on using the repository browser.