pdfs are too big. re-landing 375750 which was accidentily backed out by 407427. r...
[mozilla-central.git] / client.mk
blob9971b1e72b5be3e6cdba4b720de47aad3bf1be23
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://developer.mozilla.org/en/docs/Build_Documentation for
83 # more information.
85 # Options:
86 # MOZ_BUILD_PROJECTS - Build multiple projects in subdirectories
87 # of MOZ_OBJDIR
88 # MOZ_OBJDIR - Destination object directory
89 # MOZ_CO_DATE - Date tag to use for checkout (default: none)
90 # MOZ_CO_LOCALES_DATE - Date tag to use for locale checkout
91 # (default: MOZ_CO_DATE)
92 # MOZ_CO_MODULE - Module to checkout
93 # MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3)
94 # MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P)
95 # MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
96 # MOZ_CO_LOCALES - localizations to pull (MOZ_CO_LOCALES="de-DE,pt-BR")
97 # MOZ_LOCALE_DIRS - directories which contain localizations
98 # LOCALES_CVSROOT - CVSROOT to use to pull localizations
99 # MOZ_PREFLIGHT_ALL } - Makefiles to run before any project in
100 # MOZ_PREFLIGHT } MOZ_BUILD_PROJECTS, before each project, after
101 # MOZ_POSTFLIGHT } each project, and after all projects; these
102 # MOZ_POSTFLIGHT_ALL } variables contain space-separated lists
103 # MOZ_UNIFY_BDATE - Set to use the same bdate for each project in
104 # MOZ_BUILD_PROJECTS
107 AVAILABLE_PROJECTS = \
108 all \
109 suite \
110 toolkit \
111 browser \
112 mail \
113 minimo \
114 composer \
115 calendar \
116 xulrunner \
117 camino \
118 necko \
119 tamarin \
120 $(NULL)
122 # Trailing / on top-level mozilla dir required to stop fast-update thinking
123 # it is a module name.
124 MODULES_NS_necko := \
125 mozilla/ \
126 $(NULL)
128 MODULES_necko := \
129 mozilla/README \
130 mozilla/config \
131 mozilla/build \
132 mozilla/intl \
133 mozilla/modules/libpref \
134 mozilla/modules/zlib \
135 mozilla/netwerk \
136 mozilla/xpcom \
137 mozilla/tools/test-harness \
138 $(NULL)
140 MODULES_NS_core := \
141 $(MODULES_NS_necko) \
142 mozilla/js \
143 mozilla/js/src \
144 mozilla/js/jsd \
145 mozilla/db \
146 $(NULL)
148 MODULES_core := \
149 $(MODULES_necko) \
150 mozilla/caps \
151 mozilla/content \
152 mozilla/db/mdb \
153 mozilla/db/mork \
154 mozilla/docshell \
155 mozilla/dom \
156 mozilla/editor \
157 mozilla/embedding \
158 mozilla/extensions \
159 mozilla/gfx \
160 mozilla/parser \
161 mozilla/layout \
162 mozilla/jpeg \
163 mozilla/js/src/fdlibm \
164 mozilla/js/src/liveconnect \
165 mozilla/js/src/xpconnect \
166 mozilla/js/jsd/idl \
167 mozilla/modules/lcms \
168 mozilla/modules/libimg \
169 mozilla/modules/libjar \
170 mozilla/modules/libpr0n \
171 mozilla/modules/libreg \
172 mozilla/modules/libutil \
173 mozilla/modules/oji \
174 mozilla/modules/plugin \
175 mozilla/modules/staticmod \
176 mozilla/plugin/oji \
177 mozilla/profile \
178 mozilla/probes \
179 mozilla/rdf \
180 mozilla/security/manager \
181 mozilla/sun-java \
182 mozilla/ipc/ipcd \
183 mozilla/modules/libpr0n \
184 mozilla/modules/libmar \
185 mozilla/modules/libbz2 \
186 mozilla/accessible \
187 mozilla/other-licenses/atk-1.0 \
188 mozilla/other-licenses/ia2 \
189 mozilla/security/manager \
190 mozilla/tools/elf-dynstr-gc \
191 mozilla/uriloader \
192 mozilla/view \
193 mozilla/webshell \
194 mozilla/widget \
195 mozilla/xpfe \
196 mozilla/xpinstall \
197 mozilla/toolkit \
198 mozilla/storage \
199 mozilla/db/sqlite3 \
200 mozilla/db/morkreader \
201 mozilla/testing/crashtest \
202 mozilla/testing/mochitest \
203 $(NULL)
205 LOCALES_necko := \
206 netwerk \
207 $(NULL)
209 LOCALES_core := \
210 $(LOCALES_necko) \
211 dom \
212 $(NULL)
214 BOOTSTRAP_necko := \
215 mozilla/browser/config/version.txt \
216 mozilla/mail/config/version.txt \
217 mozilla/calendar/sunbird/config/version.txt \
218 mozilla/suite/config/version.txt \
219 $(NULL)
221 BOOTSTRAP_core := \
222 $(BOOTSTRAP_necko) \
223 $(NULL)
225 MODULES_NS_toolkit := \
226 $(MODULES_NS_core) \
227 $(NULL)
229 MODULES_toolkit := \
230 $(MODULES_core) \
231 mozilla/chrome \
232 $(NULL)
234 LOCALES_toolkit := \
235 $(LOCALES_core) \
236 toolkit \
237 security/manager \
238 $(NULL)
240 BOOTSTRAP_toolkit := \
241 $(BOOTSTRAP_core) \
242 $(NULL)
244 MODULES_NS_suite := \
245 $(MODULES_NS_toolkit) \
246 $(NULL)
248 MODULES_suite := \
249 $(MODULES_toolkit) \
250 mozilla/directory/xpcom \
251 mozilla/mailnews \
252 mozilla/suite \
253 mozilla/other-licenses/7zstub/seamonkey \
254 $(NULL)
256 LOCALES_suite := \
257 $(LOCALES_toolkit) \
258 suite \
259 editor/ui \
260 extensions/reporter \
261 $(NULL)
263 BOOTSTRAP_suite := \
264 $(BOOTSTRAP_toolkit) \
265 $(NULL)
267 MODULES_NS_browser := \
268 $(MODULES_NS_toolkit) \
269 $(NULL)
271 MODULES_browser := \
272 $(MODULES_toolkit) \
273 mozilla/browser \
274 mozilla/other-licenses/branding/firefox \
275 mozilla/other-licenses/7zstub/firefox \
276 $(NULL)
278 LOCALES_browser := \
279 $(LOCALES_toolkit) \
280 browser \
281 extensions/reporter \
282 extensions/spellcheck \
283 other-licenses/branding/firefox \
284 $(NULL)
286 BOOTSTRAP_browser := \
287 $(BOOTSTRAP_toolkit) \
288 mozilla/browser/config/mozconfig \
289 $(NULL)
291 MODULES_NS_minimo := \
292 $(MODULES_NS_toolkit) \
293 $(NULL)
295 MODULES_minimo := \
296 $(MODULES_toolkit) \
297 mozilla/minimo \
298 $(NULL)
300 BOOTSTRAP_minimo := \
301 $(BOOTSTRAP_toolkit) \
302 $(NULL)
304 MODULES_NS_mail := \
305 $(MODULES_NS_toolkit) \
306 $(NULL)
308 MODULES_mail := \
309 $(MODULES_toolkit) \
310 mozilla/directory/xpcom \
311 mozilla/mailnews \
312 mozilla/mail \
313 mozilla/other-licenses/branding/thunderbird \
314 mozilla/other-licenses/7zstub/thunderbird \
315 $(NULL)
317 LOCALES_mail := \
318 $(LOCALES_toolkit) \
319 mail \
320 other-licenses/branding/thunderbird \
321 editor/ui \
322 extensions/spellcheck \
323 $(NULL)
325 BOOTSTRAP_mail := \
326 $(BOOTSTRAP_toolkit) \
327 mozilla/mail/config/mozconfig \
328 $(NULL)
330 MODULES_composer := \
331 $(MODULES_toolkit) \
332 mozilla/composer \
333 $(NULL)
335 MODULES_NS_calendar := \
336 $(MODULES_NS_toolkit) \
337 $(NULL)
339 MODULES_calendar := \
340 $(MODULES_toolkit) \
341 mozilla/storage \
342 mozilla/db/sqlite3 \
343 mozilla/calendar \
344 mozilla/other-licenses/branding/sunbird \
345 mozilla/other-licenses/7zstub/sunbird \
346 $(NULL)
348 LOCALES_calendar := \
349 $(LOCALES_toolkit) \
350 calendar \
351 other-licenses/branding/sunbird \
352 $(NULL)
354 BOOTSTRAP_calendar := \
355 $(BOOTSTRAP_toolkit) \
356 mozilla/calendar/sunbird/config/mozconfig \
357 $(NULL)
359 MODULES_NS_xulrunner := \
360 $(MODULES_NS_toolkit) \
361 $(NULL)
363 MODULES_xulrunner := \
364 $(MODULES_toolkit) \
365 mozilla/xulrunner \
366 $(NULL)
368 LOCALES_xulrunner := \
369 $(LOCALES_toolkit) \
370 $(NULL)
372 BOOTSTRAP_xulrunner := \
373 $(BOOTSTRAP_toolkit) \
374 mozilla/xulrunner/config/mozconfig \
375 $(NULL)
377 MODULES_NS_camino := \
378 $(MODULES_NS_toolkit) \
379 $(NULL)
381 MODULES_camino := \
382 $(MODULES_core) \
383 mozilla/camino \
384 mozilla/themes \
385 $(NULL)
387 BOOTSTRAP_camino := \
388 $(BOOTSTRAP_toolkit) \
389 mozilla/camino/config/mozconfig \
390 $(NULL)
392 MODULES_tamarin := \
393 mozilla/js/tamarin \
394 mozilla/modules/zlib \
395 $(NULL)
397 MODULES_all := \
398 mozilla/other-licenses/bsdiff \
399 mozilla/other-licenses/libart_lgpl \
400 mozilla/tools/trace-malloc \
401 mozilla/tools/jprof \
402 mozilla/tools/codesighs \
403 mozilla/tools/update-packaging \
404 $(NULL)
406 #######################################################################
407 # Checkout Tags
409 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
410 # and commit this file on that tag.
411 #MOZ_CO_TAG = <tag>
412 NSPR_CO_TAG = NSPR_HEAD_20071016
413 NSS_CO_TAG = NSS_3_12_ALPHA_2B
414 LDAPCSDK_CO_TAG = LDAPCSDK_6_0_3_CLIENT_BRANCH
415 LOCALES_CO_TAG =
417 #######################################################################
418 # Defines
420 CVS = cvs
421 comma := ,
423 CWD := $(shell pwd)
424 ifneq (1,$(words $(CWD)))
425 $(error The mozilla directory cannot be located in a path with spaces.)
426 endif
428 ifeq "$(CWD)" "/"
429 CWD := /.
430 endif
432 ifneq (, $(wildcard client.mk))
433 # Ran from mozilla directory
434 ROOTDIR := $(shell dirname $(CWD))
435 TOPSRCDIR := $(CWD)
436 else
437 # Ran from mozilla/.. directory (?)
438 ROOTDIR := $(CWD)
439 TOPSRCDIR := $(CWD)/mozilla
440 endif
442 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
443 # work; replace first instance with one forward slash
444 TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
446 ifndef TOPSRCDIR_MOZ
447 TOPSRCDIR_MOZ=$(TOPSRCDIR)
448 endif
450 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
451 DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
452 ifeq ($(DIRNAME),)
453 ROOTDIR := /.
454 endif
456 AUTOCONF := autoconf
457 MKDIR := mkdir
458 SH := /bin/sh
459 ifndef MAKE
460 MAKE := gmake
461 endif
462 PERL ?= perl
463 PYTHON ?= python
465 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
466 ifdef CONFIG_GUESS_SCRIPT
467 CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
468 else
469 _IS_FIRST_CHECKOUT := 1
470 endif
472 ####################################
473 # Sanity checks
475 ifneq (,$(filter MINGW%,$(shell uname -s)))
476 # check for CRLF line endings
477 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
478 $(error This source tree appears to have Windows-style line endings. To \
479 convert it to Unix-style line endings, run \
480 "python mozilla/build/win32/mozilla-dos2unix.py")
481 endif
482 endif
484 ####################################
485 # CVS
487 # Add the CVS root to CVS_FLAGS if needed
488 CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
489 ifneq ($(CVS_ROOT_IN_TREE),)
490 ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
491 CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
492 endif
493 endif
495 CVS_CO_DATE_FLAGS = $(if $(MOZ_CO_DATE),-D "$(MOZ_CO_DATE)")
496 CVS_CO_LOCALES_DATE_FLAGS = $(if $(MOZ_CO_LOCALES_DATE),-D "$(MOZ_CO_LOCALES_DATE)")
497 CVSCO = $(CVS) $(CVS_FLAGS) co $(MOZ_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG)) $(CVS_CO_DATE_FLAGS)
499 MOZ_CO_LOCALES_DATE ?= $(MOZ_CO_DATE)
501 CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
502 CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
504 # if LOCALES_CVSROOT is not specified, set it here
505 # (and let mozconfig override it)
506 LOCALES_CVSROOT ?= :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/l10n
508 ####################################
509 # Load mozconfig Options
511 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
513 MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
514 MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
515 MOZCONFIG_MODULES := mozilla/build/unix/uniq.pl
516 run_for_side_effects := \
517 $(shell cd $(ROOTDIR); \
518 if test "$(_IS_FIRST_CHECKOUT)"; then \
519 $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
520 else true; \
521 fi; \
522 $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
523 include $(TOPSRCDIR)/.mozconfig.mk
525 ####################################
526 # Options that may come from mozconfig
528 MOZ_PROJECT_LIST := $(subst $(comma), ,$(MOZ_CO_PROJECT))
529 MOZ_PROJECT_LIST := $(subst macbrowser,camino,$(MOZ_PROJECT_LIST))
531 ifneq (,$(filter-out $(AVAILABLE_PROJECTS),$(MOZ_PROJECT_LIST)))
532 $(error MOZ_CO_PROJECT contains an unrecognized project.)
533 endif
535 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST)))
536 MOZ_PROJECT_LIST := $(AVAILABLE_PROJECTS)
537 endif
539 MOZ_MODULE_LIST := $(subst $(comma), ,$(MOZ_CO_MODULE)) $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_$(project)))
540 MOZ_MODULE_LIST_NS := $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_NS_$(project)))
541 LOCALE_DIRS := $(MOZ_LOCALE_DIRS) $(foreach project,$(MOZ_PROJECT_LIST),$(LOCALES_$(project)))
543 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),$(BOOTSTRAP_$(project)))
545 # Using $(sort) here because it also removes duplicate entries.
546 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
547 LOCALE_DIRS := $(sort $(LOCALE_DIRS))
548 MOZCONFIG_MODULES := $(sort $(MOZCONFIG_MODULES))
550 # Change CVS flags if anonymous root is requested
551 ifdef MOZ_CO_USE_MIRROR
552 CVS_FLAGS := -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
553 endif
555 # MOZ_CVS_FLAGS - Basic CVS flags
556 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
557 CVS_FLAGS := $(CVS_FLAGS) -q -z 3
558 else
559 CVS_FLAGS := $(MOZ_CVS_FLAGS)
560 endif
562 ifdef MOZ_BUILD_PROJECTS
564 ifndef MOZ_OBJDIR
565 $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
566 endif
567 ifdef MOZ_CURRENT_PROJECT
568 OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
569 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
570 BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
571 else
572 OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
573 MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
574 endif
576 else # MOZ_BUILD_PROJECTS
578 ifdef MOZ_OBJDIR
579 OBJDIR = $(MOZ_OBJDIR)
580 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
581 else
582 OBJDIR := $(TOPSRCDIR)
583 MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
584 endif
586 endif # MOZ_BUILD_PROJECTS
588 ####################################
589 # CVS defines for NSS
591 NSS_CO_MODULE = \
592 mozilla/dbm \
593 mozilla/security/nss \
594 mozilla/security/coreconf \
595 mozilla/security/dbm \
596 $(NULL)
598 NSS_CO_FLAGS := -P
599 ifdef MOZ_CO_FLAGS
600 NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
601 endif
602 NSS_CO_FLAGS := $(NSS_CO_FLAGS) $(if $(NSS_CO_TAG),-r $(NSS_CO_TAG),-A)
604 # Can only pull the tip or branch tags by date
605 ifeq (,$(filter-out HEAD %BRANCH,$(NSS_CO_TAG)))
606 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
607 else
608 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
609 endif
611 ####################################
612 # CVS defines for NSPR
614 NSPR_CO_MODULE = mozilla/nsprpub
615 NSPR_CO_FLAGS := -P
616 ifdef MOZ_CO_FLAGS
617 NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
618 endif
619 NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) $(if $(NSPR_CO_TAG),-r $(NSPR_CO_TAG),-A)
621 # Can only pull the tip or branch tags by date
622 ifeq (,$(filter-out HEAD %BRANCH,$(NSPR_CO_TAG)))
623 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
624 else
625 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
626 endif
628 ####################################
629 # CVS defines for the C LDAP SDK
631 LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
632 LDAPCSDK_CO_FLAGS := -P
633 ifdef MOZ_CO_FLAGS
634 LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
635 endif
636 LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) $(if $(LDAPCSDK_CO_TAG),-r $(LDAPCSDK_CO_TAG),-A)
638 # Can only pull the tip or branch tags by date
639 ifeq (,$(filter-out HEAD %BRANCH,$(LDAPCSDK_CO_TAG)))
640 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
641 else
642 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(LDAPCSDK_CO_MODULE)
643 endif
645 ####################################
646 # Error on obsolete variables.
649 ifdef MOZ_MAPINFO
650 $(warning MOZ_MAPINFO is obsolete, use MOZ_CO_MODULE=mozilla/tools/codesighs instead.)
651 MOZ_MODULE_LIST += mozilla/tools/codesighs
652 endif
653 ifdef MOZ_INTERNAL_LIBART_LGPL
654 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete, use MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl instead.)
655 endif
656 ifdef MOZ_PHOENIX
657 $(warning MOZ_PHOENIX is obsolete.)
658 MOZ_MODULE_LIST += $(MODULES_browser)
659 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
660 endif
661 ifdef MOZ_THUNDERBIRD
662 $(warning MOZ_THUNDERBIRD is obsolete.)
663 MOZ_MODULE_LIST += $(MODULES_mail)
664 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
665 endif
667 ###################################
668 # Checkout main modules
671 # sort is used to remove duplicates.
672 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
673 MOZ_MODULE_LIST_NS := $(sort $(MOZ_MODULE_LIST_NS))
675 ####################################
676 # Suppress standalone modules if they're not needed.
678 CONFIGURES := $(TOPSRCDIR)/configure
679 ifeq (,$(filter mozilla/xpcom,$(MOZ_MODULE_LIST)))
680 CVSCO_NSPR :=
681 else
682 CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
683 endif
685 ifeq (,$(filter mozilla/security/manager,$(MOZ_MODULE_LIST)))
686 CVSCO_NSS :=
687 endif
688 ifeq (,$(filter mozilla/directory/xpcom,$(MOZ_MODULE_LIST)))
689 CVSCO_LDAPCSDK :=
690 else
691 CONFIGURES += $(TOPSRCDIR)/directory/c-sdk/configure
692 endif
694 MODULES_CO_FLAGS := -P
695 ifdef MOZ_CO_FLAGS
696 MODULES_CO_FLAGS := $(MOZ_CO_FLAGS)
697 endif
698 MODULES_CO_FLAGS := $(MODULES_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG),-A)
700 CVSCO_MODULES_NS = $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(MOZ_MODULE_LIST_NS)
702 ifeq (,$(strip $(MOZ_MODULE_LIST)))
703 FASTUPDATE_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
704 CHECKOUT_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
705 else
706 FASTUPDATE_MODULES := fast_update $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST)
707 CHECKOUT_MODULES := cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST);
708 endif
709 ifeq (,$(MOZ_MODULE_LIST_NS))
710 FASTUPDATE_MODULES_NS := true
711 CHECKOUT_MODULES_NS := true
712 else
713 FASTUPDATE_MODULES_NS := fast_update $(CVSCO_MODULES_NS)
714 CHECKOUT_MODULES_NS := cvs_co $(CVSCO_MODULES_NS)
715 endif
717 ###################################
718 # CVS defines for locales
721 LOCALES_CO_FLAGS := -P
722 ifdef MOZ_CO_FLAGS
723 LOCALES_CO_FLAGS := $(MOZ_CO_FLAGS)
724 endif
725 LOCALES_CO_FLAGS := $(LOCALES_CO_FLAGS) $(if $(LOCALES_CO_TAG),-r $(LOCALES_CO_TAG),-A)
727 ifndef MOZ_CO_LOCALES
728 FASTUPDATE_LOCALES := true
729 CHECKOUT_LOCALES := true
730 else
732 override MOZ_CO_LOCALES := $(subst $(comma), ,$(MOZ_CO_LOCALES))
734 ifeq (all,$(MOZ_CO_LOCALES))
735 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),mozilla/$(project)/locales/all-locales)
737 LOCALE_CO_DIRS := $(sort $(foreach project,$(MOZ_PROJECT_LIST),$(foreach locale,$(shell cat mozilla/$(project)/locales/all-locales),$(foreach dir,$(LOCALES_$(project)),l10n/$(locale)/$(dir)))))
738 else # MOZ_CO_LOCALES != all
739 LOCALE_CO_DIRS = $(sort $(foreach locale,$(MOZ_CO_LOCALES),$(foreach dir,$(LOCALE_DIRS),l10n/$(locale)/$(dir))))
740 endif
742 CVSCO_LOCALES := $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_LOCALES_DATE_FLAGS) $(LOCALE_CO_DIRS)
744 FASTUPDATE_LOCALES := fast_update $(CVSCO_LOCALES)
745 CHECKOUT_LOCALES := cvs_co $(CVSCO_LOCALES)
746 endif #MOZ_CO_LOCALES
748 #######################################################################
749 # Rules
752 # Print out any options loaded from mozconfig.
753 all build checkout clean depend distclean export libs install realclean::
754 @if test -f .mozconfig.out; then \
755 cat .mozconfig.out; \
756 rm -f .mozconfig.out; \
757 else true; \
760 ifdef _IS_FIRST_CHECKOUT
761 all:: checkout build
762 else
763 all:: checkout alldep
764 endif
766 # Windows equivalents
767 pull_all: checkout
768 build_all: build
769 build_all_dep: alldep
770 build_all_depend: alldep
771 clobber clobber_all: clean
772 pull_and_build_all: checkout alldep
774 # Do everything from scratch
775 everything: checkout clean build
777 ####################################
778 # CVS checkout
780 checkout::
781 # @: Backup the last checkout log.
782 @if test -f $(CVSCO_LOGFILE) ; then \
783 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
784 else true; \
786 ifdef RUN_AUTOCONF_LOCALLY
787 @echo "Removing local configures" ; \
788 cd $(ROOTDIR) && \
789 $(RM) -f $(CONFIGURES)
790 endif
791 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
792 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
793 cd $(ROOTDIR) && \
794 $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
795 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
797 # Start the checkout. Split the output to the tty and a log file.
799 real_checkout:
800 @set -e; \
801 cvs_co() { set -e; echo "$$@" ; \
802 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
803 cvs_co $(CVSCO_NSPR); \
804 cvs_co $(CVSCO_NSS); \
805 cvs_co $(CVSCO_LDAPCSDK); \
806 $(CHECKOUT_MODULES_NS); \
807 $(CHECKOUT_MODULES) \
808 $(CHECKOUT_LOCALES);
809 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
810 # update the NSS checkout timestamp, if we checked PSM out
811 @if test -d $(TOPSRCDIR)/security/manager -a \
812 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
813 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
815 ifdef RUN_AUTOCONF_LOCALLY
816 cd $(ROOTDIR) && \
817 $(RM) -f $(CONFIGURES)
818 endif
819 # @: Check the log for conflicts. ;
820 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
821 if test "$$conflicts" ; then \
822 echo "$(MAKE): *** Conflicts during checkout." ;\
823 echo "$$conflicts" ;\
824 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
825 false; \
826 else true; \
829 fast-update:
830 # @: Backup the last checkout log.
831 @if test -f $(CVSCO_LOGFILE) ; then \
832 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
833 else true; \
835 ifdef RUN_AUTOCONF_LOCALLY
836 @echo "Removing local configures" ; \
837 cd $(ROOTDIR) && \
838 $(RM) -f $(CONFIGURES)
839 endif
840 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
841 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
842 cd $(ROOTDIR) && \
843 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
844 @cd $(TOPSRCDIR) && \
845 $(MAKE) -f client.mk real_fast-update
847 # Start the update. Split the output to the tty and a log file.
848 real_fast-update:
849 @set -e; \
850 fast_update() { set -e; config/cvsco-fast-update.pl $$@ 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
851 cvs_co() { set -e; echo "$$@" ; \
852 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
853 fast_update $(CVSCO_NSPR); \
854 cd $(ROOTDIR); \
855 cvs_co $(CVSCO_NSS); \
856 cd mozilla; \
857 fast_update $(CVSCO_LDAPCSDK); \
858 $(FASTUPDATE_MODULES); \
859 $(FASTUPDATE_MODULES_NS); \
860 $(FASTUPDATE_LOCALES);
861 @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
862 # update the NSS checkout timestamp
863 @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
864 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
866 ifdef RUN_AUTOCONF_LOCALLY
867 cd $(ROOTDIR) && \
868 $(RM) -f $(CONFIGURES)
869 endif
870 # @: Check the log for conflicts. ;
871 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
872 if test "$$conflicts" ; then \
873 echo "$(MAKE): *** Conflicts during fast-update." ;\
874 echo "$$conflicts" ;\
875 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
876 false; \
877 else true; \
880 CVSCO_LOGFILE_L10N := $(ROOTDIR)/cvsco-l10n.log
881 CVSCO_LOGFILE_L10N := $(shell echo $(CVSCO_LOGFILE_L10N) | sed s%//%/%)
883 l10n-checkout:
884 # @: Backup the last checkout log.
885 @if test -f $(CVSCO_LOGFILE_L10N) ; then \
886 mv $(CVSCO_LOGFILE_L10N) $(CVSCO_LOGFILE_L10N).old; \
887 else true; \
889 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE_L10N)
890 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
891 cd $(ROOTDIR) && \
892 $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
893 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_l10n-checkout
895 FULL_EN_US_DIRS := toolkit \
896 extensions \
897 $(MOZ_PROJECT_LIST) \
898 $(NULL)
900 EN_US_LOCALE_DIRS := $(foreach dir, \
901 $(filter-out toolkit extensions/% $(MOZ_PROJECT_LIST), $(LOCALE_DIRS)), \
902 mozilla/$(dir)/locales)
904 EN_US_CO_DIRS := $(EN_US_LOCALE_DIRS) \
905 $(foreach mod,$(FULL_EN_US_DIRS),mozilla/$(mod)) \
906 mozilla/client.mk \
907 mozilla/configure \
908 mozilla/configure.in \
909 mozilla/allmakefiles.sh \
910 mozilla/build \
911 mozilla/config \
912 $(NULL)
914 # Start the checkout. Split the output to the tty and a log file.
915 real_l10n-checkout:
916 @set -e; \
917 cvs_co() { set -e; echo "$$@" ; \
918 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE_L10N); }; \
919 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(EN_US_CO_DIRS); \
920 cvs_co $(CVSCO_LOCALES)
921 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE_L10N)
922 # @: Check the log for conflicts. ;
923 @conflicts=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
924 if test "$$conflicts" ; then \
925 echo "$(MAKE): *** Conflicts during checkout." ;\
926 echo "$$conflicts" ;\
927 echo "$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
928 false; \
929 else true; \
932 #####################################################
933 # First Checkout
935 ifdef _IS_FIRST_CHECKOUT
936 # First time, do build target in a new process to pick up new files.
937 build::
938 $(MAKE) -f $(TOPSRCDIR)/client.mk build
939 else
941 #####################################################
942 # After First Checkout
944 #####################################################
945 # Build date unification
947 ifdef MOZ_UNIFY_BDATE
948 ifndef MOZ_BUILD_DATE
949 ifdef MOZ_BUILD_PROJECTS
950 MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
951 export MOZ_BUILD_DATE
952 endif
953 endif
954 endif
956 #####################################################
957 # Preflight, before building any project
959 build profiledbuild alldep preflight_all::
960 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
961 # Don't run preflight_all for individual projects in multi-project builds
962 # (when MOZ_CURRENT_PROJECT is set.)
963 ifndef MOZ_BUILD_PROJECTS
964 # Building a single project, OBJDIR is usable.
965 set -e; \
966 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
967 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
968 done
969 else
970 # OBJDIR refers to the project-specific OBJDIR, which is not available at
971 # this point when building multiple projects. Only MOZ_OBJDIR is available.
972 set -e; \
973 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
974 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
975 done
976 endif
977 endif
979 # If we're building multiple projects, but haven't specified which project,
980 # loop through them.
982 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
983 configure depend build profiledbuild install export libs clean realclean distclean alldep preflight postflight::
984 set -e; \
985 for app in $(MOZ_BUILD_PROJECTS); do \
986 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
987 done
989 else
991 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
992 # individual project in a multi-project build.
994 ####################################
995 # Configure
997 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
998 CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
1000 ifdef RUN_AUTOCONF_LOCALLY
1001 EXTRA_CONFIG_DEPS := \
1002 $(TOPSRCDIR)/aclocal.m4 \
1003 $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
1004 $(NULL)
1006 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
1007 @echo Generating $@ using autoconf
1008 cd $(TOPSRCDIR); $(AUTOCONF)
1010 $(TOPSRCDIR)/nsprpub/configure: $(TOPSRCDIR)/nsprpub/configure.in $(EXTRA_CONFIG_DEPS)
1011 @echo Generating $@ using autoconf
1012 cd $(TOPSRCDIR)/nsprpub; $(AUTOCONF)
1014 $(TOPSRCDIR)/directory/c-sdk/configure: $(TOPSRCDIR)/directory/c-sdk/configure.in $(EXTRA_CONFIG_DEPS)
1015 @echo Generating $@ using autoconf
1016 cd $(TOPSRCDIR)/directory/c-sdk; $(AUTOCONF)
1017 endif
1019 CONFIG_STATUS_DEPS := \
1020 $(TOPSRCDIR)/configure \
1021 $(TOPSRCDIR)/.mozconfig.mk \
1022 $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
1023 $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
1024 $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
1025 $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
1026 $(wildcard $(addsuffix confvars.sh,$(wildcard */))) \
1027 $(NULL)
1029 # configure uses the program name to determine @srcdir@. Calling it without
1030 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1031 # path of $(TOPSRCDIR).
1032 ifeq ($(TOPSRCDIR),$(OBJDIR))
1033 CONFIGURE = ./configure
1034 else
1035 CONFIGURE = $(TOPSRCDIR)/configure
1036 endif
1038 ifdef MOZ_TOOLS
1039 CONFIGURE = $(TOPSRCDIR)/configure
1040 endif
1042 configure:: $(CONFIGURES)
1043 ifdef MOZ_BUILD_PROJECTS
1044 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1045 endif
1046 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1047 @echo cd $(OBJDIR);
1048 @echo $(CONFIGURE) $(CONFIGURE_ARGS)
1049 @cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
1050 || ( echo "*** Fix above errors and then restart with\
1051 \"$(MAKE) -f client.mk build\"" && exit 1 )
1052 @touch $(OBJDIR)/Makefile
1054 $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
1055 @$(MAKE) -f $(TOPSRCDIR)/client.mk configure
1057 ifneq (,$(CONFIG_STATUS))
1058 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
1059 cd $(OBJDIR); \
1060 CONFIG_FILES=config/autoconf.mk ./config.status
1061 endif
1064 ####################################
1065 # Depend
1067 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1068 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1070 ####################################
1071 # Preflight
1073 build profiledbuild alldep preflight::
1074 ifdef MOZ_PREFLIGHT
1075 set -e; \
1076 for mkfile in $(MOZ_PREFLIGHT); do \
1077 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1078 done
1079 endif
1081 ####################################
1082 # Build it
1084 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1085 $(MOZ_MAKE)
1087 ####################################
1088 # Profile-feedback build (gcc only)
1089 # To use this, you should set the following variables in your mozconfig
1090 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
1092 # The profile script should exercise the functionality to be included
1093 # in the profile feedback.
1095 profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1096 $(MOZ_MAKE) MOZ_PROFILE_GENERATE=1
1097 OBJDIR=${OBJDIR} $(PROFILE_GEN_SCRIPT)
1098 $(MOZ_MAKE) clobber_all
1099 $(MOZ_MAKE) MOZ_PROFILE_USE=1
1100 find $(OBJDIR) -name "*.da" -exec rm {} \;
1102 ####################################
1103 # Other targets
1105 # Pass these target onto the real build system
1106 install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1107 $(MOZ_MAKE) $@
1109 ####################################
1110 # Postflight
1112 build profiledbuild alldep postflight::
1113 ifdef MOZ_POSTFLIGHT
1114 set -e; \
1115 for mkfile in $(MOZ_POSTFLIGHT); do \
1116 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1117 done
1118 endif
1120 endif # MOZ_CURRENT_PROJECT
1122 ####################################
1123 # Postflight, after building all projects
1125 build profiledbuild alldep postflight_all::
1126 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
1127 # Don't run postflight_all for individual projects in multi-project builds
1128 # (when MOZ_CURRENT_PROJECT is set.)
1129 ifndef MOZ_BUILD_PROJECTS
1130 # Building a single project, OBJDIR is usable.
1131 set -e; \
1132 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1133 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1134 done
1135 else
1136 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1137 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1138 set -e; \
1139 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1140 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1141 done
1142 endif
1143 endif
1145 cleansrcdir:
1146 @cd $(TOPSRCDIR); \
1147 if [ -f Makefile ]; then \
1148 $(MAKE) distclean ; \
1149 else \
1150 echo "Removing object files from srcdir..."; \
1151 rm -fr `find . -type d \( -name .deps -print -o -name CVS \
1152 -o -exec test ! -d {}/CVS \; \) -prune \
1153 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1154 build/autoconf/clean-config.sh; \
1157 # (! IS_FIRST_CHECKOUT)
1158 endif
1160 echo-variable-%:
1161 @echo $($*)
1163 .PHONY: checkout real_checkout depend build export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all