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 \
261 extensions
/spellcheck \
265 $(BOOTSTRAP_toolkit
) \
268 MODULES_NS_browser
:= \
269 $(MODULES_NS_toolkit
) \
275 mozilla
/other-licenses
/branding
/firefox \
276 mozilla
/other-licenses
/7zstub
/firefox \
282 extensions
/reporter \
283 extensions
/spellcheck \
284 other-licenses
/branding
/firefox \
287 BOOTSTRAP_browser
:= \
288 $(BOOTSTRAP_toolkit
) \
289 mozilla
/browser
/config
/mozconfig \
292 MODULES_NS_minimo
:= \
293 $(MODULES_NS_toolkit
) \
301 BOOTSTRAP_minimo
:= \
302 $(BOOTSTRAP_toolkit
) \
306 $(MODULES_NS_toolkit
) \
311 mozilla
/directory
/xpcom \
314 mozilla
/other-licenses
/branding
/thunderbird \
315 mozilla
/other-licenses
/7zstub
/thunderbird \
321 other-licenses
/branding
/thunderbird \
323 extensions
/spellcheck \
327 $(BOOTSTRAP_toolkit
) \
328 mozilla
/mail
/config
/mozconfig \
331 MODULES_composer
:= \
336 MODULES_NS_calendar
:= \
337 $(MODULES_NS_toolkit
) \
340 MODULES_calendar
:= \
345 mozilla
/other-licenses
/branding
/sunbird \
346 mozilla
/other-licenses
/7zstub
/sunbird \
349 LOCALES_calendar
:= \
352 other-licenses
/branding
/sunbird \
355 BOOTSTRAP_calendar
:= \
356 $(BOOTSTRAP_toolkit
) \
357 mozilla
/calendar
/sunbird
/config
/mozconfig \
360 MODULES_NS_xulrunner
:= \
361 $(MODULES_NS_toolkit
) \
364 MODULES_xulrunner
:= \
369 LOCALES_xulrunner
:= \
373 BOOTSTRAP_xulrunner
:= \
374 $(BOOTSTRAP_toolkit
) \
375 mozilla
/xulrunner
/config
/mozconfig \
378 MODULES_NS_camino
:= \
379 $(MODULES_NS_toolkit
) \
388 BOOTSTRAP_camino
:= \
389 $(BOOTSTRAP_toolkit
) \
390 mozilla
/camino
/config
/mozconfig \
395 mozilla
/modules
/zlib \
399 mozilla
/other-licenses
/bsdiff \
400 mozilla
/other-licenses
/libart_lgpl \
401 mozilla
/tools
/trace-malloc \
402 mozilla
/tools
/jprof \
403 mozilla
/tools
/codesighs \
404 mozilla
/tools
/update-packaging \
407 #######################################################################
410 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
411 # and commit this file on that tag.
413 NSPR_CO_TAG
= NSPR_HEAD_20071218
414 NSS_CO_TAG
= NSS_3_12_ALPHA_2B
415 LDAPCSDK_CO_TAG
= LDAPCSDK_6_0_3_CLIENT_BRANCH
418 #######################################################################
425 ifneq (1,$(words $(CWD
)))
426 $(error The mozilla directory cannot be located in a path with spaces.
)
433 ifneq (, $(wildcard client.mk
))
434 # Ran from mozilla directory
435 ROOTDIR
:= $(shell dirname
$(CWD
))
438 # Ran from mozilla/.. directory (?)
440 TOPSRCDIR
:= $(CWD
)/mozilla
443 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
444 # work; replace first instance with one forward slash
445 TOPSRCDIR
:= $(shell echo
"$(TOPSRCDIR)" | sed
-e
's%//%/%')
448 TOPSRCDIR_MOZ
=$(TOPSRCDIR
)
451 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
452 DIRNAME
:= $(shell echo
"$(ROOTDIR)" | sed
-e
's/^.://')
466 CONFIG_GUESS_SCRIPT
:= $(wildcard $(TOPSRCDIR
)/build
/autoconf
/config.guess
)
467 ifdef CONFIG_GUESS_SCRIPT
468 CONFIG_GUESS
= $(shell $(CONFIG_GUESS_SCRIPT
))
470 _IS_FIRST_CHECKOUT
:= 1
473 ####################################
476 ifneq (,$(filter MINGW
%,$(shell uname
-s
)))
477 # check for CRLF line endings
478 ifneq (0,$(shell $(PERL
) -e
'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR
)/client.mk
))
479 $(error This source tree appears to have Windows-style line endings. To \
480 convert it to Unix-style line endings
, run \
481 "python mozilla/build/win32/mozilla-dos2unix.py")
485 ####################################
488 # Add the CVS root to CVS_FLAGS if needed
489 CVS_ROOT_IN_TREE
:= $(shell cat
$(TOPSRCDIR
)/CVS
/Root
2>/dev
/null
)
490 ifneq ($(CVS_ROOT_IN_TREE
),)
491 ifneq ($(CVS_ROOT_IN_TREE
),$(CVSROOT
))
492 CVS_FLAGS
:= -d
$(CVS_ROOT_IN_TREE
)
496 CVS_CO_DATE_FLAGS
= $(if
$(MOZ_CO_DATE
),-D
"$(MOZ_CO_DATE)")
497 CVS_CO_LOCALES_DATE_FLAGS
= $(if
$(MOZ_CO_LOCALES_DATE
),-D
"$(MOZ_CO_LOCALES_DATE)")
498 CVSCO
= $(CVS
) $(CVS_FLAGS
) co $(MOZ_CO_FLAGS
) $(if
$(MOZ_CO_TAG
),-r
$(MOZ_CO_TAG
)) $(CVS_CO_DATE_FLAGS
)
500 MOZ_CO_LOCALES_DATE ?
= $(MOZ_CO_DATE
)
502 CVSCO_LOGFILE
:= $(ROOTDIR
)/cvsco.log
503 CVSCO_LOGFILE
:= $(shell echo
$(CVSCO_LOGFILE
) | sed s
%//%/%)
505 # if LOCALES_CVSROOT is not specified, set it here
506 # (and let mozconfig override it)
507 LOCALES_CVSROOT ?
= :pserver
:anonymous
:anonymous@cvs-mirror.mozilla.org
:/l10n
509 ####################################
510 # Load mozconfig Options
512 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
514 MOZCONFIG_LOADER
:= mozilla
/build
/autoconf
/mozconfig2client-mk
515 MOZCONFIG_FINDER
:= mozilla
/build
/autoconf
/mozconfig-find
516 MOZCONFIG_MODULES
:= mozilla
/build
/unix
/uniq.pl
517 run_for_side_effects
:= \
518 $(shell cd
$(ROOTDIR
); \
519 if
test "$(_IS_FIRST_CHECKOUT)"; then \
520 $(CVSCO
) $(MOZCONFIG_FINDER
) $(MOZCONFIG_LOADER
) $(MOZCONFIG_MODULES
); \
523 $(MOZCONFIG_LOADER
) $(TOPSRCDIR
) mozilla
/.mozconfig.mk
> mozilla
/.mozconfig.out
)
524 include $(TOPSRCDIR
)/.mozconfig.mk
526 ####################################
527 # Options that may come from mozconfig
529 MOZ_PROJECT_LIST
:= $(subst $(comma
), ,$(MOZ_CO_PROJECT
))
530 MOZ_PROJECT_LIST
:= $(subst macbrowser
,camino
,$(MOZ_PROJECT_LIST
))
532 ifneq (,$(filter-out $(AVAILABLE_PROJECTS
),$(MOZ_PROJECT_LIST
)))
533 $(error MOZ_CO_PROJECT contains an unrecognized project.
)
536 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST
)))
537 MOZ_PROJECT_LIST
:= $(AVAILABLE_PROJECTS
)
540 MOZ_MODULE_LIST
:= $(subst $(comma
), ,$(MOZ_CO_MODULE
)) $(foreach project
,$(MOZ_PROJECT_LIST
),$(MODULES_
$(project
)))
541 MOZ_MODULE_LIST_NS
:= $(foreach project
,$(MOZ_PROJECT_LIST
),$(MODULES_NS_
$(project
)))
542 LOCALE_DIRS
:= $(MOZ_LOCALE_DIRS
) $(foreach project
,$(MOZ_PROJECT_LIST
),$(LOCALES_
$(project
)))
544 MOZCONFIG_MODULES
+= $(foreach project
,$(MOZ_PROJECT_LIST
),$(BOOTSTRAP_
$(project
)))
546 # Using $(sort) here because it also removes duplicate entries.
547 MOZ_MODULE_LIST
:= $(sort $(MOZ_MODULE_LIST
))
548 LOCALE_DIRS
:= $(sort $(LOCALE_DIRS
))
549 MOZCONFIG_MODULES
:= $(sort $(MOZCONFIG_MODULES
))
551 # Change CVS flags if anonymous root is requested
552 ifdef MOZ_CO_USE_MIRROR
553 CVS_FLAGS
:= -d
:pserver
:anonymous
:anonymous@cvs-mirror.mozilla.org
:/cvsroot
556 # MOZ_CVS_FLAGS - Basic CVS flags
557 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
558 CVS_FLAGS
:= $(CVS_FLAGS
) -q
-z
3
560 CVS_FLAGS
:= $(MOZ_CVS_FLAGS
)
563 ifdef MOZ_BUILD_PROJECTS
566 $(error When MOZ_BUILD_PROJECTS is set
, you must set MOZ_OBJDIR
)
568 ifdef MOZ_CURRENT_PROJECT
569 OBJDIR
= $(MOZ_OBJDIR
)/$(MOZ_CURRENT_PROJECT
)
570 MOZ_MAKE
= $(MAKE
) $(MOZ_MAKE_FLAGS
) -C
$(OBJDIR
)
571 BUILD_PROJECT_ARG
= MOZ_BUILD_APP
=$(MOZ_CURRENT_PROJECT
)
573 OBJDIR
= $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.
)
574 MOZ_MAKE
= $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.
)
577 else # MOZ_BUILD_PROJECTS
580 OBJDIR
= $(MOZ_OBJDIR
)
581 MOZ_MAKE
= $(MAKE
) $(MOZ_MAKE_FLAGS
) -C
$(OBJDIR
)
583 OBJDIR
:= $(TOPSRCDIR
)
584 MOZ_MAKE
:= $(MAKE
) $(MOZ_MAKE_FLAGS
)
587 endif # MOZ_BUILD_PROJECTS
589 ####################################
590 # CVS defines for NSS
594 mozilla
/security
/nss \
595 mozilla
/security
/coreconf \
596 mozilla
/security
/dbm \
601 NSS_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
603 NSS_CO_FLAGS
:= $(NSS_CO_FLAGS
) $(if
$(NSS_CO_TAG
),-r
$(NSS_CO_TAG
),-A
)
605 # Can only pull the tip or branch tags by date
606 ifeq (,$(filter-out HEAD
%BRANCH
,$(NSS_CO_TAG
)))
607 CVSCO_NSS
= $(CVS
) $(CVS_FLAGS
) co $(NSS_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(NSS_CO_MODULE
)
609 CVSCO_NSS
= $(CVS
) $(CVS_FLAGS
) co $(NSS_CO_FLAGS
) $(NSS_CO_MODULE
)
612 ####################################
613 # CVS defines for NSPR
615 NSPR_CO_MODULE
= mozilla
/nsprpub
618 NSPR_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
620 NSPR_CO_FLAGS
:= $(NSPR_CO_FLAGS
) $(if
$(NSPR_CO_TAG
),-r
$(NSPR_CO_TAG
),-A
)
622 # Can only pull the tip or branch tags by date
623 ifeq (,$(filter-out HEAD
%BRANCH
,$(NSPR_CO_TAG
)))
624 CVSCO_NSPR
= $(CVS
) $(CVS_FLAGS
) co $(NSPR_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(NSPR_CO_MODULE
)
626 CVSCO_NSPR
= $(CVS
) $(CVS_FLAGS
) co $(NSPR_CO_FLAGS
) $(NSPR_CO_MODULE
)
629 ####################################
630 # CVS defines for the C LDAP SDK
632 LDAPCSDK_CO_MODULE
= mozilla
/directory
/c-sdk
633 LDAPCSDK_CO_FLAGS
:= -P
635 LDAPCSDK_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
637 LDAPCSDK_CO_FLAGS
:= $(LDAPCSDK_CO_FLAGS
) $(if
$(LDAPCSDK_CO_TAG
),-r
$(LDAPCSDK_CO_TAG
),-A
)
639 # Can only pull the tip or branch tags by date
640 ifeq (,$(filter-out HEAD
%BRANCH
,$(LDAPCSDK_CO_TAG
)))
641 CVSCO_LDAPCSDK
= $(CVS
) $(CVS_FLAGS
) co $(LDAPCSDK_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(LDAPCSDK_CO_MODULE
)
643 CVSCO_LDAPCSDK
= $(CVS
) $(CVS_FLAGS
) co $(LDAPCSDK_CO_FLAGS
) $(LDAPCSDK_CO_MODULE
)
646 ####################################
647 # Error on obsolete variables.
651 $(warning MOZ_MAPINFO is obsolete
, use MOZ_CO_MODULE
=mozilla
/tools
/codesighs instead.
)
652 MOZ_MODULE_LIST
+= mozilla
/tools
/codesighs
654 ifdef MOZ_INTERNAL_LIBART_LGPL
655 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete
, use MOZ_CO_MODULE
=mozilla
/other-licenses
/libart_lgpl instead.
)
658 $(warning MOZ_PHOENIX is obsolete.
)
659 MOZ_MODULE_LIST
+= $(MODULES_browser
)
660 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
662 ifdef MOZ_THUNDERBIRD
663 $(warning MOZ_THUNDERBIRD is obsolete.
)
664 MOZ_MODULE_LIST
+= $(MODULES_mail
)
665 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
668 ###################################
669 # Checkout main modules
672 # sort is used to remove duplicates.
673 MOZ_MODULE_LIST
:= $(sort $(MOZ_MODULE_LIST
))
674 MOZ_MODULE_LIST_NS
:= $(sort $(MOZ_MODULE_LIST_NS
))
676 ####################################
677 # Suppress standalone modules if they're not needed.
679 CONFIGURES
:= $(TOPSRCDIR
)/configure
680 ifeq (,$(filter mozilla
/xpcom
,$(MOZ_MODULE_LIST
)))
683 CONFIGURES
+= $(TOPSRCDIR
)/nsprpub
/configure
686 ifeq (,$(filter mozilla
/security
/manager
,$(MOZ_MODULE_LIST
)))
689 ifeq (,$(filter mozilla
/directory
/xpcom
,$(MOZ_MODULE_LIST
)))
692 CONFIGURES
+= $(TOPSRCDIR
)/directory
/c-sdk
/configure
695 MODULES_CO_FLAGS
:= -P
697 MODULES_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
699 MODULES_CO_FLAGS
:= $(MODULES_CO_FLAGS
) $(if
$(MOZ_CO_TAG
),-r
$(MOZ_CO_TAG
),-A
)
701 CVSCO_MODULES_NS
= $(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) -l
$(MOZ_MODULE_LIST_NS
)
703 ifeq (,$(strip $(MOZ_MODULE_LIST
)))
704 FASTUPDATE_MODULES
= $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.
)
705 CHECKOUT_MODULES
= $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.
)
707 FASTUPDATE_MODULES
:= fast_update
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(MOZ_MODULE_LIST
)
708 CHECKOUT_MODULES
:= cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(MOZ_MODULE_LIST
);
710 ifeq (,$(MOZ_MODULE_LIST_NS
))
711 FASTUPDATE_MODULES_NS
:= true
712 CHECKOUT_MODULES_NS
:= true
714 FASTUPDATE_MODULES_NS
:= fast_update
$(CVSCO_MODULES_NS
)
715 CHECKOUT_MODULES_NS
:= cvs_co
$(CVSCO_MODULES_NS
)
718 ###################################
719 # CVS defines for locales
722 LOCALES_CO_FLAGS
:= -P
724 LOCALES_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
726 LOCALES_CO_FLAGS
:= $(LOCALES_CO_FLAGS
) $(if
$(LOCALES_CO_TAG
),-r
$(LOCALES_CO_TAG
),-A
)
728 ifndef MOZ_CO_LOCALES
729 FASTUPDATE_LOCALES
:= true
730 CHECKOUT_LOCALES
:= true
733 override MOZ_CO_LOCALES
:= $(subst $(comma
), ,$(MOZ_CO_LOCALES
))
735 ifeq (all,$(MOZ_CO_LOCALES
))
736 MOZCONFIG_MODULES
+= $(foreach project
,$(MOZ_PROJECT_LIST
),mozilla
/$(project
)/locales
/all-locales
)
738 LOCALE_CO_DIRS
:= $(sort $(foreach project
,$(MOZ_PROJECT_LIST
),$(foreach locale
,$(shell cat mozilla
/$(project
)/locales
/all-locales
),l10n
/$(locale
)/)))
739 else # MOZ_CO_LOCALES != all
740 LOCALE_CO_DIRS
= $(sort $(foreach locale
,$(MOZ_CO_LOCALES
),l10n
/$(locale
)/))
743 CVSCO_LOCALES
:= $(CVS
) $(CVS_FLAGS
) -d
$(LOCALES_CVSROOT
) co $(LOCALES_CO_FLAGS
) $(CVS_CO_LOCALES_DATE_FLAGS
) $(LOCALE_CO_DIRS
)
745 FASTUPDATE_LOCALES
:= fast_update
$(CVSCO_LOCALES
)
746 CHECKOUT_LOCALES
:= cvs_co
$(CVSCO_LOCALES
)
747 endif #MOZ_CO_LOCALES
749 #######################################################################
753 # Print out any options loaded from mozconfig.
754 all build checkout
clean depend
distclean export libs
install realclean::
755 @if
test -f .mozconfig.out
; then \
756 cat .mozconfig.out
; \
757 rm -f .mozconfig.out
; \
761 ifdef _IS_FIRST_CHECKOUT
764 all:: checkout alldep
767 # Windows equivalents
770 build_all_dep
: alldep
771 build_all_depend
: alldep
772 clobber clobber_all
: clean
773 pull_and_build_all
: checkout alldep
775 # Do everything from scratch
776 everything
: checkout
clean build
778 ####################################
782 # @: Backup the last checkout log.
783 @if
test -f
$(CVSCO_LOGFILE
) ; then \
784 mv
$(CVSCO_LOGFILE
) $(CVSCO_LOGFILE
).old
; \
787 ifdef RUN_AUTOCONF_LOCALLY
788 @echo
"Removing local configures" ; \
790 $(RM
) -f
$(CONFIGURES
)
792 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE
)
793 @echo
'$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
795 $(CVSCO
) $(CVS_CO_DATE_FLAGS
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
796 @cd
$(ROOTDIR
) && $(MAKE
) -f mozilla
/client.mk real_checkout
798 # Start the checkout. Split the output to the tty and a log file.
802 cvs_co
() { set
-e
; echo
"$$@" ; \
803 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
804 cvs_co
$(CVSCO_NSPR
); \
805 cvs_co
$(CVSCO_NSS
); \
806 cvs_co
$(CVSCO_LDAPCSDK
); \
807 $(CHECKOUT_MODULES_NS
); \
808 $(CHECKOUT_MODULES
) \
810 @echo
"checkout finish: "`date` | tee
-a
$(CVSCO_LOGFILE
)
811 # update the NSS checkout timestamp, if we checked PSM out
812 @if
test -d
$(TOPSRCDIR
)/security
/manager
-a \
813 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
814 touch
$(TOPSRCDIR
)/security
/manager
/.nss.checkout
; \
816 ifdef RUN_AUTOCONF_LOCALLY
818 $(RM
) -f
$(CONFIGURES
)
820 # @: Check the log for conflicts. ;
821 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE)` ;\
822 if
test "$$conflicts" ; then \
823 echo
"$(MAKE): *** Conflicts during checkout." ;\
824 echo
"$$conflicts" ;\
825 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
831 # @: Backup the last checkout log.
832 @if
test -f
$(CVSCO_LOGFILE
) ; then \
833 mv
$(CVSCO_LOGFILE
) $(CVSCO_LOGFILE
).old
; \
836 ifdef RUN_AUTOCONF_LOCALLY
837 @echo
"Removing local configures" ; \
839 $(RM
) -f
$(CONFIGURES
)
841 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE
)
842 @echo
'$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
844 $(CVSCO
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
845 @cd
$(TOPSRCDIR
) && \
846 $(MAKE
) -f client.mk real_fast-update
848 # Start the update. Split the output to the tty and a log file.
851 fast_update
() { set
-e
; config
/cvsco-fast-update.pl
$$@
2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
852 cvs_co
() { set
-e
; echo
"$$@" ; \
853 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
854 fast_update
$(CVSCO_NSPR
); \
856 cvs_co
$(CVSCO_NSS
); \
858 fast_update
$(CVSCO_LDAPCSDK
); \
859 $(FASTUPDATE_MODULES
); \
860 $(FASTUPDATE_MODULES_NS
); \
861 $(FASTUPDATE_LOCALES
);
862 @echo
"fast_update finish: "`date` | tee
-a
$(CVSCO_LOGFILE
)
863 # update the NSS checkout timestamp
864 @if
test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
865 touch
$(TOPSRCDIR
)/security
/manager
/.nss.checkout
; \
867 ifdef RUN_AUTOCONF_LOCALLY
869 $(RM
) -f
$(CONFIGURES
)
871 # @: Check the log for conflicts. ;
872 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE)` ;\
873 if
test "$$conflicts" ; then \
874 echo
"$(MAKE): *** Conflicts during fast-update." ;\
875 echo
"$$conflicts" ;\
876 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
881 CVSCO_LOGFILE_L10N
:= $(ROOTDIR
)/cvsco-l10n.log
882 CVSCO_LOGFILE_L10N
:= $(shell echo
$(CVSCO_LOGFILE_L10N
) | sed s
%//%/%)
885 # @: Backup the last checkout log.
886 @if
test -f
$(CVSCO_LOGFILE_L10N
) ; then \
887 mv
$(CVSCO_LOGFILE_L10N
) $(CVSCO_LOGFILE_L10N
).old
; \
890 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE_L10N
)
891 @echo
'$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
893 $(CVSCO
) $(CVS_CO_DATE_FLAGS
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
894 @cd
$(ROOTDIR
) && $(MAKE
) -f mozilla
/client.mk real_l10n-checkout
896 FULL_EN_US_DIRS
:= toolkit \
898 $(MOZ_PROJECT_LIST
) \
901 EN_US_LOCALE_DIRS
:= $(foreach dir, \
902 $(filter-out toolkit extensions
/% $(MOZ_PROJECT_LIST
), $(LOCALE_DIRS
)), \
903 mozilla
/$(dir)/locales
)
905 EN_US_CO_DIRS
:= $(EN_US_LOCALE_DIRS
) \
906 $(foreach mod
,$(FULL_EN_US_DIRS
),mozilla
/$(mod
)) \
909 mozilla
/configure.in \
910 mozilla
/allmakefiles.sh \
915 # Start the checkout. Split the output to the tty and a log file.
918 cvs_co
() { set
-e
; echo
"$$@" ; \
919 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE_L10N
); }; \
920 cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(EN_US_CO_DIRS
); \
921 cvs_co
$(CVSCO_LOCALES
)
922 @echo
"checkout finish: "`date` | tee
-a
$(CVSCO_LOGFILE_L10N
)
923 # @: Check the log for conflicts. ;
924 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
925 if
test "$$conflicts" ; then \
926 echo
"$(MAKE): *** Conflicts during checkout." ;\
927 echo
"$$conflicts" ;\
928 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
933 #####################################################
936 ifdef _IS_FIRST_CHECKOUT
937 # First time, do build target in a new process to pick up new files.
939 $(MAKE
) -f
$(TOPSRCDIR
)/client.mk build
942 #####################################################
943 # After First Checkout
945 #####################################################
946 # Build date unification
948 ifdef MOZ_UNIFY_BDATE
949 ifndef MOZ_BUILD_DATE
950 ifdef MOZ_BUILD_PROJECTS
951 MOZ_BUILD_DATE
= $(shell $(PYTHON
) $(TOPSRCDIR
)/toolkit
/xre
/make-platformini.py
--print-buildid
)
952 export MOZ_BUILD_DATE
957 #####################################################
958 # Preflight, before building any project
960 build profiledbuild alldep preflight_all
::
961 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_PREFLIGHT_ALL
),,1))
962 # Don't run preflight_all for individual projects in multi-project builds
963 # (when MOZ_CURRENT_PROJECT is set.)
964 ifndef MOZ_BUILD_PROJECTS
965 # Building a single project, OBJDIR is usable.
967 for mkfile in
$(MOZ_PREFLIGHT_ALL
); do \
968 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight_all TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
971 # OBJDIR refers to the project-specific OBJDIR, which is not available at
972 # this point when building multiple projects. Only MOZ_OBJDIR is available.
974 for mkfile in
$(MOZ_PREFLIGHT_ALL
); do \
975 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight_all TOPSRCDIR
=$(TOPSRCDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
) MOZ_BUILD_PROJECTS
="$(MOZ_BUILD_PROJECTS)"; \
980 # If we're building multiple projects, but haven't specified which project,
983 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_BUILD_PROJECTS
),,1))
984 configure depend build profiledbuild
install export libs
clean realclean distclean alldep preflight postflight
::
986 for app in
$(MOZ_BUILD_PROJECTS
); do \
987 $(MAKE
) -f
$(TOPSRCDIR
)/client.mk
$@ MOZ_CURRENT_PROJECT
=$$app; \
992 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
993 # individual project in a multi-project build.
995 ####################################
998 CONFIG_STATUS
= $(wildcard $(OBJDIR
)/config.status
)
999 CONFIG_CACHE
= $(wildcard $(OBJDIR
)/config.cache
)
1001 ifdef RUN_AUTOCONF_LOCALLY
1002 EXTRA_CONFIG_DEPS
:= \
1003 $(TOPSRCDIR
)/aclocal.m4 \
1004 $(wildcard $(TOPSRCDIR
)/build
/autoconf
/*.m4
) \
1007 $(TOPSRCDIR
)/configure
: $(TOPSRCDIR
)/configure.in
$(EXTRA_CONFIG_DEPS
)
1008 @echo Generating
$@ using autoconf
1009 cd
$(TOPSRCDIR
); $(AUTOCONF
)
1011 $(TOPSRCDIR
)/nsprpub
/configure
: $(TOPSRCDIR
)/nsprpub
/configure.in
$(EXTRA_CONFIG_DEPS
)
1012 @echo Generating
$@ using autoconf
1013 cd
$(TOPSRCDIR
)/nsprpub
; $(AUTOCONF
)
1015 $(TOPSRCDIR
)/directory
/c-sdk
/configure
: $(TOPSRCDIR
)/directory
/c-sdk
/configure.in
$(EXTRA_CONFIG_DEPS
)
1016 @echo Generating
$@ using autoconf
1017 cd
$(TOPSRCDIR
)/directory
/c-sdk
; $(AUTOCONF
)
1020 CONFIG_STATUS_DEPS
:= \
1021 $(TOPSRCDIR
)/configure \
1022 $(TOPSRCDIR
)/.mozconfig.mk \
1023 $(wildcard $(TOPSRCDIR
)/nsprpub
/configure
) \
1024 $(wildcard $(TOPSRCDIR
)/directory
/c-sdk
/configure
) \
1025 $(wildcard $(TOPSRCDIR
)/config
/milestone.txt
) \
1026 $(wildcard $(TOPSRCDIR
)/config
/chrome-versions.sh
) \
1027 $(wildcard $(addsuffix confvars.sh
,$(wildcard */))) \
1030 # configure uses the program name to determine @srcdir@. Calling it without
1031 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1032 # path of $(TOPSRCDIR).
1033 ifeq ($(TOPSRCDIR
),$(OBJDIR
))
1034 CONFIGURE
= .
/configure
1036 CONFIGURE
= $(TOPSRCDIR
)/configure
1040 CONFIGURE
= $(TOPSRCDIR
)/configure
1043 configure
:: $(CONFIGURES
)
1044 ifdef MOZ_BUILD_PROJECTS
1045 @if
test ! -d
$(MOZ_OBJDIR
); then
$(MKDIR
) $(MOZ_OBJDIR
); else true
; fi
1047 @if
test ! -d
$(OBJDIR
); then
$(MKDIR
) $(OBJDIR
); else true
; fi
1049 @echo
$(CONFIGURE
) $(CONFIGURE_ARGS
)
1050 @cd
$(OBJDIR
) && $(BUILD_PROJECT_ARG
) $(CONFIGURE_ENV_ARGS
) $(CONFIGURE
) $(CONFIGURE_ARGS
) \
1051 ||
( echo
"*** Fix above errors and then restart with\
1052 \"$(MAKE) -f client.mk build\"" && exit
1 )
1053 @touch
$(OBJDIR
)/Makefile
1055 $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
: $(CONFIG_STATUS_DEPS
)
1056 @
$(MAKE
) -f
$(TOPSRCDIR
)/client.mk configure
1058 ifneq (,$(CONFIG_STATUS
))
1059 $(OBJDIR
)/config
/autoconf.mk
: $(TOPSRCDIR
)/config
/autoconf.mk.in
1061 CONFIG_FILES
=config
/autoconf.mk .
/config.status
1065 ####################################
1068 depend
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1069 $(MOZ_MAKE
) export && $(MOZ_MAKE
) depend
1071 ####################################
1074 build profiledbuild alldep preflight
::
1077 for mkfile in
$(MOZ_PREFLIGHT
); do \
1078 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1082 ####################################
1085 build
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1088 ####################################
1089 # Profile-feedback build (gcc only)
1090 # To use this, you should set the following variables in your mozconfig
1091 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
1093 # The profile script should exercise the functionality to be included
1094 # in the profile feedback.
1096 profiledbuild
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1097 $(MOZ_MAKE
) MOZ_PROFILE_GENERATE
=1
1098 OBJDIR
=${OBJDIR} $(PROFILE_GEN_SCRIPT
)
1099 $(MOZ_MAKE
) clobber_all
1100 $(MOZ_MAKE
) MOZ_PROFILE_USE
=1
1101 find
$(OBJDIR
) -name
"*.da" -exec
rm {} \
;
1103 ####################################
1106 # Pass these target onto the real build system
1107 install export libs
clean realclean distclean alldep
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1110 ####################################
1113 build profiledbuild alldep postflight
::
1114 ifdef MOZ_POSTFLIGHT
1116 for mkfile in
$(MOZ_POSTFLIGHT
); do \
1117 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1121 endif # MOZ_CURRENT_PROJECT
1123 ####################################
1124 # Postflight, after building all projects
1126 build profiledbuild alldep postflight_all
::
1127 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_POSTFLIGHT_ALL
),,1))
1128 # Don't run postflight_all for individual projects in multi-project builds
1129 # (when MOZ_CURRENT_PROJECT is set.)
1130 ifndef MOZ_BUILD_PROJECTS
1131 # Building a single project, OBJDIR is usable.
1133 for mkfile in
$(MOZ_POSTFLIGHT_ALL
); do \
1134 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight_all TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1137 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1138 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1140 for mkfile in
$(MOZ_POSTFLIGHT_ALL
); do \
1141 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight_all TOPSRCDIR
=$(TOPSRCDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
) MOZ_BUILD_PROJECTS
="$(MOZ_BUILD_PROJECTS)"; \
1148 if
[ -f Makefile
]; then \
1149 $(MAKE
) distclean ; \
1151 echo
"Removing object files from srcdir..."; \
1152 rm -fr
`find . -type d \( -name .deps -print -o -name CVS \
1153 -o -exec test ! -d {}/CVS \; \) -prune \
1154 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1155 build
/autoconf
/clean-config.sh
; \
1158 # (! IS_FIRST_CHECKOUT)
1164 .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