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://www.mozilla.org/build/ for more information.
85 # MOZ_BUILD_PROJECTS - Build multiple projects in subdirectories
87 # MOZ_OBJDIR - Destination object directory
88 # MOZ_CO_DATE - Date tag to use for checkout (default: none)
89 # MOZ_CO_LOCALES_DATE - Date tag to use for locale checkout
90 # (default: MOZ_CO_DATE)
91 # MOZ_CO_MODULE - Module to checkout
92 # MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3)
93 # MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P)
94 # MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
95 # MOZ_CO_LOCALES - localizations to pull (MOZ_CO_LOCALES="de-DE,pt-BR")
96 # MOZ_LOCALE_DIRS - directories which contain localizations
97 # LOCALES_CVSROOT - CVSROOT to use to pull localizations
98 # MOZ_PREFLIGHT_ALL } - Makefiles to run before any project in
99 # MOZ_PREFLIGHT } MOZ_BUILD_PROJECTS, before each project, after
100 # MOZ_POSTFLIGHT } each project, and after all projects; these
101 # MOZ_POSTFLIGHT_ALL } variables contain space-separated lists
102 # MOZ_UNIFY_BDATE - Set to use the same bdate for each project in
106 AVAILABLE_PROJECTS
= \
121 # Trailing / on top-level mozilla dir required to stop fast-update thinking
122 # it is a module name.
123 MODULES_NS_necko
:= \
132 mozilla
/modules
/libpref \
133 mozilla
/modules
/zlib \
136 mozilla
/tools
/test-harness \
140 $(MODULES_NS_necko
) \
162 mozilla
/js
/src
/fdlibm \
163 mozilla
/js
/src
/liveconnect \
164 mozilla
/js
/src
/xpconnect \
166 mozilla
/modules
/lcms \
167 mozilla
/modules
/libimg \
168 mozilla
/modules
/libjar \
169 mozilla
/modules
/libpr0n \
170 mozilla
/modules
/libreg \
171 mozilla
/modules
/libutil \
172 mozilla
/modules
/oji \
173 mozilla
/modules
/plugin \
174 mozilla
/modules
/staticmod \
178 mozilla
/security
/manager \
181 mozilla
/modules
/libpr0n \
182 mozilla
/modules
/libmar \
183 mozilla
/modules
/libbz2 \
185 mozilla
/other-licenses
/atk-1.0 \
186 mozilla
/other-licenses
/ia2 \
187 mozilla
/security
/manager \
188 mozilla
/tools
/elf-dynstr-gc \
198 mozilla
/db
/morkreader \
199 mozilla
/testing
/mochitest \
212 mozilla
/browser
/config
/version.txt \
213 mozilla
/mail
/config
/version.txt \
214 mozilla
/calendar
/sunbird
/config
/version.txt \
215 mozilla
/suite
/config
/version.txt \
222 MODULES_NS_toolkit
:= \
237 BOOTSTRAP_toolkit
:= \
241 MODULES_NS_suite
:= \
242 $(MODULES_NS_toolkit
) \
247 mozilla
/directory
/xpcom \
251 mozilla
/other-licenses
/7zstub
/seamonkey \
258 extensions
/reporter \
262 $(BOOTSTRAP_toolkit
) \
265 MODULES_NS_browser
:= \
266 $(MODULES_NS_toolkit
) \
272 mozilla
/other-licenses
/branding
/firefox \
273 mozilla
/other-licenses
/7zstub
/firefox \
279 extensions
/reporter \
280 extensions
/spellcheck \
281 other-licenses
/branding
/firefox \
284 BOOTSTRAP_browser
:= \
285 $(BOOTSTRAP_toolkit
) \
286 mozilla
/browser
/config
/mozconfig \
289 MODULES_NS_minimo
:= \
290 $(MODULES_NS_toolkit
) \
298 BOOTSTRAP_minimo
:= \
299 $(BOOTSTRAP_toolkit
) \
303 $(MODULES_NS_toolkit
) \
308 mozilla
/directory
/xpcom \
311 mozilla
/other-licenses
/branding
/thunderbird \
312 mozilla
/other-licenses
/7zstub
/thunderbird \
318 other-licenses
/branding
/thunderbird \
320 extensions
/spellcheck \
324 $(BOOTSTRAP_toolkit
) \
325 mozilla
/mail
/config
/mozconfig \
328 MODULES_composer
:= \
333 MODULES_NS_calendar
:= \
334 $(MODULES_NS_toolkit
) \
337 MODULES_calendar
:= \
342 mozilla
/other-licenses
/branding
/sunbird \
343 mozilla
/other-licenses
/7zstub
/sunbird \
346 LOCALES_calendar
:= \
349 other-licenses
/branding
/sunbird \
352 BOOTSTRAP_calendar
:= \
353 $(BOOTSTRAP_toolkit
) \
354 mozilla
/calendar
/sunbird
/config
/mozconfig \
357 MODULES_NS_xulrunner
:= \
358 $(MODULES_NS_toolkit
) \
361 MODULES_xulrunner
:= \
366 LOCALES_xulrunner
:= \
370 BOOTSTRAP_xulrunner
:= \
371 $(BOOTSTRAP_toolkit
) \
372 mozilla
/xulrunner
/config
/mozconfig \
375 MODULES_NS_camino
:= \
376 $(MODULES_NS_toolkit
) \
385 BOOTSTRAP_camino
:= \
386 $(BOOTSTRAP_toolkit
) \
387 mozilla
/camino
/config
/mozconfig \
392 mozilla
/modules
/zlib \
396 mozilla
/other-licenses
/bsdiff \
397 mozilla
/other-licenses
/libart_lgpl \
398 mozilla
/tools
/trace-malloc \
399 mozilla
/tools
/jprof \
400 mozilla
/tools
/codesighs \
401 mozilla
/tools
/update-packaging \
404 #######################################################################
407 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
408 # and commit this file on that tag.
410 NSPR_CO_TAG
= NSPR_HEAD_20070820
411 NSS_CO_TAG
= NSS_3_12_ALPHA1B
412 LDAPCSDK_CO_TAG
= LDAPCSDK_6_0_3_CLIENT_BRANCH
415 #######################################################################
422 ifneq (1,$(words $(CWD
)))
423 $(error The mozilla directory cannot be located in a path with spaces.
)
430 ifneq (, $(wildcard client.mk
))
431 # Ran from mozilla directory
432 ROOTDIR
:= $(shell dirname
$(CWD
))
435 # Ran from mozilla/.. directory (?)
437 TOPSRCDIR
:= $(CWD
)/mozilla
440 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
441 # work; replace first instance with one forward slash
442 TOPSRCDIR
:= $(shell echo
"$(TOPSRCDIR)" | sed
-e
's%//%/%')
445 TOPSRCDIR_MOZ
=$(TOPSRCDIR
)
448 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
449 DIRNAME
:= $(shell echo
"$(ROOTDIR)" | sed
-e
's/^.://')
463 CONFIG_GUESS_SCRIPT
:= $(wildcard $(TOPSRCDIR
)/build
/autoconf
/config.guess
)
464 ifdef CONFIG_GUESS_SCRIPT
465 CONFIG_GUESS
= $(shell $(CONFIG_GUESS_SCRIPT
))
467 _IS_FIRST_CHECKOUT
:= 1
470 ####################################
473 ifneq (,$(filter MINGW
%,$(shell uname
-s
)))
474 # check for CRLF line endings
475 ifneq (0,$(shell $(PERL
) -e
'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR
)/client.mk
))
476 $(error This source tree appears to have Windows-style line endings. To \
477 convert it to Unix-style line endings
, run \
478 "python mozilla/build/win32/mozilla-dos2unix.py")
482 ####################################
485 # Add the CVS root to CVS_FLAGS if needed
486 CVS_ROOT_IN_TREE
:= $(shell cat
$(TOPSRCDIR
)/CVS
/Root
2>/dev
/null
)
487 ifneq ($(CVS_ROOT_IN_TREE
),)
488 ifneq ($(CVS_ROOT_IN_TREE
),$(CVSROOT
))
489 CVS_FLAGS
:= -d
$(CVS_ROOT_IN_TREE
)
493 CVS_CO_DATE_FLAGS
= $(if
$(MOZ_CO_DATE
),-D
"$(MOZ_CO_DATE)")
494 CVS_CO_LOCALES_DATE_FLAGS
= $(if
$(MOZ_CO_LOCALES_DATE
),-D
"$(MOZ_CO_LOCALES_DATE)")
495 CVSCO
= $(CVS
) $(CVS_FLAGS
) co $(MOZ_CO_FLAGS
) $(if
$(MOZ_CO_TAG
),-r
$(MOZ_CO_TAG
)) $(CVS_CO_DATE_FLAGS
)
497 MOZ_CO_LOCALES_DATE ?
= $(MOZ_CO_DATE
)
499 CVSCO_LOGFILE
:= $(ROOTDIR
)/cvsco.log
500 CVSCO_LOGFILE
:= $(shell echo
$(CVSCO_LOGFILE
) | sed s
%//%/%)
502 # if LOCALES_CVSROOT is not specified, set it here
503 # (and let mozconfig override it)
504 LOCALES_CVSROOT ?
= :pserver
:anonymous
:anonymous@cvs-mirror.mozilla.org
:/l10n
506 ####################################
507 # Load mozconfig Options
509 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
511 MOZCONFIG_LOADER
:= mozilla
/build
/autoconf
/mozconfig2client-mk
512 MOZCONFIG_FINDER
:= mozilla
/build
/autoconf
/mozconfig-find
513 MOZCONFIG_MODULES
:= mozilla
/build
/unix
/uniq.pl
514 run_for_side_effects
:= \
515 $(shell cd
$(ROOTDIR
); \
516 if
test "$(_IS_FIRST_CHECKOUT)"; then \
517 $(CVSCO
) $(MOZCONFIG_FINDER
) $(MOZCONFIG_LOADER
) $(MOZCONFIG_MODULES
); \
520 $(MOZCONFIG_LOADER
) $(TOPSRCDIR
) mozilla
/.mozconfig.mk
> mozilla
/.mozconfig.out
)
521 include $(TOPSRCDIR
)/.mozconfig.mk
523 ####################################
524 # Options that may come from mozconfig
526 MOZ_PROJECT_LIST
:= $(subst $(comma
), ,$(MOZ_CO_PROJECT
))
527 MOZ_PROJECT_LIST
:= $(subst macbrowser
,camino
,$(MOZ_PROJECT_LIST
))
529 ifneq (,$(filter-out $(AVAILABLE_PROJECTS
),$(MOZ_PROJECT_LIST
)))
530 $(error MOZ_CO_PROJECT contains an unrecognized project.
)
533 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST
)))
534 MOZ_PROJECT_LIST
:= $(AVAILABLE_PROJECTS
)
537 MOZ_MODULE_LIST
:= $(subst $(comma
), ,$(MOZ_CO_MODULE
)) $(foreach project
,$(MOZ_PROJECT_LIST
),$(MODULES_
$(project
)))
538 MOZ_MODULE_LIST_NS
:= $(foreach project
,$(MOZ_PROJECT_LIST
),$(MODULES_NS_
$(project
)))
539 LOCALE_DIRS
:= $(MOZ_LOCALE_DIRS
) $(foreach project
,$(MOZ_PROJECT_LIST
),$(LOCALES_
$(project
)))
541 MOZCONFIG_MODULES
+= $(foreach project
,$(MOZ_PROJECT_LIST
),$(BOOTSTRAP_
$(project
)))
543 # Using $(sort) here because it also removes duplicate entries.
544 MOZ_MODULE_LIST
:= $(sort $(MOZ_MODULE_LIST
))
545 LOCALE_DIRS
:= $(sort $(LOCALE_DIRS
))
546 MOZCONFIG_MODULES
:= $(sort $(MOZCONFIG_MODULES
))
548 # Change CVS flags if anonymous root is requested
549 ifdef MOZ_CO_USE_MIRROR
550 CVS_FLAGS
:= -d
:pserver
:anonymous
:anonymous@cvs-mirror.mozilla.org
:/cvsroot
553 # MOZ_CVS_FLAGS - Basic CVS flags
554 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
555 CVS_FLAGS
:= $(CVS_FLAGS
) -q
-z
3
557 CVS_FLAGS
:= $(MOZ_CVS_FLAGS
)
560 ifdef MOZ_BUILD_PROJECTS
563 $(error When MOZ_BUILD_PROJECTS is set
, you must set MOZ_OBJDIR
)
565 ifdef MOZ_CURRENT_PROJECT
566 OBJDIR
= $(MOZ_OBJDIR
)/$(MOZ_CURRENT_PROJECT
)
567 MOZ_MAKE
= $(MAKE
) $(MOZ_MAKE_FLAGS
) -C
$(OBJDIR
)
568 BUILD_PROJECT_ARG
= MOZ_BUILD_APP
=$(MOZ_CURRENT_PROJECT
)
570 OBJDIR
= $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.
)
571 MOZ_MAKE
= $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.
)
574 else # MOZ_BUILD_PROJECTS
577 OBJDIR
= $(MOZ_OBJDIR
)
578 MOZ_MAKE
= $(MAKE
) $(MOZ_MAKE_FLAGS
) -C
$(OBJDIR
)
580 OBJDIR
:= $(TOPSRCDIR
)
581 MOZ_MAKE
:= $(MAKE
) $(MOZ_MAKE_FLAGS
)
584 endif # MOZ_BUILD_PROJECTS
586 ####################################
587 # CVS defines for NSS
591 mozilla
/security
/nss \
592 mozilla
/security
/coreconf \
593 mozilla
/security
/dbm \
598 NSS_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
600 NSS_CO_FLAGS
:= $(NSS_CO_FLAGS
) $(if
$(NSS_CO_TAG
),-r
$(NSS_CO_TAG
),-A
)
602 # Can only pull the tip or branch tags by date
603 ifeq (,$(filter-out HEAD
%BRANCH
,$(NSS_CO_TAG
)))
604 CVSCO_NSS
= $(CVS
) $(CVS_FLAGS
) co $(NSS_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(NSS_CO_MODULE
)
606 CVSCO_NSS
= $(CVS
) $(CVS_FLAGS
) co $(NSS_CO_FLAGS
) $(NSS_CO_MODULE
)
609 ####################################
610 # CVS defines for NSPR
612 NSPR_CO_MODULE
= mozilla
/nsprpub
615 NSPR_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
617 NSPR_CO_FLAGS
:= $(NSPR_CO_FLAGS
) $(if
$(NSPR_CO_TAG
),-r
$(NSPR_CO_TAG
),-A
)
619 # Can only pull the tip or branch tags by date
620 ifeq (,$(filter-out HEAD
%BRANCH
,$(NSPR_CO_TAG
)))
621 CVSCO_NSPR
= $(CVS
) $(CVS_FLAGS
) co $(NSPR_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(NSPR_CO_MODULE
)
623 CVSCO_NSPR
= $(CVS
) $(CVS_FLAGS
) co $(NSPR_CO_FLAGS
) $(NSPR_CO_MODULE
)
626 ####################################
627 # CVS defines for the C LDAP SDK
629 LDAPCSDK_CO_MODULE
= mozilla
/directory
/c-sdk
630 LDAPCSDK_CO_FLAGS
:= -P
632 LDAPCSDK_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
634 LDAPCSDK_CO_FLAGS
:= $(LDAPCSDK_CO_FLAGS
) $(if
$(LDAPCSDK_CO_TAG
),-r
$(LDAPCSDK_CO_TAG
),-A
)
636 # Can only pull the tip or branch tags by date
637 ifeq (,$(filter-out HEAD
%BRANCH
,$(LDAPCSDK_CO_TAG
)))
638 CVSCO_LDAPCSDK
= $(CVS
) $(CVS_FLAGS
) co $(LDAPCSDK_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(LDAPCSDK_CO_MODULE
)
640 CVSCO_LDAPCSDK
= $(CVS
) $(CVS_FLAGS
) co $(LDAPCSDK_CO_FLAGS
) $(LDAPCSDK_CO_MODULE
)
643 ####################################
644 # Error on obsolete variables.
648 $(warning MOZ_MAPINFO is obsolete
, use MOZ_CO_MODULE
=mozilla
/tools
/codesighs instead.
)
649 MOZ_MODULE_LIST
+= mozilla
/tools
/codesighs
651 ifdef MOZ_INTERNAL_LIBART_LGPL
652 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete
, use MOZ_CO_MODULE
=mozilla
/other-licenses
/libart_lgpl instead.
)
655 $(warning MOZ_PHOENIX is obsolete.
)
656 MOZ_MODULE_LIST
+= $(MODULES_browser
)
657 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
659 ifdef MOZ_THUNDERBIRD
660 $(warning MOZ_THUNDERBIRD is obsolete.
)
661 MOZ_MODULE_LIST
+= $(MODULES_mail
)
662 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
665 ###################################
666 # Checkout main modules
669 # sort is used to remove duplicates.
670 MOZ_MODULE_LIST
:= $(sort $(MOZ_MODULE_LIST
))
671 MOZ_MODULE_LIST_NS
:= $(sort $(MOZ_MODULE_LIST_NS
))
673 ####################################
674 # Suppress standalone modules if they're not needed.
676 CONFIGURES
:= $(TOPSRCDIR
)/configure
677 ifeq (,$(filter mozilla
/xpcom
,$(MOZ_MODULE_LIST
)))
680 CONFIGURES
+= $(TOPSRCDIR
)/nsprpub
/configure
683 ifeq (,$(filter mozilla
/security
/manager
,$(MOZ_MODULE_LIST
)))
686 ifeq (,$(filter mozilla
/directory
/xpcom
,$(MOZ_MODULE_LIST
)))
689 CONFIGURES
+= $(TOPSRCDIR
)/directory
/c-sdk
/configure
692 MODULES_CO_FLAGS
:= -P
694 MODULES_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
696 MODULES_CO_FLAGS
:= $(MODULES_CO_FLAGS
) $(if
$(MOZ_CO_TAG
),-r
$(MOZ_CO_TAG
),-A
)
698 CVSCO_MODULES_NS
= $(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) -l
$(MOZ_MODULE_LIST_NS
)
700 ifeq (,$(strip $(MOZ_MODULE_LIST
)))
701 FASTUPDATE_MODULES
= $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.
)
702 CHECKOUT_MODULES
= $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.
)
704 FASTUPDATE_MODULES
:= fast_update
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(MOZ_MODULE_LIST
)
705 CHECKOUT_MODULES
:= cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(MOZ_MODULE_LIST
);
707 ifeq (,$(MOZ_MODULE_LIST_NS
))
708 FASTUPDATE_MODULES_NS
:= true
709 CHECKOUT_MODULES_NS
:= true
711 FASTUPDATE_MODULES_NS
:= fast_update
$(CVSCO_MODULES_NS
)
712 CHECKOUT_MODULES_NS
:= cvs_co
$(CVSCO_MODULES_NS
)
715 ###################################
716 # CVS defines for locales
719 LOCALES_CO_FLAGS
:= -P
721 LOCALES_CO_FLAGS
:= $(MOZ_CO_FLAGS
)
723 LOCALES_CO_FLAGS
:= $(LOCALES_CO_FLAGS
) $(if
$(LOCALES_CO_TAG
),-r
$(LOCALES_CO_TAG
),-A
)
725 ifndef MOZ_CO_LOCALES
726 FASTUPDATE_LOCALES
:= true
727 CHECKOUT_LOCALES
:= true
730 override MOZ_CO_LOCALES
:= $(subst $(comma
), ,$(MOZ_CO_LOCALES
))
732 ifeq (all,$(MOZ_CO_LOCALES
))
733 MOZCONFIG_MODULES
+= $(foreach project
,$(MOZ_PROJECT_LIST
),mozilla
/$(project
)/locales
/all-locales
)
735 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)))))
736 else # MOZ_CO_LOCALES != all
737 LOCALE_CO_DIRS
= $(sort $(foreach locale
,$(MOZ_CO_LOCALES
),$(foreach dir,$(LOCALE_DIRS
),l10n
/$(locale
)/$(dir))))
740 CVSCO_LOCALES
:= $(CVS
) $(CVS_FLAGS
) -d
$(LOCALES_CVSROOT
) co $(LOCALES_CO_FLAGS
) $(CVS_CO_LOCALES_DATE_FLAGS
) $(LOCALE_CO_DIRS
)
742 FASTUPDATE_LOCALES
:= fast_update
$(CVSCO_LOCALES
)
743 CHECKOUT_LOCALES
:= cvs_co
$(CVSCO_LOCALES
)
744 endif #MOZ_CO_LOCALES
746 #######################################################################
750 # Print out any options loaded from mozconfig.
751 all build checkout
clean depend
distclean export libs
install realclean::
752 @if
test -f .mozconfig.out
; then \
753 cat .mozconfig.out
; \
754 rm -f .mozconfig.out
; \
758 ifdef _IS_FIRST_CHECKOUT
761 all:: checkout alldep
764 # Windows equivalents
767 build_all_dep
: alldep
768 build_all_depend
: alldep
769 clobber clobber_all
: clean
770 pull_and_build_all
: checkout alldep
772 # Do everything from scratch
773 everything
: checkout
clean build
775 ####################################
779 # @: Backup the last checkout log.
780 @if
test -f
$(CVSCO_LOGFILE
) ; then \
781 mv
$(CVSCO_LOGFILE
) $(CVSCO_LOGFILE
).old
; \
784 ifdef RUN_AUTOCONF_LOCALLY
785 @echo
"Removing local configures" ; \
787 $(RM
) -f
$(CONFIGURES
)
789 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE
)
790 @echo
'$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
792 $(CVSCO
) $(CVS_CO_DATE_FLAGS
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
793 @cd
$(ROOTDIR
) && $(MAKE
) -f mozilla
/client.mk real_checkout
795 # Start the checkout. Split the output to the tty and a log file.
799 cvs_co
() { set
-e
; echo
"$$@" ; \
800 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
801 cvs_co
$(CVSCO_NSPR
); \
802 cvs_co
$(CVSCO_NSS
); \
803 cvs_co
$(CVSCO_LDAPCSDK
); \
804 $(CHECKOUT_MODULES_NS
); \
805 $(CHECKOUT_MODULES
) \
807 @echo
"checkout finish: "`date` | tee
-a
$(CVSCO_LOGFILE
)
808 # update the NSS checkout timestamp, if we checked PSM out
809 @if
test -d
$(TOPSRCDIR
)/security
/manager
-a \
810 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
811 touch
$(TOPSRCDIR
)/security
/manager
/.nss.checkout
; \
813 ifdef RUN_AUTOCONF_LOCALLY
815 $(RM
) -f
$(CONFIGURES
)
817 # @: Check the log for conflicts. ;
818 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE)` ;\
819 if
test "$$conflicts" ; then \
820 echo
"$(MAKE): *** Conflicts during checkout." ;\
821 echo
"$$conflicts" ;\
822 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
828 # @: Backup the last checkout log.
829 @if
test -f
$(CVSCO_LOGFILE
) ; then \
830 mv
$(CVSCO_LOGFILE
) $(CVSCO_LOGFILE
).old
; \
833 ifdef RUN_AUTOCONF_LOCALLY
834 @echo
"Removing local configures" ; \
836 $(RM
) -f
$(CONFIGURES
)
838 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE
)
839 @echo
'$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
841 $(CVSCO
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
842 @cd
$(TOPSRCDIR
) && \
843 $(MAKE
) -f client.mk real_fast-update
845 # Start the update. Split the output to the tty and a log file.
848 fast_update
() { set
-e
; config
/cvsco-fast-update.pl
$$@
2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
849 cvs_co
() { set
-e
; echo
"$$@" ; \
850 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE
); }; \
851 fast_update
$(CVSCO_NSPR
); \
853 cvs_co
$(CVSCO_NSS
); \
855 fast_update
$(CVSCO_LDAPCSDK
); \
856 $(FASTUPDATE_MODULES
); \
857 $(FASTUPDATE_MODULES_NS
); \
858 $(FASTUPDATE_LOCALES
);
859 @echo
"fast_update finish: "`date` | tee
-a
$(CVSCO_LOGFILE
)
860 # update the NSS checkout timestamp
861 @if
test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
862 touch
$(TOPSRCDIR
)/security
/manager
/.nss.checkout
; \
864 ifdef RUN_AUTOCONF_LOCALLY
866 $(RM
) -f
$(CONFIGURES
)
868 # @: Check the log for conflicts. ;
869 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE)` ;\
870 if
test "$$conflicts" ; then \
871 echo
"$(MAKE): *** Conflicts during fast-update." ;\
872 echo
"$$conflicts" ;\
873 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
878 CVSCO_LOGFILE_L10N
:= $(ROOTDIR
)/cvsco-l10n.log
879 CVSCO_LOGFILE_L10N
:= $(shell echo
$(CVSCO_LOGFILE_L10N
) | sed s
%//%/%)
882 # @: Backup the last checkout log.
883 @if
test -f
$(CVSCO_LOGFILE_L10N
) ; then \
884 mv
$(CVSCO_LOGFILE_L10N
) $(CVSCO_LOGFILE_L10N
).old
; \
887 @echo
"checkout start: "`date` | tee
$(CVSCO_LOGFILE_L10N
)
888 @echo
'$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
890 $(CVSCO
) $(CVS_CO_DATE_FLAGS
) mozilla
/client.mk
$(MOZCONFIG_MODULES
)
891 @cd
$(ROOTDIR
) && $(MAKE
) -f mozilla
/client.mk real_l10n-checkout
893 EN_US_CO_DIRS
:= $(sort $(foreach dir,$(LOCALE_DIRS
),mozilla
/$(dir)/locales
)) \
894 $(foreach mod
,$(MOZ_PROJECT_LIST
),mozilla
/$(mod
)/config
) \
896 $(MOZCONFIG_MODULES
) \
898 mozilla
/configure.in \
899 mozilla
/allmakefiles.sh \
904 EN_US_CO_FILES_NS
:= \
905 mozilla
/toolkit
/mozapps
/installer \
908 # Start the checkout. Split the output to the tty and a log file.
911 cvs_co
() { set
-e
; echo
"$$@" ; \
912 "$$@" 2>&1 | tee
-a
$(CVSCO_LOGFILE_L10N
); }; \
913 cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) $(EN_US_CO_DIRS
); \
914 cvs_co
$(CVS
) $(CVS_FLAGS
) co $(MODULES_CO_FLAGS
) $(CVS_CO_DATE_FLAGS
) -l
$(EN_US_CO_FILES_NS
); \
915 cvs_co
$(CVSCO_LOCALES
)
916 @echo
"checkout finish: "`date` | tee
-a
$(CVSCO_LOGFILE_L10N
)
917 # @: Check the log for conflicts. ;
918 @conflicts
=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
919 if
test "$$conflicts" ; then \
920 echo
"$(MAKE): *** Conflicts during checkout." ;\
921 echo
"$$conflicts" ;\
922 echo
"$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
927 #####################################################
930 ifdef _IS_FIRST_CHECKOUT
931 # First time, do build target in a new process to pick up new files.
933 $(MAKE
) -f
$(TOPSRCDIR
)/client.mk build
936 #####################################################
937 # After First Checkout
939 #####################################################
940 # Build date unification
942 ifdef MOZ_UNIFY_BDATE
943 ifndef MOZ_BUILD_DATE
944 ifdef MOZ_BUILD_PROJECTS
945 MOZ_BUILD_DATE
= $(shell $(PYTHON
) $(TOPSRCDIR
)/toolkit
/xre
/make-platformini.py
--print-buildid
)
946 export MOZ_BUILD_DATE
951 #####################################################
952 # Preflight, before building any project
954 build profiledbuild alldep preflight_all
::
955 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_PREFLIGHT_ALL
),,1))
956 # Don't run preflight_all for individual projects in multi-project builds
957 # (when MOZ_CURRENT_PROJECT is set.)
958 ifndef MOZ_BUILD_PROJECTS
959 # Building a single project, OBJDIR is usable.
961 for mkfile in
$(MOZ_PREFLIGHT_ALL
); do \
962 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight_all TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
965 # OBJDIR refers to the project-specific OBJDIR, which is not available at
966 # this point when building multiple projects. Only MOZ_OBJDIR is available.
968 for mkfile in
$(MOZ_PREFLIGHT_ALL
); do \
969 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight_all TOPSRCDIR
=$(TOPSRCDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
) MOZ_BUILD_PROJECTS
="$(MOZ_BUILD_PROJECTS)"; \
974 # If we're building multiple projects, but haven't specified which project,
977 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_BUILD_PROJECTS
),,1))
978 configure depend build profiledbuild
install export libs
clean realclean distclean alldep preflight postflight
::
980 for app in
$(MOZ_BUILD_PROJECTS
); do \
981 $(MAKE
) -f
$(TOPSRCDIR
)/client.mk
$@ MOZ_CURRENT_PROJECT
=$$app; \
986 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
987 # individual project in a multi-project build.
989 ####################################
992 CONFIG_STATUS
= $(wildcard $(OBJDIR
)/config.status
)
993 CONFIG_CACHE
= $(wildcard $(OBJDIR
)/config.cache
)
995 ifdef RUN_AUTOCONF_LOCALLY
996 EXTRA_CONFIG_DEPS
:= \
997 $(TOPSRCDIR
)/aclocal.m4 \
998 $(wildcard $(TOPSRCDIR
)/build
/autoconf
/*.m4
) \
1001 $(TOPSRCDIR
)/configure
: $(TOPSRCDIR
)/configure.in
$(EXTRA_CONFIG_DEPS
)
1002 @echo Generating
$@ using autoconf
1003 cd
$(TOPSRCDIR
); $(AUTOCONF
)
1005 $(TOPSRCDIR
)/nsprpub
/configure
: $(TOPSRCDIR
)/nsprpub
/configure.in
$(EXTRA_CONFIG_DEPS
)
1006 @echo Generating
$@ using autoconf
1007 cd
$(TOPSRCDIR
)/nsprpub
; $(AUTOCONF
)
1009 $(TOPSRCDIR
)/directory
/c-sdk
/configure
: $(TOPSRCDIR
)/directory
/c-sdk
/configure.in
$(EXTRA_CONFIG_DEPS
)
1010 @echo Generating
$@ using autoconf
1011 cd
$(TOPSRCDIR
)/directory
/c-sdk
; $(AUTOCONF
)
1014 CONFIG_STATUS_DEPS
:= \
1015 $(TOPSRCDIR
)/configure \
1016 $(TOPSRCDIR
)/allmakefiles.sh \
1017 $(TOPSRCDIR
)/.mozconfig.mk \
1018 $(wildcard $(TOPSRCDIR
)/nsprpub
/configure
) \
1019 $(wildcard $(TOPSRCDIR
)/directory
/c-sdk
/configure
) \
1020 $(wildcard $(TOPSRCDIR
)/mailnews
/makefiles
) \
1021 $(wildcard $(TOPSRCDIR
)/themes
/makefiles
) \
1022 $(wildcard $(TOPSRCDIR
)/config
/milestone.txt
) \
1023 $(wildcard $(TOPSRCDIR
)/config
/chrome-versions.sh
) \
1026 # configure uses the program name to determine @srcdir@. Calling it without
1027 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1028 # path of $(TOPSRCDIR).
1029 ifeq ($(TOPSRCDIR
),$(OBJDIR
))
1030 CONFIGURE
= .
/configure
1032 CONFIGURE
= $(TOPSRCDIR
)/configure
1036 CONFIGURE
= $(TOPSRCDIR
)/configure
1039 configure
:: $(CONFIGURES
)
1040 ifdef MOZ_BUILD_PROJECTS
1041 @if
test ! -d
$(MOZ_OBJDIR
); then
$(MKDIR
) $(MOZ_OBJDIR
); else true
; fi
1043 @if
test ! -d
$(OBJDIR
); then
$(MKDIR
) $(OBJDIR
); else true
; fi
1045 @echo
$(CONFIGURE
) $(CONFIGURE_ARGS
)
1046 @cd
$(OBJDIR
) && $(BUILD_PROJECT_ARG
) $(CONFIGURE_ENV_ARGS
) $(CONFIGURE
) $(CONFIGURE_ARGS
) \
1047 ||
( echo
"*** Fix above errors and then restart with\
1048 \"$(MAKE) -f client.mk build\"" && exit
1 )
1049 @touch
$(OBJDIR
)/Makefile
1051 $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
: $(CONFIG_STATUS_DEPS
)
1052 @
$(MAKE
) -f
$(TOPSRCDIR
)/client.mk configure
1054 ifneq (,$(CONFIG_STATUS
))
1055 $(OBJDIR
)/config
/autoconf.mk
: $(TOPSRCDIR
)/config
/autoconf.mk.in
1057 CONFIG_FILES
=config
/autoconf.mk .
/config.status
1061 ####################################
1064 depend
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1065 $(MOZ_MAKE
) export && $(MOZ_MAKE
) depend
1067 ####################################
1070 build profiledbuild alldep preflight
::
1073 for mkfile in
$(MOZ_PREFLIGHT
); do \
1074 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile preflight TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1078 ####################################
1081 build
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1084 ####################################
1085 # Profile-feedback build (gcc only)
1086 # To use this, you should set the following variables in your mozconfig
1087 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
1089 # The profile script should exercise the functionality to be included
1090 # in the profile feedback.
1092 profiledbuild
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1093 $(MOZ_MAKE
) MOZ_PROFILE_GENERATE
=1
1094 OBJDIR
=${OBJDIR} $(PROFILE_GEN_SCRIPT
)
1095 $(MOZ_MAKE
) clobber_all
1096 $(MOZ_MAKE
) MOZ_PROFILE_USE
=1
1097 find
$(OBJDIR
) -name
"*.da" -exec
rm {} \
;
1099 ####################################
1102 # Pass these target onto the real build system
1103 install export libs
clean realclean distclean alldep
:: $(OBJDIR
)/Makefile
$(OBJDIR
)/config.status
1106 ####################################
1109 build profiledbuild alldep postflight
::
1110 ifdef MOZ_POSTFLIGHT
1112 for mkfile in
$(MOZ_POSTFLIGHT
); do \
1113 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1117 endif # MOZ_CURRENT_PROJECT
1119 ####################################
1120 # Postflight, after building all projects
1122 build profiledbuild alldep postflight_all
::
1123 ifeq (,$(MOZ_CURRENT_PROJECT
)$(if
$(MOZ_POSTFLIGHT_ALL
),,1))
1124 # Don't run postflight_all for individual projects in multi-project builds
1125 # (when MOZ_CURRENT_PROJECT is set.)
1126 ifndef MOZ_BUILD_PROJECTS
1127 # Building a single project, OBJDIR is usable.
1129 for mkfile in
$(MOZ_POSTFLIGHT_ALL
); do \
1130 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight_all TOPSRCDIR
=$(TOPSRCDIR
) OBJDIR
=$(OBJDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
); \
1133 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1134 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1136 for mkfile in
$(MOZ_POSTFLIGHT_ALL
); do \
1137 $(MAKE
) -f
$(TOPSRCDIR
)/$$mkfile postflight_all TOPSRCDIR
=$(TOPSRCDIR
) MOZ_OBJDIR
=$(MOZ_OBJDIR
) MOZ_BUILD_PROJECTS
="$(MOZ_BUILD_PROJECTS)"; \
1144 if
[ -f Makefile
]; then \
1145 $(MAKE
) distclean ; \
1147 echo
"Removing object files from srcdir..."; \
1148 rm -fr
`find . -type d \( -name .deps -print -o -name CVS \
1149 -o -exec test ! -d {}/CVS \; \) -prune \
1150 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1151 build
/autoconf
/clean-config.sh
; \
1154 # (! IS_FIRST_CHECKOUT)
1160 .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