Save all modification
[mozilla-1.9/m8.git] / client.mk
blob9efb79ef99be1a1610de35470926d326aabf8771
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
12 # License.
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.
21 # Contributor(s):
22 # Stephen Lamm
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
45 # 2. cd mozilla
46 # 3. create your .mozconfig file with
47 # mk_add_options MOZ_CO_PROJECT=
48 # suite,browser
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)
67 # xulrunner
68 # camino
69 # tamarin
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...]),
77 # checkout
78 # build
79 # clean (realclean is now the same as clean)
80 # distclean
82 # See http://www.mozilla.org/build/ for more information.
84 # Options:
85 # MOZ_BUILD_PROJECTS - Build multiple projects in subdirectories
86 # of MOZ_OBJDIR
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
103 # MOZ_BUILD_PROJECTS
106 AVAILABLE_PROJECTS = \
107 all \
108 suite \
109 toolkit \
110 browser \
111 mail \
112 minimo \
113 composer \
114 calendar \
115 xulrunner \
116 camino \
117 necko \
118 tamarin \
119 $(NULL)
121 # Trailing / on top-level mozilla dir required to stop fast-update thinking
122 # it is a module name.
123 MODULES_NS_necko := \
124 mozilla/ \
125 $(NULL)
127 MODULES_necko := \
128 mozilla/README \
129 mozilla/config \
130 mozilla/build \
131 mozilla/intl \
132 mozilla/modules/libpref \
133 mozilla/modules/zlib \
134 mozilla/netwerk \
135 mozilla/xpcom \
136 mozilla/tools/test-harness \
137 $(NULL)
139 MODULES_NS_core := \
140 $(MODULES_NS_necko) \
141 mozilla/js \
142 mozilla/js/src \
143 mozilla/js/jsd \
144 mozilla/db \
145 $(NULL)
147 MODULES_core := \
148 $(MODULES_necko) \
149 mozilla/caps \
150 mozilla/content \
151 mozilla/db/mdb \
152 mozilla/db/mork \
153 mozilla/docshell \
154 mozilla/dom \
155 mozilla/editor \
156 mozilla/embedding \
157 mozilla/extensions \
158 mozilla/gfx \
159 mozilla/parser \
160 mozilla/layout \
161 mozilla/jpeg \
162 mozilla/js/src/fdlibm \
163 mozilla/js/src/liveconnect \
164 mozilla/js/src/xpconnect \
165 mozilla/js/jsd/idl \
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 \
175 mozilla/plugin/oji \
176 mozilla/profile \
177 mozilla/rdf \
178 mozilla/security/manager \
179 mozilla/sun-java \
180 mozilla/ipc/ipcd \
181 mozilla/modules/libpr0n \
182 mozilla/modules/libmar \
183 mozilla/modules/libbz2 \
184 mozilla/accessible \
185 mozilla/other-licenses/atk-1.0 \
186 mozilla/other-licenses/ia2 \
187 mozilla/security/manager \
188 mozilla/tools/elf-dynstr-gc \
189 mozilla/uriloader \
190 mozilla/view \
191 mozilla/webshell \
192 mozilla/widget \
193 mozilla/xpfe \
194 mozilla/xpinstall \
195 mozilla/toolkit \
196 mozilla/storage \
197 mozilla/db/sqlite3 \
198 mozilla/db/morkreader \
199 mozilla/testing/mochitest \
200 $(NULL)
202 LOCALES_necko := \
203 netwerk \
204 $(NULL)
206 LOCALES_core := \
207 $(LOCALES_necko) \
208 dom \
209 $(NULL)
211 BOOTSTRAP_necko := \
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 \
216 $(NULL)
218 BOOTSTRAP_core := \
219 $(BOOTSTRAP_necko) \
220 $(NULL)
222 MODULES_NS_toolkit := \
223 $(MODULES_NS_core) \
224 $(NULL)
226 MODULES_toolkit := \
227 $(MODULES_core) \
228 mozilla/chrome \
229 $(NULL)
231 LOCALES_toolkit := \
232 $(LOCALES_core) \
233 toolkit \
234 security/manager \
235 $(NULL)
237 BOOTSTRAP_toolkit := \
238 $(BOOTSTRAP_core) \
239 $(NULL)
241 MODULES_NS_suite := \
242 $(MODULES_NS_toolkit) \
243 $(NULL)
245 MODULES_suite := \
246 $(MODULES_toolkit) \
247 mozilla/directory/xpcom \
248 mozilla/mailnews \
249 mozilla/themes \
250 mozilla/suite \
251 mozilla/other-licenses/7zstub/seamonkey \
252 $(NULL)
254 LOCALES_suite := \
255 $(LOCALES_toolkit) \
256 suite \
257 editor/ui \
258 extensions/reporter \
259 $(NULL)
261 BOOTSTRAP_suite := \
262 $(BOOTSTRAP_toolkit) \
263 $(NULL)
265 MODULES_NS_browser := \
266 $(MODULES_NS_toolkit) \
267 $(NULL)
269 MODULES_browser := \
270 $(MODULES_toolkit) \
271 mozilla/browser \
272 mozilla/other-licenses/branding/firefox \
273 mozilla/other-licenses/7zstub/firefox \
274 $(NULL)
276 LOCALES_browser := \
277 $(LOCALES_toolkit) \
278 browser \
279 extensions/reporter \
280 extensions/spellcheck \
281 other-licenses/branding/firefox \
282 $(NULL)
284 BOOTSTRAP_browser := \
285 $(BOOTSTRAP_toolkit) \
286 mozilla/browser/config/mozconfig \
287 $(NULL)
289 MODULES_NS_minimo := \
290 $(MODULES_NS_toolkit) \
291 $(NULL)
293 MODULES_minimo := \
294 $(MODULES_toolkit) \
295 mozilla/minimo \
296 $(NULL)
298 BOOTSTRAP_minimo := \
299 $(BOOTSTRAP_toolkit) \
300 $(NULL)
302 MODULES_NS_mail := \
303 $(MODULES_NS_toolkit) \
304 $(NULL)
306 MODULES_mail := \
307 $(MODULES_toolkit) \
308 mozilla/directory/xpcom \
309 mozilla/mailnews \
310 mozilla/mail \
311 mozilla/other-licenses/branding/thunderbird \
312 mozilla/other-licenses/7zstub/thunderbird \
313 $(NULL)
315 LOCALES_mail := \
316 $(LOCALES_toolkit) \
317 mail \
318 other-licenses/branding/thunderbird \
319 editor/ui \
320 extensions/spellcheck \
321 $(NULL)
323 BOOTSTRAP_mail := \
324 $(BOOTSTRAP_toolkit) \
325 mozilla/mail/config/mozconfig \
326 $(NULL)
328 MODULES_composer := \
329 $(MODULES_toolkit) \
330 mozilla/composer \
331 $(NULL)
333 MODULES_NS_calendar := \
334 $(MODULES_NS_toolkit) \
335 $(NULL)
337 MODULES_calendar := \
338 $(MODULES_toolkit) \
339 mozilla/storage \
340 mozilla/db/sqlite3 \
341 mozilla/calendar \
342 mozilla/other-licenses/branding/sunbird \
343 mozilla/other-licenses/7zstub/sunbird \
344 $(NULL)
346 LOCALES_calendar := \
347 $(LOCALES_toolkit) \
348 calendar \
349 other-licenses/branding/sunbird \
350 $(NULL)
352 BOOTSTRAP_calendar := \
353 $(BOOTSTRAP_toolkit) \
354 mozilla/calendar/sunbird/config/mozconfig \
355 $(NULL)
357 MODULES_NS_xulrunner := \
358 $(MODULES_NS_toolkit) \
359 $(NULL)
361 MODULES_xulrunner := \
362 $(MODULES_toolkit) \
363 mozilla/xulrunner \
364 $(NULL)
366 LOCALES_xulrunner := \
367 $(LOCALES_toolkit) \
368 $(NULL)
370 BOOTSTRAP_xulrunner := \
371 $(BOOTSTRAP_toolkit) \
372 mozilla/xulrunner/config/mozconfig \
373 $(NULL)
375 MODULES_NS_camino := \
376 $(MODULES_NS_toolkit) \
377 $(NULL)
379 MODULES_camino := \
380 $(MODULES_core) \
381 mozilla/camino \
382 mozilla/themes \
383 $(NULL)
385 BOOTSTRAP_camino := \
386 $(BOOTSTRAP_toolkit) \
387 mozilla/camino/config/mozconfig \
388 $(NULL)
390 MODULES_tamarin := \
391 mozilla/js/tamarin \
392 mozilla/modules/zlib \
393 $(NULL)
395 MODULES_all := \
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 \
402 $(NULL)
404 #######################################################################
405 # Checkout Tags
407 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
408 # and commit this file on that tag.
409 MOZ_CO_TAG = MOZILLA_1_9a8_RELEASE
410 NSPR_CO_TAG = MOZILLA_1_9a8_RELEASE
411 NSS_CO_TAG = MOZILLA_1_9a8_RELEASE
412 LDAPCSDK_CO_TAG = MOZILLA_1_9a8_RELEASE
413 LOCALES_CO_TAG =
415 #######################################################################
416 # Defines
418 CVS = cvs
419 comma := ,
421 CWD := $(shell pwd)
422 ifneq (1,$(words $(CWD)))
423 $(error The mozilla directory cannot be located in a path with spaces.)
424 endif
426 ifeq "$(CWD)" "/"
427 CWD := /.
428 endif
430 ifneq (, $(wildcard client.mk))
431 # Ran from mozilla directory
432 ROOTDIR := $(shell dirname $(CWD))
433 TOPSRCDIR := $(CWD)
434 else
435 # Ran from mozilla/.. directory (?)
436 ROOTDIR := $(CWD)
437 TOPSRCDIR := $(CWD)/mozilla
438 endif
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%//%/%')
444 ifndef TOPSRCDIR_MOZ
445 TOPSRCDIR_MOZ=$(TOPSRCDIR)
446 endif
448 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
449 DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
450 ifeq ($(DIRNAME),)
451 ROOTDIR := /.
452 endif
454 AUTOCONF := autoconf
455 MKDIR := mkdir
456 SH := /bin/sh
457 ifndef MAKE
458 MAKE := gmake
459 endif
460 PERL ?= perl
461 PYTHON ?= python
463 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
464 ifdef CONFIG_GUESS_SCRIPT
465 CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
466 else
467 _IS_FIRST_CHECKOUT := 1
468 endif
470 ####################################
471 # Sanity checks
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")
479 endif
480 endif
482 ####################################
483 # CVS
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)
490 endif
491 endif
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); \
518 else true; \
519 fi; \
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.)
531 endif
533 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST)))
534 MOZ_PROJECT_LIST := $(AVAILABLE_PROJECTS)
535 endif
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
551 endif
553 # MOZ_CVS_FLAGS - Basic CVS flags
554 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
555 CVS_FLAGS := $(CVS_FLAGS) -q -z 3
556 else
557 CVS_FLAGS := $(MOZ_CVS_FLAGS)
558 endif
560 ifdef MOZ_BUILD_PROJECTS
562 ifndef MOZ_OBJDIR
563 $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
564 endif
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)
569 else
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.)
572 endif
574 else # MOZ_BUILD_PROJECTS
576 ifdef MOZ_OBJDIR
577 OBJDIR = $(MOZ_OBJDIR)
578 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
579 else
580 OBJDIR := $(TOPSRCDIR)
581 MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
582 endif
584 endif # MOZ_BUILD_PROJECTS
586 ####################################
587 # CVS defines for NSS
589 NSS_CO_MODULE = \
590 mozilla/dbm \
591 mozilla/security/nss \
592 mozilla/security/coreconf \
593 mozilla/security/dbm \
594 $(NULL)
596 NSS_CO_FLAGS := -P
597 ifdef MOZ_CO_FLAGS
598 NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
599 endif
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)
605 else
606 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
607 endif
609 ####################################
610 # CVS defines for NSPR
612 NSPR_CO_MODULE = mozilla/nsprpub
613 NSPR_CO_FLAGS := -P
614 ifdef MOZ_CO_FLAGS
615 NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
616 endif
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)
622 else
623 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
624 endif
626 ####################################
627 # CVS defines for the C LDAP SDK
629 LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
630 LDAPCSDK_CO_FLAGS := -P
631 ifdef MOZ_CO_FLAGS
632 LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
633 endif
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)
639 else
640 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(LDAPCSDK_CO_MODULE)
641 endif
643 ####################################
644 # Error on obsolete variables.
647 ifdef MOZ_MAPINFO
648 $(warning MOZ_MAPINFO is obsolete, use MOZ_CO_MODULE=mozilla/tools/codesighs instead.)
649 MOZ_MODULE_LIST += mozilla/tools/codesighs
650 endif
651 ifdef MOZ_INTERNAL_LIBART_LGPL
652 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete, use MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl instead.)
653 endif
654 ifdef MOZ_PHOENIX
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)
658 endif
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)
663 endif
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)))
678 CVSCO_NSPR :=
679 else
680 CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
681 endif
683 ifeq (,$(filter mozilla/security/manager,$(MOZ_MODULE_LIST)))
684 CVSCO_NSS :=
685 endif
686 ifeq (,$(filter mozilla/directory/xpcom,$(MOZ_MODULE_LIST)))
687 CVSCO_LDAPCSDK :=
688 else
689 CONFIGURES += $(TOPSRCDIR)/directory/c-sdk/configure
690 endif
692 MODULES_CO_FLAGS := -P
693 ifdef MOZ_CO_FLAGS
694 MODULES_CO_FLAGS := $(MOZ_CO_FLAGS)
695 endif
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.)
703 else
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);
706 endif
707 ifeq (,$(MOZ_MODULE_LIST_NS))
708 FASTUPDATE_MODULES_NS := true
709 CHECKOUT_MODULES_NS := true
710 else
711 FASTUPDATE_MODULES_NS := fast_update $(CVSCO_MODULES_NS)
712 CHECKOUT_MODULES_NS := cvs_co $(CVSCO_MODULES_NS)
713 endif
715 ###################################
716 # CVS defines for locales
719 LOCALES_CO_FLAGS := -P
720 ifdef MOZ_CO_FLAGS
721 LOCALES_CO_FLAGS := $(MOZ_CO_FLAGS)
722 endif
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
728 else
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))))
738 endif
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 #######################################################################
747 # Rules
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; \
755 else true; \
758 ifdef _IS_FIRST_CHECKOUT
759 all:: checkout build
760 else
761 all:: checkout alldep
762 endif
764 # Windows equivalents
765 pull_all: checkout
766 build_all: build
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 ####################################
776 # CVS checkout
778 checkout::
779 # @: Backup the last checkout log.
780 @if test -f $(CVSCO_LOGFILE) ; then \
781 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
782 else true; \
784 ifdef RUN_AUTOCONF_LOCALLY
785 @echo "Removing local configures" ; \
786 cd $(ROOTDIR) && \
787 $(RM) -f $(CONFIGURES)
788 endif
789 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
790 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
791 cd $(ROOTDIR) && \
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.
797 real_checkout:
798 @set -e; \
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) \
806 $(CHECKOUT_LOCALES);
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
814 cd $(ROOTDIR) && \
815 $(RM) -f $(CONFIGURES)
816 endif
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." ;\
823 false; \
824 else true; \
827 fast-update:
828 # @: Backup the last checkout log.
829 @if test -f $(CVSCO_LOGFILE) ; then \
830 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
831 else true; \
833 ifdef RUN_AUTOCONF_LOCALLY
834 @echo "Removing local configures" ; \
835 cd $(ROOTDIR) && \
836 $(RM) -f $(CONFIGURES)
837 endif
838 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
839 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
840 cd $(ROOTDIR) && \
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.
846 real_fast-update:
847 @set -e; \
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); \
852 cd $(ROOTDIR); \
853 cvs_co $(CVSCO_NSS); \
854 cd mozilla; \
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
865 cd $(ROOTDIR) && \
866 $(RM) -f $(CONFIGURES)
867 endif
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." ;\
874 false; \
875 else true; \
878 CVSCO_LOGFILE_L10N := $(ROOTDIR)/cvsco-l10n.log
879 CVSCO_LOGFILE_L10N := $(shell echo $(CVSCO_LOGFILE_L10N) | sed s%//%/%)
881 l10n-checkout:
882 # @: Backup the last checkout log.
883 @if test -f $(CVSCO_LOGFILE_L10N) ; then \
884 mv $(CVSCO_LOGFILE_L10N) $(CVSCO_LOGFILE_L10N).old; \
885 else true; \
887 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE_L10N)
888 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
889 cd $(ROOTDIR) && \
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) \
895 mozilla/client.mk \
896 $(MOZCONFIG_MODULES) \
897 mozilla/configure \
898 mozilla/configure.in \
899 mozilla/allmakefiles.sh \
900 mozilla/build \
901 mozilla/config \
902 $(NULL)
904 EN_US_CO_FILES_NS := \
905 mozilla/toolkit/mozapps/installer \
906 $(NULL)
908 # Start the checkout. Split the output to the tty and a log file.
909 real_l10n-checkout:
910 @set -e; \
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." ;\
923 false; \
924 else true; \
927 #####################################################
928 # First Checkout
930 ifdef _IS_FIRST_CHECKOUT
931 # First time, do build target in a new process to pick up new files.
932 build::
933 $(MAKE) -f $(TOPSRCDIR)/client.mk build
934 else
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
947 endif
948 endif
949 endif
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.
960 set -e; \
961 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
962 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
963 done
964 else
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.
967 set -e; \
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)"; \
970 done
971 endif
972 endif
974 # If we're building multiple projects, but haven't specified which project,
975 # loop through them.
977 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
978 configure depend build profiledbuild install export libs clean realclean distclean alldep preflight postflight::
979 set -e; \
980 for app in $(MOZ_BUILD_PROJECTS); do \
981 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
982 done
984 else
986 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
987 # individual project in a multi-project build.
989 ####################################
990 # Configure
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) \
999 $(NULL)
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)
1012 endif
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) \
1024 $(NULL)
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
1031 else
1032 CONFIGURE = $(TOPSRCDIR)/configure
1033 endif
1035 ifdef MOZ_TOOLS
1036 CONFIGURE = $(TOPSRCDIR)/configure
1037 endif
1039 configure:: $(CONFIGURES)
1040 ifdef MOZ_BUILD_PROJECTS
1041 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1042 endif
1043 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1044 @echo cd $(OBJDIR);
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
1056 cd $(OBJDIR); \
1057 CONFIG_FILES=config/autoconf.mk ./config.status
1058 endif
1061 ####################################
1062 # Depend
1064 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1065 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1067 ####################################
1068 # Preflight
1070 build profiledbuild alldep preflight::
1071 ifdef MOZ_PREFLIGHT
1072 set -e; \
1073 for mkfile in $(MOZ_PREFLIGHT); do \
1074 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1075 done
1076 endif
1078 ####################################
1079 # Build it
1081 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1082 $(MOZ_MAKE)
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 ####################################
1100 # Other targets
1102 # Pass these target onto the real build system
1103 install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1104 $(MOZ_MAKE) $@
1106 ####################################
1107 # Postflight
1109 build profiledbuild alldep postflight::
1110 ifdef MOZ_POSTFLIGHT
1111 set -e; \
1112 for mkfile in $(MOZ_POSTFLIGHT); do \
1113 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1114 done
1115 endif
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.
1128 set -e; \
1129 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1130 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1131 done
1132 else
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.
1135 set -e; \
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)"; \
1138 done
1139 endif
1140 endif
1142 cleansrcdir:
1143 @cd $(TOPSRCDIR); \
1144 if [ -f Makefile ]; then \
1145 $(MAKE) distclean ; \
1146 else \
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)
1155 endif
1157 echo-variable-%:
1158 @echo $($*)
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