source: trunk/third/mozilla/client.mk @ 20014

Revision 20014, 21.6 KB checked in by rbasch, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r20013, 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#
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.
55MOZ_CO_TAG = MOZILLA_1_5_RELEASE
56NSPR_CO_TAG = MOZILLA_1_5_RELEASE
57PSM_CO_TAG = MOZILLA_1_5_RELEASE
58NSS_CO_TAG = MOZILLA_1_5_RELEASE
59LDAPCSDK_CO_TAG = MOZILLA_1_5_RELEASE
60ACCESSIBLE_CO_TAG = MOZILLA_1_5_RELEASE
61IMGLIB2_CO_TAG = MOZILLA_1_5_RELEASE
62IPC_CO_TAG = MOZILLA_1_5_RELEASE
63TOOLKIT_CO_TAG = MOZILLA_1_5_RELEASE
64BROWSER_CO_TAG = MOZILLA_1_5_RELEASE
65MAIL_CO_TAG = MOZILLA_1_5_RELEASE
66BUILD_MODULES = all
67
68#######################################################################
69# Defines
70#
71CVS = cvs
72
73CWD := $(shell pwd)
74
75ifeq "$(CWD)" "/"
76CWD   := /.
77endif
78
79ifneq (, $(wildcard client.mk))
80# Ran from mozilla directory
81ROOTDIR   := $(shell dirname $(CWD))
82TOPSRCDIR := $(CWD)
83else
84# Ran from mozilla/.. directory (?)
85ROOTDIR   := $(CWD)
86TOPSRCDIR := $(CWD)/mozilla
87endif
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
91TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
92
93ifndef TOPSRCDIR_MOZ
94TOPSRCDIR_MOZ=$(TOPSRCDIR)
95endif
96
97# if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
98DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
99ifeq ($(DIRNAME),)
100ROOTDIR := /.
101endif
102
103AUTOCONF := autoconf
104MKDIR := mkdir
105SH := /bin/sh
106ifndef MAKE
107MAKE := gmake
108endif
109
110CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
111ifdef CONFIG_GUESS_SCRIPT
112  CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
113else
114  _IS_FIRST_CHECKOUT := 1
115endif
116
117####################################
118# CVS
119
120# Add the CVS root to CVS_FLAGS if needed
121CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
122ifneq ($(CVS_ROOT_IN_TREE),)
123ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
124  CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
125endif
126endif
127
128CVSCO = $(strip $(CVS) $(CVS_FLAGS) co $(CVS_CO_FLAGS))
129CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
130CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
131
132ifdef MOZ_CO_TAG
133  CVS_CO_FLAGS := -r $(MOZ_CO_TAG)
134endif
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.
141MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
142MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
143MOZCONFIG_MODULES := mozilla/build/unix/modules.mk mozilla/build/unix/uniq.pl
144run_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)
151include $(TOPSRCDIR)/.mozconfig.mk
152include $(TOPSRCDIR)/build/unix/modules.mk
153
154####################################
155# Options that may come from mozconfig
156
157# Change CVS flags if anonymous root is requested
158ifdef MOZ_CO_USE_MIRROR
159  CVS_FLAGS := -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
160endif
161
162# MOZ_CVS_FLAGS - Basic CVS flags
163ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
164  CVS_FLAGS := $(CVS_FLAGS) -q -z 3
165else
166  CVS_FLAGS := $(MOZ_CVS_FLAGS)
167endif
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.
171ifdef MOZ_CO_BRANCH
172  $(warning Use MOZ_CO_TAG instead of MOZ_CO_BRANCH)
173  CVS_CO_FLAGS := -r $(MOZ_CO_BRANCH)
174endif
175
176# MOZ_CO_FLAGS - Anything that we should use on all checkouts
177ifeq "$(origin MOZ_CO_FLAGS)" "undefined"
178  CVS_CO_FLAGS := $(CVS_CO_FLAGS) -P
179else
180  CVS_CO_FLAGS := $(CVS_CO_FLAGS) $(MOZ_CO_FLAGS)
181endif
182
183ifdef MOZ_CO_DATE
184  CVS_CO_DATE_FLAGS := -D "$(MOZ_CO_DATE)"
185endif
186
187ifdef MOZ_OBJDIR
188  OBJDIR := $(MOZ_OBJDIR)
189  MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
190else
191  OBJDIR := $(TOPSRCDIR)
192  MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
193endif
194
195####################################
196# CVS defines for PSM
197#
198PSM_CO_MODULE= mozilla/security/manager
199PSM_CO_FLAGS := -P -A
200ifdef MOZ_CO_FLAGS
201  PSM_CO_FLAGS := $(MOZ_CO_FLAGS)
202endif
203ifdef PSM_CO_TAG
204  PSM_CO_FLAGS := $(PSM_CO_FLAGS) -r $(PSM_CO_TAG)
205endif
206CVSCO_PSM = $(CVS) $(CVS_FLAGS) co $(PSM_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(PSM_CO_MODULE)
207
208####################################
209# CVS defines for NSS
210#
211NSS_CO_MODULE = mozilla/security/nss \
212                mozilla/security/coreconf \
213                $(NULL)
214
215NSS_CO_FLAGS := -P
216ifdef MOZ_CO_FLAGS
217  NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
218endif
219ifdef NSS_CO_TAG
220   NSS_CO_FLAGS := $(NSS_CO_FLAGS) -r $(NSS_CO_TAG)
221endif
222# Cannot pull static tags by date
223ifeq ($(NSS_CO_TAG),NSS_CLIENT_TAG)
224CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
225else
226CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
227endif
228
229####################################
230# CVS defines for NSPR
231#
232NSPR_CO_MODULE = mozilla/nsprpub
233NSPR_CO_FLAGS := -P
234ifdef MOZ_CO_FLAGS
235  NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
236endif
237ifdef NSPR_CO_TAG
238  NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) -r $(NSPR_CO_TAG)
239endif
240# Cannot pull static tags by date
241ifeq ($(NSPR_CO_TAG),NSPRPUB_CLIENT_TAG)
242CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
243else
244CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
245endif
246
247####################################
248# CVS defines for the C LDAP SDK
249#
250LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
251LDAPCSDK_CO_FLAGS := -P
252ifdef MOZ_CO_FLAGS
253  LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
254endif
255ifdef LDAPCSDK_CO_TAG
256  LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) -r $(LDAPCSDK_CO_TAG)
257endif
258CVSCO_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#
263ACCESSIBLE_CO_MODULE = mozilla/accessible
264ACCESSIBLE_CO_FLAGS := -P
265ifdef MOZ_CO_FLAGS
266  ACCESSIBLE_CO_FLAGS := $(MOZ_CO_FLAGS)
267endif
268ifdef ACCESSIBLE_CO_TAG
269  ACCESSIBLE_CO_FLAGS := $(ACCESSIBLE_CO_FLAGS) -r $(ACCESSIBLE_CO_TAG)
270endif
271CVSCO_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#
277IMGLIB2_CO_MODULE = mozilla/modules/libpr0n
278IMGLIB2_CO_FLAGS := -P
279ifdef MOZ_CO_FLAGS
280  IMGLIB2_CO_FLAGS := $(MOZ_CO_FLAGS)
281endif
282ifdef IMGLIB2_CO_TAG
283  IMGLIB2_CO_FLAGS := $(IMGLIB2_CO_FLAGS) -r $(IMGLIB2_CO_TAG)
284endif
285CVSCO_IMGLIB2 = $(CVS) $(CVS_FLAGS) co $(IMGLIB2_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IMGLIB2_CO_MODULE)
286
287####################################
288# CVS defines for ipc module
289#
290IPC_CO_MODULE = mozilla/ipc/ipcd
291IPC_CO_FLAGS := -P
292ifdef MOZ_CO_FLAGS
293  IPC_CO_FLAGS := $(MOZ_CO_FLAGS)
294endif
295ifdef IPC_CO_TAG
296  IPC_CO_FLAGS := $(IPC_CO_FLAGS) -r $(IPC_CO_TAG)
297endif
298CVSCO_IPC = $(CVS) $(CVS_FLAGS) co $(IPC_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(IPC_CO_MODULE)
299
300####################################
301# CVS defines for Calendar
302#
303CVSCO_CALENDAR := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/calendar mozilla/other-licenses/libical
304
305####################################
306# CVS defines for SeaMonkey
307#
308ifeq ($(MOZ_CO_MODULE),)
309  MOZ_CO_MODULE := SeaMonkeyAll
310endif
311CVSCO_SEAMONKEY := $(CVSCO) $(CVS_CO_DATE_FLAGS) $(MOZ_CO_MODULE)
312
313####################################
314# CVS defines for standalone modules
315#
316ifeq ($(BUILD_MODULES),all)
317  CHECKOUT_STANDALONE := true
318  CHECKOUT_STANDALONE_NOSUBDIRS := true
319else
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))
327ifneq ($(NOSUBDIRS_MODULE),)
328  CHECKOUT_STANDALONE_NOSUBDIRS := cvs_co $(CVSCO) -l $(CVS_CO_DATE_FLAGS) $(NOSUBDIRS_MODULE)
329else
330  CHECKOUT_STANDALONE_NOSUBDIRS := true
331endif
332
333CVSCO_SEAMONKEY :=
334ifeq (,$(filter $(NSPRPUB_DIR), $(BUILD_MODULE_CVS)))
335  CVSCO_NSPR :=
336endif
337ifeq (,$(filter security security/manager, $(BUILD_MODULE_CVS)))
338  CVSCO_PSM :=
339  CVSCO_NSS :=
340endif
341ifeq (,$(filter directory/c-sdk, $(BUILD_MODULE_CVS)))
342  CVSCO_LDAPCSDK :=
343endif
344ifeq (,$(filter accessible, $(BUILD_MODULE_CVS)))
345  CVSCO_ACCESSIBLE :=
346endif
347ifeq (,$(filter modules/libpr0n, $(BUILD_MODULE_CVS)))
348  CVSCO_IMGLIB2 :=
349endif
350ifeq (,$(filter ipc, $(BUILD_MODULE_CVS)))
351  CVSCO_IPC :=
352endif
353ifeq (,$(filter calendar other-licenses/libical, $(BUILD_MODULE_CVS)))
354  CVSCO_CALENDAR :=
355endif
356endif
357
358####################################
359# CVS defined for libart (pulled and built if MOZ_INTERNAL_LIBART_LGPL is set)
360#
361CVSCO_LIBART := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/other-licenses/libart_lgpl
362
363ifdef MOZ_INTERNAL_LIBART_LGPL
364FASTUPDATE_LIBART := fast_update $(CVSCO_LIBART)
365CHECKOUT_LIBART := cvs_co $(CVSCO_LIBART)
366else
367CHECKOUT_LIBART := true
368FASTUPDATE_LIBART := true
369endif
370
371####################################
372# CVS defines for Phoenix (pulled and built if MOZ_PHOENIX is set)
373#
374BROWSER_CO_FLAGS := -P
375ifdef MOZ_CO_FLAGS
376  BROWSER_CO_FLAGS := $(MOZ_CO_FLAGS)
377endif
378ifdef BROWSER_CO_TAG
379  BROWSER_CO_FLAGS := $(BROWSER_CO_FLAGS) -r $(BROWSER_CO_TAG)
380endif
381
382CVSCO_PHOENIX := $(CVS) $(CVS_FLAGS) co $(BROWSER_CO_FLAGS) $(CVS_CO_DATE_FLAGS) mozilla/browser
383
384ifdef MOZ_PHOENIX
385FASTUPDATE_PHOENIX := fast_update $(CVSCO_PHOENIX)
386CHECKOUT_PHOENIX := cvs_co $(CVSCO_PHOENIX)
387MOZ_XUL_APP = 1
388else
389CHECKOUT_PHOENIX := true
390FASTUPDATE_PHOENIX := true
391endif
392
393####################################
394# CVS defines for Thunderbird (pulled and built if MOZ_THUNDERBIRD is set)
395#
396
397MAIL_CO_FLAGS := -P
398ifdef MOZ_CO_FLAGS
399  MAIL_CO_FLAGS := $(MOZ_CO_FLAGS)
400endif
401ifdef MAIL_CO_TAG
402  MAIL_CO_FLAGS := $(MAIL_CO_FLAGS) -r $(MAIL_CO_TAG)
403endif
404
405CVSCO_THUNDERBIRD := $(CVS) $(CVS_FLAGS) co $(MAIL_CO_FLAGS) $(CVS_CO_DATE_FLAGS) mozilla/mail
406ifdef MOZ_THUNDERBIRD
407FASTUPDATE_THUNDERBIRD := fast_update $(CVSCO_THUNDERBIRD)
408CHECKOUT_THUNDERBIRD := cvs_co $(CVSCO_THUNDERBIRD)
409MOZ_XUL_APP = 1
410else
411FASTUPDATE_THUNDERBIRD := true
412CHECKOUT_THUNDERBIRD := true
413endif
414
415####################################
416# CVS defines for mozilla/toolkit (pulled and built if MOZ_XUL_APP is set)
417#
418
419TOOLKIT_CO_FLAGS := -P
420ifdef MOZ_CO_FLAGS
421  TOOLKIT_CO_FLAGS := $(MOZ_CO_FLAGS)
422endif
423ifdef TOOLKIT_CO_TAG
424  TOOLKIT_CO_FLAGS := $(TOOLKIT_CO_FLAGS) -r $(TOOLKIT_CO_TAG)
425endif
426
427CVSCO_MOZTOOLKIT := $(CVS) $(CVS_FLAGS) co $(TOOLKIT_CO_FLAGS) $(CVS_CO_DATE_FLAGS)  mozilla/toolkit mozilla/chrome
428ifdef MOZ_XUL_APP
429FASTUPDATE_MOZTOOLKIT := fast_update $(CVSCO_MOZTOOLKIT)
430CHECKOUT_MOZTOOLKIT := cvs_co $(CVSCO_MOZTOOLKIT)
431else
432FASTUPDATE_MOZTOOLKIT := true
433CHECKOUT_MOZTOOLKIT := true
434endif
435
436####################################
437# CVS defines for codesighs (pulled and built if MOZ_MAPINFO is set)
438#
439CVSCO_CODESIGHS := $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/tools/codesighs
440
441ifdef MOZ_MAPINFO
442FASTUPDATE_CODESIGHS := fast_update $(CVSCO_CODESIGHS)
443CHECKOUT_CODESIGHS := cvs_co $(CVSCO_CODESIGHS)
444else
445CHECKOUT_CODESIGHS := true
446FASTUPDATE_CODESIGHS := true
447endif
448
449#######################################################################
450# Rules
451#
452
453# Print out any options loaded from mozconfig.
454all 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
461ifdef _IS_FIRST_CHECKOUT
462all:: checkout build
463else
464all:: checkout alldep
465endif
466
467# Windows equivalents
468pull_all: checkout
469build_all: build
470build_all_dep: alldep
471build_all_depend: alldep
472clobber clobber_all: clean
473pull_and_build_all: checkout alldep
474
475# Do everything from scratch
476everything: checkout clean build
477
478####################################
479# CVS checkout
480#
481checkout::
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
487ifdef 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
492endif
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
499real_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
536ifdef 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)
541endif
542
543fast-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
549ifdef 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
554endif
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
562real_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
603ifdef 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)
608endif
609
610####################################
611# Web configure
612
613WEBCONFIG_FILE  := $(HOME)/.mozconfig
614
615MOZCONFIG2CONFIGURATOR := build/autoconf/mozconfig2configurator
616webconfig:
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
633ifdef _IS_FIRST_CHECKOUT
634# First time, do build target in a new process to pick up new files.
635build::
636        $(MAKE) -f $(TOPSRCDIR)/client.mk build
637else
638
639#####################################################
640# After First Checkout
641
642
643####################################
644# Configure
645
646CONFIG_STATUS := $(wildcard $(OBJDIR)/config.status)
647CONFIG_CACHE  := $(wildcard $(OBJDIR)/config.cache)
648
649ifdef RUN_AUTOCONF_LOCALLY
650EXTRA_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)
658endif
659
660CONFIG_STATUS_DEPS_L10N := $(wildcard $(TOPSRCDIR)/l10n/makefiles.all)
661
662CONFIG_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).
676ifeq ($(TOPSRCDIR),$(OBJDIR))
677  CONFIGURE := ./configure
678else
679  CONFIGURE := $(TOPSRCDIR)/configure
680endif
681
682ifdef MOZ_TOOLS
683  CONFIGURE := $(TOPSRCDIR)/configure
684endif
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
695ifdef CONFIG_STATUS
696$(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
697        cd $(OBJDIR); \
698          CONFIG_FILES=config/autoconf.mk ./config.status
699endif
700
701
702####################################
703# Depend
704
705depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
706        $(MOZ_MAKE) export && $(MOZ_MAKE) depend
707
708####################################
709# Build it
710
711build::  $(OBJDIR)/Makefile $(OBJDIR)/config.status
712        $(MOZ_MAKE)
713
714####################################
715# Other targets
716
717# Pass these target onto the real build system
718install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
719        $(MOZ_MAKE) $@
720
721cleansrcdir:
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)
737endif
738
739echo_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
Note: See TracBrowser for help on using the repository browser.