1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
14 # The Original Code is mozilla.org code.
16 # The Initial Developer of the Original Code is
17 # Netscape Communications Corporation.
18 # Portions created by the Initial Developer are Copyright (C) 1998
19 # the Initial Developer. All Rights Reserved.
23 # Benjamin Smedberg <bsmedberg@covad.net>
24 # Chase Phillips <chase@mozilla.org>
25 # Mark Mentovai <mark@moxienet.com>
27 # Alternatively, the contents of this file may be used under the terms of
28 # either the GNU General Public License Version 2 or later (the "GPL"), or
29 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 # in which case the provisions of the GPL or the LGPL are applicable instead
31 # of those above. If you wish to allow use of your version of this file only
32 # under the terms of either the GPL or the LGPL, and not to allow others to
33 # use your version of this file under the terms of the MPL, indicate your
34 # decision by deleting the provisions above and replace them with the notice
35 # and other provisions required by the GPL or the LGPL. If you do not delete
36 # the provisions above, a recipient may use your version of this file under
37 # the terms of any one of the MPL, the GPL or the LGPL.
39 # ***** END LICENSE BLOCK *****
41 # Build a mozilla application.
43 # To checkout and build a tree,
44 # 1. cvs co mozilla/client.mk
46 # 3. create your .mozconfig file with
47 # mk_add_options MOZ_CO_PROJECT=
49 # 4. gmake -f client.mk
51 # This script will pick up the CVSROOT from the CVS/Root file. If you wish
52 # to use a different CVSROOT, you must set CVSROOT in your environment:
54 # export CVSROOT=:pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
55 # export CVSROOT=:pserver:username%somedomain.org@cvs.mozilla.org:/cvsroot
57 # You must specify which products/modules you wish to checkout, with
58 # MOZ_CO_PROJECT and MOZ_CO_MODULE variables.
60 # MOZ_CO_PROJECT possibilities include the following:
61 # suite (Seamonkey suite)
62 # browser (aka Firefox)
63 # mail (aka Thunderbird)
64 # minimo (small browser for devices)
65 # composer (standalone composer, aka NVU)
66 # calendar (aka Sunbird, use this to build the calendar extensions also)
71 # Other common MOZ_CO_MODULE options include the following:
72 # mozilla/other-licenses/libart_lgpl
73 # mozilla/other-licenses/bsdiff
74 # mozilla/tools/codesighs
76 # Other targets (gmake -f client.mk [targets...]),
79 # clean (realclean is now the same as clean)
82 # See http://developer.mozilla.org/en/docs/Build_Documentation for
86 # MOZ_BUILD_PROJECTS - Build multiple projects in subdirectories
88 # MOZ_OBJDIR - Destination object directory
89 # MOZ_CO_DATE - Date tag to use for checkout (default: none)
90 # MOZ_CO_LOCALES_DATE - Date tag to use for locale checkout
91 # (default: MOZ_CO_DATE)
92 # MOZ_CO_MODULE - Module to checkout
93 # MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3)
94 # MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P)
95 # MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
96 # MOZ_CO_LOCALES - localizations to pull (MOZ_CO_LOCALES="de-DE,pt-BR")
97 # MOZ_LOCALE_DIRS - directories which contain localizations
98 # LOCALES_CVSROOT - CVSROOT to use to pull localizations
99 # MOZ_PREFLIGHT_ALL } - Makefiles to run before any project in
100 # MOZ_PREFLIGHT } MOZ_BUILD_PROJECTS, before each project, after
101 # MOZ_POSTFLIGHT } each project, and after all projects; these
102 # MOZ_POSTFLIGHT_ALL } variables contain space-separated lists
103 # MOZ_UNIFY_BDATE - Set to use the same bdate for each project in
107 AVAILABLE_PROJECTS
= \
122 # Trailing / on top-level mozilla dir required to stop fast-update thinking
123 # it is a module name.
124 MODULES_NS_necko
:= \
133 mozilla
/modules
/libpref \
134 mozilla
/modules
/zlib \
137 mozilla
/tools
/test-harness \
141 $(MODULES_NS_necko
) \
163 mozilla
/js
/src
/fdlibm \
164 mozilla
/js
/src
/liveconnect \
165 mozilla
/js
/src
/xpconnect \
167 mozilla
/modules
/lcms \
168 mozilla
/modules
/libimg \
169 mozilla
/modules
/libjar \
170 mozilla
/modules
/libpr0n \
171 mozilla
/modules
/libreg \
172 mozilla
/modules
/libutil \
173 mozilla
/modules
/oji \
174 mozilla
/modules
/plugin \
175 mozilla
/modules
/staticmod \
180 mozilla
/security
/manager \
183 mozilla
/modules
/libpr0n \
184 mozilla
/modules
/libmar \
185 mozilla
/modules
/libbz2 \
187 mozilla
/other-licenses
/atk-1.0 \
188 mozilla
/other-licenses
/ia2 \
189 mozilla
/security
/manager \
190 mozilla
/tools
/elf-dynstr-gc \
200 mozilla
/db
/morkreader \
201 mozilla
/testing
/crashtest \
202 mozilla
/testing
/mochitest \
215 mozilla
/browser
/config
/version.txt \
216 mozilla
/mail
/config
/version.txt \
217 mozilla
/calendar
/sunbird
/config
/version.txt \
218 mozilla
/suite
/config
/version.txt \
225 MODULES_NS_toolkit
:= \
240 BOOTSTRAP_toolkit
:= \
244 MODULES_NS_suite
:= \
245 $(MODULES_NS_toolkit
) \
250 mozilla
/directory
/xpcom \
253 mozilla
/other-licenses
/7zstub
/seamonkey \
260 extensions
/reporter \
264 $(BOOTSTRAP_toolkit
) \
267 MODULES_NS_browser
:= \
268 $(MODULES_NS_toolkit
) \
274 mozilla
/other-licenses
/branding
/firefox \
275 mozilla
/other-licenses
/7zstub
/firefox \
281 extensions
/reporter \
282 extensions
/spellcheck \
283 other-licenses
/branding
/firefox \
286 BOOTSTRAP_browser
:= \
287 $(BOOTSTRAP_toolkit
) \
288 mozilla
/browser
/config
/mozconfig \
291 MODULES_NS_minimo
:= \
292 $(MODULES_NS_toolkit
) \
300 BOOTSTRAP_minimo
:= \
301 $(BOOTSTRAP_toolkit
) \
305 $(MODULES_NS_toolkit
) \
310 mozilla
/directory
/xpcom \
313 mozilla
/other-licenses
/branding
/thunderbird \
314 mozilla
/other-licenses
/7zstub
/thunderbird \
320 other-licenses
/branding
/thunderbird \
322 extensions
/spellcheck \
326 $(BOOTSTRAP_toolkit
) \
327 mozilla
/mail
/config
/mozconfig \
330 MODULES_composer
:= \
335 MODULES_NS_calendar
:= \
336 $(MODULES_NS_toolkit
) \
339 MODULES_calendar
:= \
344 mozilla
/other-licenses
/branding
/sunbird \
345 mozilla
/other-licenses
/7zstub
/sunbird \
348 LOCALES_calendar
:= \
351 other-licenses
/branding
/sunbird \
354 BOOTSTRAP_calendar
:= \
355 $(BOOTSTRAP_toolkit
) \
356 mozilla
/calendar
/sunbird
/config
/mozconfig \
359 MODULES_NS_xulrunner
:= \
360 $(MODULES_NS_toolkit
) \
363 MODULES_xulrunner
:= \
368 LOCALES_xulrunner
:= \
372 BOOTSTRAP_xulrunner
:= \
373 $(BOOTSTRAP_toolkit
) \
374 mozilla
/xulrunner
/config
/mozconfig \
377 MODULES_NS_camino
:= \
378 $(MODULES_NS_toolkit
) \
387 BOOTSTRAP_camino
:= \
388 $(BOOTSTRAP_toolkit
) \
389 mozilla
/camino
/config
/mozconfig \
394 mozilla
/modules
/zlib \
398 mozilla
/other-licenses
/bsdiff \
399 mozilla
/other-licenses
/libart_lgpl \
400 mozilla
/tools
/trace-malloc \
401 mozilla
/tools
/jprof \
402 mozilla
/tools
/codesighs \
403 mozilla
/tools
/update-packaging \
406 #######################################################################
409 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
410 # and commit this file on that tag.
412 NSPR_CO_TAG
= NSPR_HEAD_20071016
413 NSS_CO_TAG
= NSS_3_12_ALPHA_2B
414 LDAPCSDK_CO_TAG
= LDAPCSDK_6_0_3_CLIENT_BRANCH
417 #######################################################################
424 ifneq (1,$(words $(CWD
)))
425 $(error The mozilla directory cannot be located in a path with spaces.
)
432 ifneq (, $(wildcard client.mk
))
433 # Ran from mozilla directory
434 ROOTDIR
:= $(shell dirname
$(CWD
))
437 # Ran from mozilla/.. directory (?)
439 TOPSRCDIR
:= $(CWD
)/mozilla
442 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
443 # work; replace first instance with one forward slash
444 TOPSRCDIR
:= $(shell echo
"$(TOPSRCDIR)" | sed
-e
's%//%/%')
447 TOPSRCDIR_MOZ
=$(TOPSRCDIR
)
450 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
451 DIRNAME
:= $(shell echo
"$(ROOTDIR)" | sed
-e
's/^.://')
465 CONFIG_GUESS_SCRIPT
:= $(wildcard $(TOPSRCDIR
)/build
/autoconf
/config.guess
)
466 ifdef CONFIG_GUESS_SCRIPT
467 CONFIG_GUESS
= $(shell $(CONFIG_GUESS_SCRIPT
))
469 _IS_FIRST_CHECKOUT
:= 1
472 ####################################
475 ifneq (,$(filter MINGW
%,$(shell uname
-s
)))
476 # check for CRLF line endings
477 ifneq (0,$(shell $(PERL
) -e
'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR
)/client.mk
))
478 $(error This source tree appears to have Windows-style line endings. To \
479 convert it to Unix-style line endings
, run \
480 "python mozilla/build/win32/mozilla-dos2unix.py")
484 ####################################
487 # Add the CVS root to CVS_FLAGS if needed
488 CVS_ROOT_IN_TREE
:= $(shell cat
$(TOPSRCDIR
)/CVS
/Root
2>/dev
/null
)
489 ifneq ($(CVS_ROOT_IN_TREE
),)
490 ifneq ($(CVS_ROOT_IN_TREE
),$(CVSROOT
))
491 CVS_FLAGS
:= -d
$(CVS_ROOT_IN_TREE
)
495 CVS_CO_DATE_FLAGS
= $(if
$(MOZ_CO_DATE
),-D
"$(MOZ_CO_DATE)")
496 CVS_CO_LOCALES_DATE_FLAGS
= $(if
$(MOZ_CO_LOCALES_DATE
),-D
"$(MOZ_CO_LOCALES_DATE)")
497 CVSCO
= $(CVS
) $(CVS_FLAGS
) co $(MOZ_CO_FLAGS
) $(if
$(MOZ_CO_TAG
),-r
$(MOZ_CO_TAG
)) $(CVS_CO_DATE_FLAGS
)
499 MOZ_CO_LOCALES_DATE ?
= $(MOZ_CO_DATE
)
501 CVSCO_LOGFILE
:= $(ROOTDIR
)/cvsco.log
502 CVSCO_LOGFILE
:= $(shell echo
$(CVSCO_LOGFILE
) | sed s
%//%/%)
504 # if LOCALES_CVSROOT is not specified, set it here
505 # (and let mozconfig override it)
506 LOCALES_CVSROOT ?
= :pserver
:anonymous
:anonymous@cvs-mirror.mozilla.org
:/l10n
508 ####################################
509 # Load mozconfig Options
511 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
513 MOZCONFIG_LOADER
:= mozilla
/build
/autoconf
/mozconfig2client-mk
514 MOZCONFIG_FINDER
:= mozilla
/build
/autoconf
/mozconfig-find
515 MOZCONFIG_MODULES
:= mozilla
/build
/unix
/uniq.pl
516 run_for_side_effects
:= \
517 $(shell cd
$(ROOTDIR
); \
518 if
test "$(_IS_FIRST_CHECKOUT)"; then \
519 $(CVSCO
) $(MOZCONFIG_FINDER
) $(MOZCONFIG_LOADER
) $(MOZCONFIG_MODULES
); \
522 $(MOZCONFIG_LOADER
) $(TOPSRCDIR
) mozilla
/.mozconfig.mk
> mozilla
/.mozconfig.out
)
523 include $(TOPSRCDIR
)/.mozconfig.mk
525 ####################################
526 # Options that may come from mozconfig
528 MOZ_PROJECT_LIST
:= $(subst $(comma
), ,$(MOZ_CO_PROJECT
))
529 MOZ_PROJECT_LIST
:= $(subst macbrowser
,camino
,$(MOZ_PROJECT_LIST
))
531 ifneq (,$(filter-out $(AVAILABLE_PROJECTS
),$(MOZ_PROJECT_LIST
)))
532 $(error MOZ_CO_PROJECT contains an unrecognized project.
)
535 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST
)))
536 MOZ_PROJECT_LIST
:= $(AVAILABLE_PROJECTS
)
539 MOZ_MODULE_LIST
:= $(subst $(comma
), ,$(MOZ_CO_MODULE
)) $(foreach project
,$(MOZ_PROJECT_LIST
),$(MODULES_
$(project
)))
540 MOZ_MODULE_LIST_NS
:= $(foreach project
,$(MOZ_PROJECT_LIST
),$(MODULES_NS_
$(project
)))
541 LOCALE_DIRS
:= $(MOZ_LOCALE_DIRS
) $(foreach project
,$(MOZ_PROJECT_LIST
),$(LOCALES_
$(project
)))
543 MOZCONFIG_MODULES
+= $(foreach project
,$(MOZ_PROJECT_LIST
),$(BOOTSTRAP_
$(project
)))
545 # Using $(sort) here because it also removes duplicate entries.
546 MOZ_MODULE_LIST
:= $(sort $(MOZ_MODULE_LIST
))
547 LOCALE_DIRS
:= $(sort $(LOCALE_DIRS
))
548 MOZCONFIG_MODULES
:= $(sort $(MOZCONFIG_MODULES
))
550 # Change CVS flags if anonymous root is requested
551 ifdef MOZ_CO_USE_MIRROR
552 CVS_FLAGS
:= -d
:pserver
:anonymous
:anonymous@cvs-mirror.mozilla.org
:/cvsroot
555 # MOZ_CVS_FLAGS - Basic CVS flags
556 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
557 CVS_FLAGS
:= $(CVS_FLAGS
) -q
-z
3
559 CVS_FLAGS
:= $(MOZ_CVS_FLAGS
)
562 ifdef MOZ_BUILD_PROJECTS
565 $(error When MOZ_BUILD_PROJECTS is set
, you must set MOZ_OBJDIR
)
567 ifdef MOZ_CURRENT_PROJECT
568 OBJDIR
= $(MOZ_OBJDIR
)/$(MOZ_CURRENT_PROJECT
)
569 MOZ_MAKE
= $(MAKE
) $(MOZ_MAKE_FLAGS
) -C
$(OBJDIR
)
570 BUILD_PROJECT_ARG
= MOZ_BUILD_APP
=$(MOZ_CURRENT_PROJECT
)
572 OBJDIR
= $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.
)
573 MOZ_MAKE
= $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.
)
576 else # MOZ_BUILD_PROJECTS
579 OBJDIR
= $(MOZ_OBJDIR
)
580 MOZ_MAKE
= $(MAKE
) $(MOZ_MAKE_FLAGS
) -C
$(OBJDIR
)
582 OBJDIR
:= $(TOPSRCDIR
)
583 MOZ_MAKE
:= $(MAKE
) $(MOZ_MAKE_FLAGS
)
586 endif # MOZ_BUILD_PROJECTS
588 ####################################
589 # CVS defines for NSS
593 mozilla
/security
/nss \
594 mozilla
/security
/coreconf \
595 mozilla
/security
/dbm \
600 NSS_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
602 NSS_CO_FLAGS
:= $(NSS_CO_FLAGS
) $(if
$(NSS_CO_TAG
),-r
$(NSS_CO_TAG
),-A
)
604 # Can only pull the tip or branch tags by date
605 ifeq (,$(filter-out HEAD
%BRANCH
,$(NSS_CO_TAG
)))
606 CVSCO_NSS
= $(CVS
) $(CVS_FLAGS
) co $(NSS_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(NSS_CO_MODULE
)
608 CVSCO_NSS
= $(CVS
) $(CVS_FLAGS
) co $(NSS_CO_FLAGS
) $(NSS_CO_MODULE
)
611 ####################################
612 # CVS defines for NSPR
614 NSPR_CO_MODULE
= mozilla
/nsprpub
617 NSPR_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
619 NSPR_CO_FLAGS
:= $(NSPR_CO_FLAGS
) $(if
$(NSPR_CO_TAG
),-r
$(NSPR_CO_TAG
),-A
)
621 # Can only pull the tip or branch tags by date
622 ifeq (,$(filter-out HEAD
%BRANCH
,$(NSPR_CO_TAG
)))
623 CVSCO_NSPR
= $(CVS
) $(CVS_FLAGS
) co $(NSPR_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(NSPR_CO_MODULE
)
625 CVSCO_NSPR
= $(CVS
) $(CVS_FLAGS
) co $(NSPR_CO_FLAGS
) $(NSPR_CO_MODULE
)
628 ####################################
629 # CVS defines for the C LDAP SDK
631 LDAPCSDK_CO_MODULE
= mozilla
/directory
/c-sdk
632 LDAPCSDK_CO_FLAGS
:= -P
634 LDAPCSDK_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
636 LDAPCSDK_CO_FLAGS
:= $(LDAPCSDK_CO_FLAGS
) $(if
$(LDAPCSDK_CO_TAG
),-r
$(LDAPCSDK_CO_TAG
),-A
)
638 # Can only pull the tip or branch tags by date
639 ifeq (,$(filter-out HEAD
%BRANCH
,$(LDAPCSDK_CO_TAG
)))
640 CVSCO_LDAPCSDK
= $(CVS
) $(CVS_FLAGS
) co $(LDAPCSDK_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(LDAPCSDK_CO_MODULE
)
642 CVSCO_LDAPCSDK
= $(CVS
) $(CVS_FLAGS
) co $(LDAPCSDK_CO_FLAGS
) $(LDAPCSDK_CO_MODULE
)
645 ####################################
646 # Error on obsolete variables.
650 $(warning MOZ_MAPINFO is obsolete
, use MOZ_CO_MODULE
=mozilla
/tools
/codesighs instead.
)
651 MOZ_MODULE_LIST
+= mozilla
/tools
/codesighs
653 ifdef MOZ_INTERNAL_LIBART_LGPL
654 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete
, use MOZ_CO_MODULE
=mozilla
/other-licenses
/libart_lgpl instead.
)
657 $(warning MOZ_PHOENIX is obsolete.
)
658 MOZ_MODULE_LIST
+= $(MODULES_browser
)
659 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
661 ifdef MOZ_THUNDERBIRD
662 $(warning MOZ_THUNDERBIRD is obsolete.
)
663 MOZ_MODULE_LIST
+= $(MODULES_mail
)
664 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
667 ###################################
668 # Checkout main modules
671 # sort is used to remove duplicates.
672 MOZ_MODULE_LIST
:= $(sort $(MOZ_MODULE_LIST
))
673 MOZ_MODULE_LIST_NS
:= $(sort $(MOZ_MODULE_LIST_NS
))
675 ####################################
676 # Suppress standalone modules if they're not needed.
678 CONFIGURES
:= $(TOPSRCDIR
)/configure
679 ifeq (,$(filter mozilla
/xpcom
,$(MOZ_MODULE_LIST
)))
682 CONFIGURES
+= $(TOPSRCDIR
)/nsprpub
/configure
685 ifeq (,$(filter mozilla
/security
/manager
,$(MOZ_MODULE_LIST
)))
688 ifeq (,$(filter mozilla
/directory
/xpcom
,$(MOZ_MODULE_LIST
)))
691 CONFIGURES
+= $(TOPSRCDIR
)/directory
/c-sdk
/configure
694 MODULES_CO_FLAGS
:= -P
696 MODULES_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
698 MODULES_CO_FLAGS
:= $(MODULES_CO_FLAGS
) $(if
$(MOZ_CO_TAG
),-r
$(MOZ_CO_TAG
),-A
)
700 CVSCO_MODULES_NS
= $(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) -l
$(MOZ_MODULE_LIST_NS
)
702 ifeq (,$(strip $(MOZ_MODULE_LIST
)))
703 FASTUPDATE_MODULES
= $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.
)
704 CHECKOUT_MODULES
= $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.
)
706 FASTUPDATE_MODULES
:= fast_update
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(MOZ_MODULE_LIST
)
707 CHECKOUT_MODULES
:= cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(MOZ_MODULE_LIST
);
709 ifeq (,$(MOZ_MODULE_LIST_NS
))
710 FASTUPDATE_MODULES_NS
:= true
711 CHECKOUT_MODULES_NS
:= true
713 FASTUPDATE_MODULES_NS
:= fast_update
$(CVSCO_MODULES_NS
)
714 CHECKOUT_MODULES_NS
:= cvs_co
$(CVSCO_MODULES_NS
)
717 ###################################
718 # CVS defines for locales
721 LOCALES_CO_FLAGS
:= -P
723 LOCALES_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
725 LOCALES_CO_FLAGS
:= $(LOCALES_CO_FLAGS
) $(if
$(LOCALES_CO_TAG
),-r
$(LOCALES_CO_TAG
),-A
)
727 ifndef MOZ_CO_LOCALES
728 FASTUPDATE_LOCALES
:= true
729 CHECKOUT_LOCALES
:= true
732 override MOZ_CO_LOCALES
:= $(subst $(comma
), ,$(MOZ_CO_LOCALES
))
734 ifeq (all,$(MOZ_CO_LOCALES
))
735 MOZCONFIG_MODULES
+= $(foreach project
,$(MOZ_PROJECT_LIST
),mozilla
/$(project
)/locales
/all-locales
)
737 LOCALE_CO_DIRS
:= $(sort $(foreach project
,$(MOZ_PROJECT_LIST
),$(foreach locale
,$(shell cat mozilla
/$(project
)/locales
/all-locales
),$(foreach dir,$(LOCALES_
$(project
)),l10n
/$(locale
)/$(dir)))))
738 else # MOZ_CO_LOCALES != all
739 LOCALE_CO_DIRS
= $(sort $(foreach locale
,$(MOZ_CO_LOCALES
),$(foreach dir,$(LOCALE_DIRS
),l10n
/$(locale
)/$(dir))))
742 CVSCO_LOCALES
:= $(CVS
) $(CVS_FLAGS
) -d
$(LOCALES_CVSROOT
) co $(LOCALES_CO_FLAGS
) $(CVS_CO_LOCALES_DATE_FLAGS
) $(LOCALE_CO_DIRS
)
744 FASTUPDATE_LOCALES
:= fast_update
$(CVSCO_LOCALES
)
745 CHECKOUT_LOCALES
:= cvs_co
$(CVSCO_LOCALES
)
746 endif #MOZ_CO_LOCALES
748 #######################################################################
752 # Print out any options loaded from mozconfig.
753 all build checkout
clean depend
distclean export libs
install realclean::
754 @if
test -f .mozconfig.out
; then \
755 cat .mozconfig.out
; \
756 rm -f .mozconfig.out
; \
760 ifdef _IS_FIRST_CHECKOUT
763 all:: checkout alldep
766 # Windows equivalents
769 build_all_dep
: alldep
770 build_all_depend
: alldep
771 clobber clobber_all
: clean
772 pull_and_build_all
: checkout alldep
774 # Do everything from scratch
775 everything
: checkout
clean build
777 ####################################
781 # @: Backup the last checkout log.
782 @if
test -f
$(CVSCO_LOGFILE
) ; then \
783 mv
$(CVSCO_LOGFILE
) $(CVSCO_LOGFILE
).old
; \
786 ifdef RUN_AUTOCONF_LOCALLY
787 @echo
"Removing local configures" ; \
789 $(RM
) -f
$(CONFIGURES
)
791 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE
)
792 @echo
'$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
794 $(CVSCO
) $(CVS_CO_DATE_FLAGS
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
795 @cd
$(ROOTDIR
) && $(MAKE
) -f mozilla
/client.mk real_checkout
797 # Start the checkout. Split the output to the tty and a log file.
801 cvs_co
() { set
-e
; echo
"$$@" ; \
802 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
803 cvs_co
$(CVSCO_NSPR
); \
804 cvs_co
$(CVSCO_NSS
); \
805 cvs_co
$(CVSCO_LDAPCSDK
); \
806 $(CHECKOUT_MODULES_NS
); \
807 $(CHECKOUT_MODULES
) \
809 @echo
"checkout finish: "`date` | tee
-a
$(CVSCO_LOGFILE
)
810 # update the NSS checkout timestamp, if we checked PSM out
811 @if
test -d
$(TOPSRCDIR
)/security
/manager
-a \
812 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
813 touch
$(TOPSRCDIR
)/security
/manager
/.nss.checkout
; \
815 ifdef RUN_AUTOCONF_LOCALLY
817 $(RM
) -f
$(CONFIGURES
)
819 # @: Check the log for conflicts. ;
820 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE)` ;\
821 if
test "$$conflicts" ; then \
822 echo
"$(MAKE): *** Conflicts during checkout." ;\
823 echo
"$$conflicts" ;\
824 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
830 # @: Backup the last checkout log.
831 @if
test -f
$(CVSCO_LOGFILE
) ; then \
832 mv
$(CVSCO_LOGFILE
) $(CVSCO_LOGFILE
).old
; \
835 ifdef RUN_AUTOCONF_LOCALLY
836 @echo
"Removing local configures" ; \
838 $(RM
) -f
$(CONFIGURES
)
840 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE
)
841 @echo
'$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
843 $(CVSCO
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
844 @cd
$(TOPSRCDIR
) && \
845 $(MAKE
) -f client.mk real_fast-update
847 # Start the update. Split the output to the tty and a log file.
850 fast_update
() { set
-e
; config
/cvsco-fast-update.pl
$$@
2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
851 cvs_co
() { set
-e
; echo
"$$@" ; \
852 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
853 fast_update
$(CVSCO_NSPR
); \
855 cvs_co
$(CVSCO_NSS
); \
857 fast_update
$(CVSCO_LDAPCSDK
); \
858 $(FASTUPDATE_MODULES
); \
859 $(FASTUPDATE_MODULES_NS
); \
860 $(FASTUPDATE_LOCALES
);
861 @echo
"fast_update finish: "`date` | tee
-a
$(CVSCO_LOGFILE
)
862 # update the NSS checkout timestamp
863 @if
test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
864 touch
$(TOPSRCDIR
)/security
/manager
/.nss.checkout
; \
866 ifdef RUN_AUTOCONF_LOCALLY
868 $(RM
) -f
$(CONFIGURES
)
870 # @: Check the log for conflicts. ;
871 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE)` ;\
872 if
test "$$conflicts" ; then \
873 echo
"$(MAKE): *** Conflicts during fast-update." ;\
874 echo
"$$conflicts" ;\
875 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
880 CVSCO_LOGFILE_L10N
:= $(ROOTDIR
)/cvsco-l10n.log
881 CVSCO_LOGFILE_L10N
:= $(shell echo
$(CVSCO_LOGFILE_L10N
) | sed s
%//%/%)
884 # @: Backup the last checkout log.
885 @if
test -f
$(CVSCO_LOGFILE_L10N
) ; then \
886 mv
$(CVSCO_LOGFILE_L10N
) $(CVSCO_LOGFILE_L10N
).old
; \
889 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE_L10N
)
890 @echo
'$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
892 $(CVSCO
) $(CVS_CO_DATE_FLAGS
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
893 @cd
$(ROOTDIR
) && $(MAKE
) -f mozilla
/client.mk real_l10n-checkout
895 FULL_EN_US_DIRS
:= toolkit \
897 $(MOZ_PROJECT_LIST
) \
900 EN_US_LOCALE_DIRS
:= $(foreach dir, \
901 $(filter-out toolkit extensions
/% $(MOZ_PROJECT_LIST
), $(LOCALE_DIRS
)), \
902 mozilla
/$(dir)/locales
)
904 EN_US_CO_DIRS
:= $(EN_US_LOCALE_DIRS
) \
905 $(foreach mod
,$(FULL_EN_US_DIRS
),mozilla
/$(mod
)) \
908 mozilla
/configure.in \
909 mozilla
/allmakefiles.sh \
914 # Start the checkout. Split the output to the tty and a log file.
917 cvs_co
() { set
-e
; echo
"$$@" ; \
918 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE_L10N
); }; \
919 cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(EN_US_CO_DIRS
); \
920 cvs_co
$(CVSCO_LOCALES
)
921 @echo
"checkout finish: "`date` | tee
-a
$(CVSCO_LOGFILE_L10N
)
922 # @: Check the log for conflicts. ;
923 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
924 if
test "$$conflicts" ; then \
925 echo
"$(MAKE): *** Conflicts during checkout." ;\
926 echo
"$$conflicts" ;\
927 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
932 #####################################################
935 ifdef _IS_FIRST_CHECKOUT
936 # First time, do build target in a new process to pick up new files.
938 $(MAKE
) -f
$(TOPSRCDIR
)/client.mk build
941 #####################################################
942 # After First Checkout
944 #####################################################
945 # Build date unification
947 ifdef MOZ_UNIFY_BDATE
948 ifndef MOZ_BUILD_DATE
949 ifdef MOZ_BUILD_PROJECTS
950 MOZ_BUILD_DATE
= $(shell $(PYTHON
) $(TOPSRCDIR
)/toolkit
/xre
/make-platformini.py
--print-buildid
)
951 export MOZ_BUILD_DATE
956 #####################################################
957 # Preflight, before building any project
959 build profiledbuild alldep preflight_all
::
960 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_PREFLIGHT_ALL
),,1))
961 # Don't run preflight_all for individual projects in multi-project builds
962 # (when MOZ_CURRENT_PROJECT is set.)
963 ifndef MOZ_BUILD_PROJECTS
964 # Building a single project, OBJDIR is usable.
966 for mkfile in
$(MOZ_PREFLIGHT_ALL
); do \
967 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight_all TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
970 # OBJDIR refers to the project-specific OBJDIR, which is not available at
971 # this point when building multiple projects. Only MOZ_OBJDIR is available.
973 for mkfile in
$(MOZ_PREFLIGHT_ALL
); do \
974 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight_all TOPSRCDIR
=$(TOPSRCDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
) MOZ_BUILD_PROJECTS
="$(MOZ_BUILD_PROJECTS)"; \
979 # If we're building multiple projects, but haven't specified which project,
982 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_BUILD_PROJECTS
),,1))
983 configure depend build profiledbuild
install export libs
clean realclean distclean alldep preflight postflight
::
985 for app in
$(MOZ_BUILD_PROJECTS
); do \
986 $(MAKE
) -f
$(TOPSRCDIR
)/client.mk
$@ MOZ_CURRENT_PROJECT
=$$app; \
991 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
992 # individual project in a multi-project build.
994 ####################################
997 CONFIG_STATUS
= $(wildcard $(OBJDIR
)/config.status
)
998 CONFIG_CACHE
= $(wildcard $(OBJDIR
)/config.cache
)
1000 ifdef RUN_AUTOCONF_LOCALLY
1001 EXTRA_CONFIG_DEPS
:= \
1002 $(TOPSRCDIR
)/aclocal.m4 \
1003 $(wildcard $(TOPSRCDIR
)/build
/autoconf
/*.m4
) \
1006 $(TOPSRCDIR
)/configure
: $(TOPSRCDIR
)/configure.in
$(EXTRA_CONFIG_DEPS
)
1007 @echo Generating
$@ using autoconf
1008 cd
$(TOPSRCDIR
); $(AUTOCONF
)
1010 $(TOPSRCDIR
)/nsprpub
/configure
: $(TOPSRCDIR
)/nsprpub
/configure.in
$(EXTRA_CONFIG_DEPS
)
1011 @echo Generating
$@ using autoconf
1012 cd
$(TOPSRCDIR
)/nsprpub
; $(AUTOCONF
)
1014 $(TOPSRCDIR
)/directory
/c-sdk
/configure
: $(TOPSRCDIR
)/directory
/c-sdk
/configure.in
$(EXTRA_CONFIG_DEPS
)
1015 @echo Generating
$@ using autoconf
1016 cd
$(TOPSRCDIR
)/directory
/c-sdk
; $(AUTOCONF
)
1019 CONFIG_STATUS_DEPS
:= \
1020 $(TOPSRCDIR
)/configure \
1021 $(TOPSRCDIR
)/.mozconfig.mk \
1022 $(wildcard $(TOPSRCDIR
)/nsprpub
/configure
) \
1023 $(wildcard $(TOPSRCDIR
)/directory
/c-sdk
/configure
) \
1024 $(wildcard $(TOPSRCDIR
)/config
/milestone.txt
) \
1025 $(wildcard $(TOPSRCDIR
)/config
/chrome-versions.sh
) \
1026 $(wildcard $(addsuffix confvars.sh
,$(wildcard */))) \
1029 # configure uses the program name to determine @srcdir@. Calling it without
1030 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1031 # path of $(TOPSRCDIR).
1032 ifeq ($(TOPSRCDIR
),$(OBJDIR
))
1033 CONFIGURE
= .
/configure
1035 CONFIGURE
= $(TOPSRCDIR
)/configure
1039 CONFIGURE
= $(TOPSRCDIR
)/configure
1042 configure
:: $(CONFIGURES
)
1043 ifdef MOZ_BUILD_PROJECTS
1044 @if
test ! -d
$(MOZ_OBJDIR
); then
$(MKDIR
) $(MOZ_OBJDIR
); else true
; fi
1046 @if
test ! -d
$(OBJDIR
); then
$(MKDIR
) $(OBJDIR
); else true
; fi
1048 @echo
$(CONFIGURE
) $(CONFIGURE_ARGS
)
1049 @cd
$(OBJDIR
) && $(BUILD_PROJECT_ARG
) $(CONFIGURE_ENV_ARGS
) $(CONFIGURE
) $(CONFIGURE_ARGS
) \
1050 ||
( echo
"*** Fix above errors and then restart with\
1051 \"$(MAKE) -f client.mk build\"" && exit
1 )
1052 @touch
$(OBJDIR
)/Makefile
1054 $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
: $(CONFIG_STATUS_DEPS
)
1055 @
$(MAKE
) -f
$(TOPSRCDIR
)/client.mk configure
1057 ifneq (,$(CONFIG_STATUS
))
1058 $(OBJDIR
)/config
/autoconf.mk
: $(TOPSRCDIR
)/config
/autoconf.mk.in
1060 CONFIG_FILES
=config
/autoconf.mk .
/config.status
1064 ####################################
1067 depend
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1068 $(MOZ_MAKE
) export && $(MOZ_MAKE
) depend
1070 ####################################
1073 build profiledbuild alldep preflight
::
1076 for mkfile in
$(MOZ_PREFLIGHT
); do \
1077 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1081 ####################################
1084 build
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1087 ####################################
1088 # Profile-feedback build (gcc only)
1089 # To use this, you should set the following variables in your mozconfig
1090 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
1092 # The profile script should exercise the functionality to be included
1093 # in the profile feedback.
1095 profiledbuild
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1096 $(MOZ_MAKE
) MOZ_PROFILE_GENERATE
=1
1097 OBJDIR
=${OBJDIR} $(PROFILE_GEN_SCRIPT
)
1098 $(MOZ_MAKE
) clobber_all
1099 $(MOZ_MAKE
) MOZ_PROFILE_USE
=1
1100 find
$(OBJDIR
) -name
"*.da" -exec
rm {} \
;
1102 ####################################
1105 # Pass these target onto the real build system
1106 install export libs
clean realclean distclean alldep
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1109 ####################################
1112 build profiledbuild alldep postflight
::
1113 ifdef MOZ_POSTFLIGHT
1115 for mkfile in
$(MOZ_POSTFLIGHT
); do \
1116 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1120 endif # MOZ_CURRENT_PROJECT
1122 ####################################
1123 # Postflight, after building all projects
1125 build profiledbuild alldep postflight_all
::
1126 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_POSTFLIGHT_ALL
),,1))
1127 # Don't run postflight_all for individual projects in multi-project builds
1128 # (when MOZ_CURRENT_PROJECT is set.)
1129 ifndef MOZ_BUILD_PROJECTS
1130 # Building a single project, OBJDIR is usable.
1132 for mkfile in
$(MOZ_POSTFLIGHT_ALL
); do \
1133 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight_all TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1136 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1137 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1139 for mkfile in
$(MOZ_POSTFLIGHT_ALL
); do \
1140 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight_all TOPSRCDIR
=$(TOPSRCDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
) MOZ_BUILD_PROJECTS
="$(MOZ_BUILD_PROJECTS)"; \
1147 if
[ -f Makefile
]; then \
1148 $(MAKE
) distclean ; \
1150 echo
"Removing object files from srcdir..."; \
1151 rm -fr
`find . -type d \( -name .deps -print -o -name CVS \
1152 -o -exec test ! -d {}/CVS \; \) -prune \
1153 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1154 build
/autoconf
/clean-config.sh
; \
1157 # (! IS_FIRST_CHECKOUT)
1163 .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 configure preflight_all preflight postflight postflight_all