Part of bug 382647 (move xpfe bookmarks to suite) and bug 393842 (move xpfe search...
[mozilla-central.git] / client.mk
blob66b669b638b99369fcc4e250b2c0aea00af8200e
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/suite \
250 mozilla/other-licenses/7zstub/seamonkey \
251 $(NULL)
253 LOCALES_suite := \
254 $(LOCALES_toolkit) \
255 suite \
256 editor/ui \
257 extensions/reporter \
258 $(NULL)
260 BOOTSTRAP_suite := \
261 $(BOOTSTRAP_toolkit) \
262 $(NULL)
264 MODULES_NS_browser := \
265 $(MODULES_NS_toolkit) \
266 $(NULL)
268 MODULES_browser := \
269 $(MODULES_toolkit) \
270 mozilla/browser \
271 mozilla/other-licenses/branding/firefox \
272 mozilla/other-licenses/7zstub/firefox \
273 $(NULL)
275 LOCALES_browser := \
276 $(LOCALES_toolkit) \
277 browser \
278 extensions/reporter \
279 extensions/spellcheck \
280 other-licenses/branding/firefox \
281 $(NULL)
283 BOOTSTRAP_browser := \
284 $(BOOTSTRAP_toolkit) \
285 mozilla/browser/config/mozconfig \
286 $(NULL)
288 MODULES_NS_minimo := \
289 $(MODULES_NS_toolkit) \
290 $(NULL)
292 MODULES_minimo := \
293 $(MODULES_toolkit) \
294 mozilla/minimo \
295 $(NULL)
297 BOOTSTRAP_minimo := \
298 $(BOOTSTRAP_toolkit) \
299 $(NULL)
301 MODULES_NS_mail := \
302 $(MODULES_NS_toolkit) \
303 $(NULL)
305 MODULES_mail := \
306 $(MODULES_toolkit) \
307 mozilla/directory/xpcom \
308 mozilla/mailnews \
309 mozilla/mail \
310 mozilla/other-licenses/branding/thunderbird \
311 mozilla/other-licenses/7zstub/thunderbird \
312 $(NULL)
314 LOCALES_mail := \
315 $(LOCALES_toolkit) \
316 mail \
317 other-licenses/branding/thunderbird \
318 editor/ui \
319 extensions/spellcheck \
320 $(NULL)
322 BOOTSTRAP_mail := \
323 $(BOOTSTRAP_toolkit) \
324 mozilla/mail/config/mozconfig \
325 $(NULL)
327 MODULES_composer := \
328 $(MODULES_toolkit) \
329 mozilla/composer \
330 $(NULL)
332 MODULES_NS_calendar := \
333 $(MODULES_NS_toolkit) \
334 $(NULL)
336 MODULES_calendar := \
337 $(MODULES_toolkit) \
338 mozilla/storage \
339 mozilla/db/sqlite3 \
340 mozilla/calendar \
341 mozilla/other-licenses/branding/sunbird \
342 mozilla/other-licenses/7zstub/sunbird \
343 $(NULL)
345 LOCALES_calendar := \
346 $(LOCALES_toolkit) \
347 calendar \
348 other-licenses/branding/sunbird \
349 $(NULL)
351 BOOTSTRAP_calendar := \
352 $(BOOTSTRAP_toolkit) \
353 mozilla/calendar/sunbird/config/mozconfig \
354 $(NULL)
356 MODULES_NS_xulrunner := \
357 $(MODULES_NS_toolkit) \
358 $(NULL)
360 MODULES_xulrunner := \
361 $(MODULES_toolkit) \
362 mozilla/xulrunner \
363 $(NULL)
365 LOCALES_xulrunner := \
366 $(LOCALES_toolkit) \
367 $(NULL)
369 BOOTSTRAP_xulrunner := \
370 $(BOOTSTRAP_toolkit) \
371 mozilla/xulrunner/config/mozconfig \
372 $(NULL)
374 MODULES_NS_camino := \
375 $(MODULES_NS_toolkit) \
376 $(NULL)
378 MODULES_camino := \
379 $(MODULES_core) \
380 mozilla/camino \
381 mozilla/themes \
382 $(NULL)
384 BOOTSTRAP_camino := \
385 $(BOOTSTRAP_toolkit) \
386 mozilla/camino/config/mozconfig \
387 $(NULL)
389 MODULES_tamarin := \
390 mozilla/js/tamarin \
391 mozilla/modules/zlib \
392 $(NULL)
394 MODULES_all := \
395 mozilla/other-licenses/bsdiff \
396 mozilla/other-licenses/libart_lgpl \
397 mozilla/tools/trace-malloc \
398 mozilla/tools/jprof \
399 mozilla/tools/codesighs \
400 mozilla/tools/update-packaging \
401 $(NULL)
403 #######################################################################
404 # Checkout Tags
406 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
407 # and commit this file on that tag.
408 #MOZ_CO_TAG = <tag>
409 NSPR_CO_TAG = NSPR_HEAD_20070820
410 NSS_CO_TAG = NSS_3_12_ALPHA1B
411 LDAPCSDK_CO_TAG = LDAPCSDK_6_0_3_CLIENT_BRANCH
412 LOCALES_CO_TAG =
414 #######################################################################
415 # Defines
417 CVS = cvs
418 comma := ,
420 CWD := $(shell pwd)
421 ifneq (1,$(words $(CWD)))
422 $(error The mozilla directory cannot be located in a path with spaces.)
423 endif
425 ifeq "$(CWD)" "/"
426 CWD := /.
427 endif
429 ifneq (, $(wildcard client.mk))
430 # Ran from mozilla directory
431 ROOTDIR := $(shell dirname $(CWD))
432 TOPSRCDIR := $(CWD)
433 else
434 # Ran from mozilla/.. directory (?)
435 ROOTDIR := $(CWD)
436 TOPSRCDIR := $(CWD)/mozilla
437 endif
439 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
440 # work; replace first instance with one forward slash
441 TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
443 ifndef TOPSRCDIR_MOZ
444 TOPSRCDIR_MOZ=$(TOPSRCDIR)
445 endif
447 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
448 DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
449 ifeq ($(DIRNAME),)
450 ROOTDIR := /.
451 endif
453 AUTOCONF := autoconf
454 MKDIR := mkdir
455 SH := /bin/sh
456 ifndef MAKE
457 MAKE := gmake
458 endif
459 PERL ?= perl
460 PYTHON ?= python
462 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
463 ifdef CONFIG_GUESS_SCRIPT
464 CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
465 else
466 _IS_FIRST_CHECKOUT := 1
467 endif
469 ####################################
470 # Sanity checks
472 ifneq (,$(filter MINGW%,$(shell uname -s)))
473 # check for CRLF line endings
474 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
475 $(error This source tree appears to have Windows-style line endings. To \
476 convert it to Unix-style line endings, run \
477 "python mozilla/build/win32/mozilla-dos2unix.py")
478 endif
479 endif
481 ####################################
482 # CVS
484 # Add the CVS root to CVS_FLAGS if needed
485 CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
486 ifneq ($(CVS_ROOT_IN_TREE),)
487 ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
488 CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
489 endif
490 endif
492 CVS_CO_DATE_FLAGS = $(if $(MOZ_CO_DATE),-D "$(MOZ_CO_DATE)")
493 CVS_CO_LOCALES_DATE_FLAGS = $(if $(MOZ_CO_LOCALES_DATE),-D "$(MOZ_CO_LOCALES_DATE)")
494 CVSCO = $(CVS) $(CVS_FLAGS) co $(MOZ_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG)) $(CVS_CO_DATE_FLAGS)
496 MOZ_CO_LOCALES_DATE ?= $(MOZ_CO_DATE)
498 CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
499 CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
501 # if LOCALES_CVSROOT is not specified, set it here
502 # (and let mozconfig override it)
503 LOCALES_CVSROOT ?= :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/l10n
505 ####################################
506 # Load mozconfig Options
508 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
510 MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
511 MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
512 MOZCONFIG_MODULES := mozilla/build/unix/uniq.pl
513 run_for_side_effects := \
514 $(shell cd $(ROOTDIR); \
515 if test "$(_IS_FIRST_CHECKOUT)"; then \
516 $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
517 else true; \
518 fi; \
519 $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
520 include $(TOPSRCDIR)/.mozconfig.mk
522 ####################################
523 # Options that may come from mozconfig
525 MOZ_PROJECT_LIST := $(subst $(comma), ,$(MOZ_CO_PROJECT))
526 MOZ_PROJECT_LIST := $(subst macbrowser,camino,$(MOZ_PROJECT_LIST))
528 ifneq (,$(filter-out $(AVAILABLE_PROJECTS),$(MOZ_PROJECT_LIST)))
529 $(error MOZ_CO_PROJECT contains an unrecognized project.)
530 endif
532 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST)))
533 MOZ_PROJECT_LIST := $(AVAILABLE_PROJECTS)
534 endif
536 MOZ_MODULE_LIST := $(subst $(comma), ,$(MOZ_CO_MODULE)) $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_$(project)))
537 MOZ_MODULE_LIST_NS := $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_NS_$(project)))
538 LOCALE_DIRS := $(MOZ_LOCALE_DIRS) $(foreach project,$(MOZ_PROJECT_LIST),$(LOCALES_$(project)))
540 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),$(BOOTSTRAP_$(project)))
542 # Using $(sort) here because it also removes duplicate entries.
543 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
544 LOCALE_DIRS := $(sort $(LOCALE_DIRS))
545 MOZCONFIG_MODULES := $(sort $(MOZCONFIG_MODULES))
547 # Change CVS flags if anonymous root is requested
548 ifdef MOZ_CO_USE_MIRROR
549 CVS_FLAGS := -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
550 endif
552 # MOZ_CVS_FLAGS - Basic CVS flags
553 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
554 CVS_FLAGS := $(CVS_FLAGS) -q -z 3
555 else
556 CVS_FLAGS := $(MOZ_CVS_FLAGS)
557 endif
559 ifdef MOZ_BUILD_PROJECTS
561 ifndef MOZ_OBJDIR
562 $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
563 endif
564 ifdef MOZ_CURRENT_PROJECT
565 OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
566 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
567 BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
568 else
569 OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
570 MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
571 endif
573 else # MOZ_BUILD_PROJECTS
575 ifdef MOZ_OBJDIR
576 OBJDIR = $(MOZ_OBJDIR)
577 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
578 else
579 OBJDIR := $(TOPSRCDIR)
580 MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
581 endif
583 endif # MOZ_BUILD_PROJECTS
585 ####################################
586 # CVS defines for NSS
588 NSS_CO_MODULE = \
589 mozilla/dbm \
590 mozilla/security/nss \
591 mozilla/security/coreconf \
592 mozilla/security/dbm \
593 $(NULL)
595 NSS_CO_FLAGS := -P
596 ifdef MOZ_CO_FLAGS
597 NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
598 endif
599 NSS_CO_FLAGS := $(NSS_CO_FLAGS) $(if $(NSS_CO_TAG),-r $(NSS_CO_TAG),-A)
601 # Can only pull the tip or branch tags by date
602 ifeq (,$(filter-out HEAD %BRANCH,$(NSS_CO_TAG)))
603 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
604 else
605 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
606 endif
608 ####################################
609 # CVS defines for NSPR
611 NSPR_CO_MODULE = mozilla/nsprpub
612 NSPR_CO_FLAGS := -P
613 ifdef MOZ_CO_FLAGS
614 NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
615 endif
616 NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) $(if $(NSPR_CO_TAG),-r $(NSPR_CO_TAG),-A)
618 # Can only pull the tip or branch tags by date
619 ifeq (,$(filter-out HEAD %BRANCH,$(NSPR_CO_TAG)))
620 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
621 else
622 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
623 endif
625 ####################################
626 # CVS defines for the C LDAP SDK
628 LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
629 LDAPCSDK_CO_FLAGS := -P
630 ifdef MOZ_CO_FLAGS
631 LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
632 endif
633 LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) $(if $(LDAPCSDK_CO_TAG),-r $(LDAPCSDK_CO_TAG),-A)
635 # Can only pull the tip or branch tags by date
636 ifeq (,$(filter-out HEAD %BRANCH,$(LDAPCSDK_CO_TAG)))
637 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
638 else
639 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(LDAPCSDK_CO_MODULE)
640 endif
642 ####################################
643 # Error on obsolete variables.
646 ifdef MOZ_MAPINFO
647 $(warning MOZ_MAPINFO is obsolete, use MOZ_CO_MODULE=mozilla/tools/codesighs instead.)
648 MOZ_MODULE_LIST += mozilla/tools/codesighs
649 endif
650 ifdef MOZ_INTERNAL_LIBART_LGPL
651 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete, use MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl instead.)
652 endif
653 ifdef MOZ_PHOENIX
654 $(warning MOZ_PHOENIX is obsolete.)
655 MOZ_MODULE_LIST += $(MODULES_browser)
656 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
657 endif
658 ifdef MOZ_THUNDERBIRD
659 $(warning MOZ_THUNDERBIRD is obsolete.)
660 MOZ_MODULE_LIST += $(MODULES_mail)
661 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
662 endif
664 ###################################
665 # Checkout main modules
668 # sort is used to remove duplicates.
669 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
670 MOZ_MODULE_LIST_NS := $(sort $(MOZ_MODULE_LIST_NS))
672 ####################################
673 # Suppress standalone modules if they're not needed.
675 CONFIGURES := $(TOPSRCDIR)/configure
676 ifeq (,$(filter mozilla/xpcom,$(MOZ_MODULE_LIST)))
677 CVSCO_NSPR :=
678 else
679 CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
680 endif
682 ifeq (,$(filter mozilla/security/manager,$(MOZ_MODULE_LIST)))
683 CVSCO_NSS :=
684 endif
685 ifeq (,$(filter mozilla/directory/xpcom,$(MOZ_MODULE_LIST)))
686 CVSCO_LDAPCSDK :=
687 else
688 CONFIGURES += $(TOPSRCDIR)/directory/c-sdk/configure
689 endif
691 MODULES_CO_FLAGS := -P
692 ifdef MOZ_CO_FLAGS
693 MODULES_CO_FLAGS := $(MOZ_CO_FLAGS)
694 endif
695 MODULES_CO_FLAGS := $(MODULES_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG),-A)
697 CVSCO_MODULES_NS = $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(MOZ_MODULE_LIST_NS)
699 ifeq (,$(strip $(MOZ_MODULE_LIST)))
700 FASTUPDATE_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
701 CHECKOUT_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
702 else
703 FASTUPDATE_MODULES := fast_update $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST)
704 CHECKOUT_MODULES := cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST);
705 endif
706 ifeq (,$(MOZ_MODULE_LIST_NS))
707 FASTUPDATE_MODULES_NS := true
708 CHECKOUT_MODULES_NS := true
709 else
710 FASTUPDATE_MODULES_NS := fast_update $(CVSCO_MODULES_NS)
711 CHECKOUT_MODULES_NS := cvs_co $(CVSCO_MODULES_NS)
712 endif
714 ###################################
715 # CVS defines for locales
718 LOCALES_CO_FLAGS := -P
719 ifdef MOZ_CO_FLAGS
720 LOCALES_CO_FLAGS := $(MOZ_CO_FLAGS)
721 endif
722 LOCALES_CO_FLAGS := $(LOCALES_CO_FLAGS) $(if $(LOCALES_CO_TAG),-r $(LOCALES_CO_TAG),-A)
724 ifndef MOZ_CO_LOCALES
725 FASTUPDATE_LOCALES := true
726 CHECKOUT_LOCALES := true
727 else
729 override MOZ_CO_LOCALES := $(subst $(comma), ,$(MOZ_CO_LOCALES))
731 ifeq (all,$(MOZ_CO_LOCALES))
732 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),mozilla/$(project)/locales/all-locales)
734 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)))))
735 else # MOZ_CO_LOCALES != all
736 LOCALE_CO_DIRS = $(sort $(foreach locale,$(MOZ_CO_LOCALES),$(foreach dir,$(LOCALE_DIRS),l10n/$(locale)/$(dir))))
737 endif
739 CVSCO_LOCALES := $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_LOCALES_DATE_FLAGS) $(LOCALE_CO_DIRS)
741 FASTUPDATE_LOCALES := fast_update $(CVSCO_LOCALES)
742 CHECKOUT_LOCALES := cvs_co $(CVSCO_LOCALES)
743 endif #MOZ_CO_LOCALES
745 #######################################################################
746 # Rules
749 # Print out any options loaded from mozconfig.
750 all build checkout clean depend distclean export libs install realclean::
751 @if test -f .mozconfig.out; then \
752 cat .mozconfig.out; \
753 rm -f .mozconfig.out; \
754 else true; \
757 ifdef _IS_FIRST_CHECKOUT
758 all:: checkout build
759 else
760 all:: checkout alldep
761 endif
763 # Windows equivalents
764 pull_all: checkout
765 build_all: build
766 build_all_dep: alldep
767 build_all_depend: alldep
768 clobber clobber_all: clean
769 pull_and_build_all: checkout alldep
771 # Do everything from scratch
772 everything: checkout clean build
774 ####################################
775 # CVS checkout
777 checkout::
778 # @: Backup the last checkout log.
779 @if test -f $(CVSCO_LOGFILE) ; then \
780 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
781 else true; \
783 ifdef RUN_AUTOCONF_LOCALLY
784 @echo "Removing local configures" ; \
785 cd $(ROOTDIR) && \
786 $(RM) -f $(CONFIGURES)
787 endif
788 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
789 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
790 cd $(ROOTDIR) && \
791 $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
792 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
794 # Start the checkout. Split the output to the tty and a log file.
796 real_checkout:
797 @set -e; \
798 cvs_co() { set -e; echo "$$@" ; \
799 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
800 cvs_co $(CVSCO_NSPR); \
801 cvs_co $(CVSCO_NSS); \
802 cvs_co $(CVSCO_LDAPCSDK); \
803 $(CHECKOUT_MODULES_NS); \
804 $(CHECKOUT_MODULES) \
805 $(CHECKOUT_LOCALES);
806 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
807 # update the NSS checkout timestamp, if we checked PSM out
808 @if test -d $(TOPSRCDIR)/security/manager -a \
809 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
810 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
812 ifdef RUN_AUTOCONF_LOCALLY
813 cd $(ROOTDIR) && \
814 $(RM) -f $(CONFIGURES)
815 endif
816 # @: Check the log for conflicts. ;
817 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
818 if test "$$conflicts" ; then \
819 echo "$(MAKE): *** Conflicts during checkout." ;\
820 echo "$$conflicts" ;\
821 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
822 false; \
823 else true; \
826 fast-update:
827 # @: Backup the last checkout log.
828 @if test -f $(CVSCO_LOGFILE) ; then \
829 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
830 else true; \
832 ifdef RUN_AUTOCONF_LOCALLY
833 @echo "Removing local configures" ; \
834 cd $(ROOTDIR) && \
835 $(RM) -f $(CONFIGURES)
836 endif
837 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
838 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
839 cd $(ROOTDIR) && \
840 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
841 @cd $(TOPSRCDIR) && \
842 $(MAKE) -f client.mk real_fast-update
844 # Start the update. Split the output to the tty and a log file.
845 real_fast-update:
846 @set -e; \
847 fast_update() { set -e; config/cvsco-fast-update.pl $$@ 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
848 cvs_co() { set -e; echo "$$@" ; \
849 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
850 fast_update $(CVSCO_NSPR); \
851 cd $(ROOTDIR); \
852 cvs_co $(CVSCO_NSS); \
853 cd mozilla; \
854 fast_update $(CVSCO_LDAPCSDK); \
855 $(FASTUPDATE_MODULES); \
856 $(FASTUPDATE_MODULES_NS); \
857 $(FASTUPDATE_LOCALES);
858 @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
859 # update the NSS checkout timestamp
860 @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
861 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
863 ifdef RUN_AUTOCONF_LOCALLY
864 cd $(ROOTDIR) && \
865 $(RM) -f $(CONFIGURES)
866 endif
867 # @: Check the log for conflicts. ;
868 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
869 if test "$$conflicts" ; then \
870 echo "$(MAKE): *** Conflicts during fast-update." ;\
871 echo "$$conflicts" ;\
872 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
873 false; \
874 else true; \
877 CVSCO_LOGFILE_L10N := $(ROOTDIR)/cvsco-l10n.log
878 CVSCO_LOGFILE_L10N := $(shell echo $(CVSCO_LOGFILE_L10N) | sed s%//%/%)
880 l10n-checkout:
881 # @: Backup the last checkout log.
882 @if test -f $(CVSCO_LOGFILE_L10N) ; then \
883 mv $(CVSCO_LOGFILE_L10N) $(CVSCO_LOGFILE_L10N).old; \
884 else true; \
886 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE_L10N)
887 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
888 cd $(ROOTDIR) && \
889 $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
890 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_l10n-checkout
892 EN_US_CO_DIRS := $(sort $(foreach dir,$(LOCALE_DIRS),mozilla/$(dir)/locales)) \
893 $(foreach mod,$(MOZ_PROJECT_LIST),mozilla/$(mod)/config) \
894 mozilla/client.mk \
895 $(MOZCONFIG_MODULES) \
896 mozilla/configure \
897 mozilla/configure.in \
898 mozilla/allmakefiles.sh \
899 mozilla/build \
900 mozilla/config \
901 $(NULL)
903 EN_US_CO_FILES_NS := \
904 mozilla/toolkit/mozapps/installer \
905 $(NULL)
907 # Start the checkout. Split the output to the tty and a log file.
908 real_l10n-checkout:
909 @set -e; \
910 cvs_co() { set -e; echo "$$@" ; \
911 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE_L10N); }; \
912 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(EN_US_CO_DIRS); \
913 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(EN_US_CO_FILES_NS); \
914 cvs_co $(CVSCO_LOCALES)
915 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE_L10N)
916 # @: Check the log for conflicts. ;
917 @conflicts=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
918 if test "$$conflicts" ; then \
919 echo "$(MAKE): *** Conflicts during checkout." ;\
920 echo "$$conflicts" ;\
921 echo "$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
922 false; \
923 else true; \
926 #####################################################
927 # First Checkout
929 ifdef _IS_FIRST_CHECKOUT
930 # First time, do build target in a new process to pick up new files.
931 build::
932 $(MAKE) -f $(TOPSRCDIR)/client.mk build
933 else
935 #####################################################
936 # After First Checkout
938 #####################################################
939 # Build date unification
941 ifdef MOZ_UNIFY_BDATE
942 ifndef MOZ_BUILD_DATE
943 ifdef MOZ_BUILD_PROJECTS
944 MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
945 export MOZ_BUILD_DATE
946 endif
947 endif
948 endif
950 #####################################################
951 # Preflight, before building any project
953 build profiledbuild alldep preflight_all::
954 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
955 # Don't run preflight_all for individual projects in multi-project builds
956 # (when MOZ_CURRENT_PROJECT is set.)
957 ifndef MOZ_BUILD_PROJECTS
958 # Building a single project, OBJDIR is usable.
959 set -e; \
960 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
961 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
962 done
963 else
964 # OBJDIR refers to the project-specific OBJDIR, which is not available at
965 # this point when building multiple projects. Only MOZ_OBJDIR is available.
966 set -e; \
967 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
968 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
969 done
970 endif
971 endif
973 # If we're building multiple projects, but haven't specified which project,
974 # loop through them.
976 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
977 configure depend build profiledbuild install export libs clean realclean distclean alldep preflight postflight::
978 set -e; \
979 for app in $(MOZ_BUILD_PROJECTS); do \
980 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
981 done
983 else
985 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
986 # individual project in a multi-project build.
988 ####################################
989 # Configure
991 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
992 CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
994 ifdef RUN_AUTOCONF_LOCALLY
995 EXTRA_CONFIG_DEPS := \
996 $(TOPSRCDIR)/aclocal.m4 \
997 $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
998 $(NULL)
1000 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
1001 @echo Generating $@ using autoconf
1002 cd $(TOPSRCDIR); $(AUTOCONF)
1004 $(TOPSRCDIR)/nsprpub/configure: $(TOPSRCDIR)/nsprpub/configure.in $(EXTRA_CONFIG_DEPS)
1005 @echo Generating $@ using autoconf
1006 cd $(TOPSRCDIR)/nsprpub; $(AUTOCONF)
1008 $(TOPSRCDIR)/directory/c-sdk/configure: $(TOPSRCDIR)/directory/c-sdk/configure.in $(EXTRA_CONFIG_DEPS)
1009 @echo Generating $@ using autoconf
1010 cd $(TOPSRCDIR)/directory/c-sdk; $(AUTOCONF)
1011 endif
1013 CONFIG_STATUS_DEPS := \
1014 $(TOPSRCDIR)/configure \
1015 $(TOPSRCDIR)/allmakefiles.sh \
1016 $(TOPSRCDIR)/.mozconfig.mk \
1017 $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
1018 $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
1019 $(wildcard $(TOPSRCDIR)/mailnews/makefiles) \
1020 $(wildcard $(TOPSRCDIR)/themes/makefiles) \
1021 $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
1022 $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
1023 $(NULL)
1025 # configure uses the program name to determine @srcdir@. Calling it without
1026 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1027 # path of $(TOPSRCDIR).
1028 ifeq ($(TOPSRCDIR),$(OBJDIR))
1029 CONFIGURE = ./configure
1030 else
1031 CONFIGURE = $(TOPSRCDIR)/configure
1032 endif
1034 ifdef MOZ_TOOLS
1035 CONFIGURE = $(TOPSRCDIR)/configure
1036 endif
1038 configure:: $(CONFIGURES)
1039 ifdef MOZ_BUILD_PROJECTS
1040 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1041 endif
1042 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1043 @echo cd $(OBJDIR);
1044 @echo $(CONFIGURE) $(CONFIGURE_ARGS)
1045 @cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
1046 || ( echo "*** Fix above errors and then restart with\
1047 \"$(MAKE) -f client.mk build\"" && exit 1 )
1048 @touch $(OBJDIR)/Makefile
1050 $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
1051 @$(MAKE) -f $(TOPSRCDIR)/client.mk configure
1053 ifneq (,$(CONFIG_STATUS))
1054 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
1055 cd $(OBJDIR); \
1056 CONFIG_FILES=config/autoconf.mk ./config.status
1057 endif
1060 ####################################
1061 # Depend
1063 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1064 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1066 ####################################
1067 # Preflight
1069 build profiledbuild alldep preflight::
1070 ifdef MOZ_PREFLIGHT
1071 set -e; \
1072 for mkfile in $(MOZ_PREFLIGHT); do \
1073 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1074 done
1075 endif
1077 ####################################
1078 # Build it
1080 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1081 $(MOZ_MAKE)
1083 ####################################
1084 # Profile-feedback build (gcc only)
1085 # To use this, you should set the following variables in your mozconfig
1086 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
1088 # The profile script should exercise the functionality to be included
1089 # in the profile feedback.
1091 profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1092 $(MOZ_MAKE) MOZ_PROFILE_GENERATE=1
1093 OBJDIR=${OBJDIR} $(PROFILE_GEN_SCRIPT)
1094 $(MOZ_MAKE) clobber_all
1095 $(MOZ_MAKE) MOZ_PROFILE_USE=1
1096 find $(OBJDIR) -name "*.da" -exec rm {} \;
1098 ####################################
1099 # Other targets
1101 # Pass these target onto the real build system
1102 install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1103 $(MOZ_MAKE) $@
1105 ####################################
1106 # Postflight
1108 build profiledbuild alldep postflight::
1109 ifdef MOZ_POSTFLIGHT
1110 set -e; \
1111 for mkfile in $(MOZ_POSTFLIGHT); do \
1112 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1113 done
1114 endif
1116 endif # MOZ_CURRENT_PROJECT
1118 ####################################
1119 # Postflight, after building all projects
1121 build profiledbuild alldep postflight_all::
1122 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
1123 # Don't run postflight_all for individual projects in multi-project builds
1124 # (when MOZ_CURRENT_PROJECT is set.)
1125 ifndef MOZ_BUILD_PROJECTS
1126 # Building a single project, OBJDIR is usable.
1127 set -e; \
1128 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1129 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1130 done
1131 else
1132 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1133 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1134 set -e; \
1135 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1136 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1137 done
1138 endif
1139 endif
1141 cleansrcdir:
1142 @cd $(TOPSRCDIR); \
1143 if [ -f Makefile ]; then \
1144 $(MAKE) distclean ; \
1145 else \
1146 echo "Removing object files from srcdir..."; \
1147 rm -fr `find . -type d \( -name .deps -print -o -name CVS \
1148 -o -exec test ! -d {}/CVS \; \) -prune \
1149 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1150 build/autoconf/clean-config.sh; \
1153 # (! IS_FIRST_CHECKOUT)
1154 endif
1156 echo-variable-%:
1157 @echo $($*)
1159 .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