bug 418384. use GDI when Uniscribe doesn't like a font. Fixes crash. r=vlad a=beltzner
[mozilla-central.git] / client.mk
blob6ce2d55d59a833529d3f3cae117e872c1668d184
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/memory/jemalloc \
163 mozilla/jpeg \
164 mozilla/js/src/fdlibm \
165 mozilla/js/src/liveconnect \
166 mozilla/js/src/xpconnect \
167 mozilla/js/jsd/idl \
168 mozilla/modules/lcms \
169 mozilla/modules/libimg \
170 mozilla/modules/libjar \
171 mozilla/modules/libpr0n \
172 mozilla/modules/libreg \
173 mozilla/modules/libutil \
174 mozilla/modules/oji \
175 mozilla/modules/plugin \
176 mozilla/modules/staticmod \
177 mozilla/plugin/oji \
178 mozilla/profile \
179 mozilla/probes \
180 mozilla/rdf \
181 mozilla/security/manager \
182 mozilla/sun-java \
183 mozilla/ipc/ipcd \
184 mozilla/modules/libpr0n \
185 mozilla/modules/libmar \
186 mozilla/modules/libbz2 \
187 mozilla/accessible \
188 mozilla/other-licenses/atk-1.0 \
189 mozilla/other-licenses/ia2 \
190 mozilla/security/manager \
191 mozilla/tools/elf-dynstr-gc \
192 mozilla/uriloader \
193 mozilla/view \
194 mozilla/webshell \
195 mozilla/widget \
196 mozilla/xpfe \
197 mozilla/xpinstall \
198 mozilla/toolkit \
199 mozilla/storage \
200 mozilla/db/sqlite3 \
201 mozilla/db/morkreader \
202 mozilla/testing/crashtest \
203 mozilla/testing/mochitest \
204 $(NULL)
206 LOCALES_necko := \
207 netwerk \
208 $(NULL)
210 LOCALES_core := \
211 $(LOCALES_necko) \
212 dom \
213 $(NULL)
215 BOOTSTRAP_necko := \
216 mozilla/browser/config/version.txt \
217 mozilla/mail/config/version.txt \
218 mozilla/calendar/sunbird/config/version.txt \
219 mozilla/suite/config/version.txt \
220 $(NULL)
222 BOOTSTRAP_core := \
223 $(BOOTSTRAP_necko) \
224 $(NULL)
226 MODULES_NS_toolkit := \
227 $(MODULES_NS_core) \
228 $(NULL)
230 MODULES_toolkit := \
231 $(MODULES_core) \
232 mozilla/chrome \
233 $(NULL)
235 LOCALES_toolkit := \
236 $(LOCALES_core) \
237 toolkit \
238 security/manager \
239 $(NULL)
241 BOOTSTRAP_toolkit := \
242 $(BOOTSTRAP_core) \
243 $(NULL)
245 MODULES_NS_suite := \
246 $(MODULES_NS_toolkit) \
247 $(NULL)
249 MODULES_suite := \
250 $(MODULES_toolkit) \
251 mozilla/directory/xpcom \
252 mozilla/mailnews \
253 mozilla/suite \
254 mozilla/other-licenses/7zstub/seamonkey \
255 $(NULL)
257 LOCALES_suite := \
258 $(LOCALES_toolkit) \
259 suite \
260 editor/ui \
261 extensions/reporter \
262 extensions/spellcheck \
263 $(NULL)
265 BOOTSTRAP_suite := \
266 $(BOOTSTRAP_toolkit) \
267 $(NULL)
269 MODULES_NS_browser := \
270 $(MODULES_NS_toolkit) \
271 $(NULL)
273 MODULES_browser := \
274 $(MODULES_toolkit) \
275 mozilla/browser \
276 mozilla/other-licenses/branding/firefox \
277 mozilla/other-licenses/7zstub/firefox \
278 $(NULL)
280 LOCALES_browser := \
281 $(LOCALES_toolkit) \
282 browser \
283 extensions/reporter \
284 extensions/spellcheck \
285 other-licenses/branding/firefox \
286 $(NULL)
288 BOOTSTRAP_browser := \
289 $(BOOTSTRAP_toolkit) \
290 mozilla/browser/config/mozconfig \
291 $(NULL)
293 MODULES_NS_minimo := \
294 $(MODULES_NS_toolkit) \
295 $(NULL)
297 MODULES_minimo := \
298 $(MODULES_toolkit) \
299 mozilla/minimo \
300 $(NULL)
302 BOOTSTRAP_minimo := \
303 $(BOOTSTRAP_toolkit) \
304 $(NULL)
306 MODULES_NS_mail := \
307 $(MODULES_NS_toolkit) \
308 $(NULL)
310 MODULES_mail := \
311 $(MODULES_toolkit) \
312 mozilla/directory/xpcom \
313 mozilla/mailnews \
314 mozilla/mail \
315 mozilla/other-licenses/branding/thunderbird \
316 mozilla/other-licenses/7zstub/thunderbird \
317 $(NULL)
319 LOCALES_mail := \
320 $(LOCALES_toolkit) \
321 mail \
322 other-licenses/branding/thunderbird \
323 editor/ui \
324 extensions/spellcheck \
325 $(NULL)
327 BOOTSTRAP_mail := \
328 $(BOOTSTRAP_toolkit) \
329 mozilla/mail/config/mozconfig \
330 $(NULL)
332 MODULES_composer := \
333 $(MODULES_toolkit) \
334 mozilla/composer \
335 $(NULL)
337 MODULES_NS_calendar := \
338 $(MODULES_NS_toolkit) \
339 $(NULL)
341 MODULES_calendar := \
342 $(MODULES_toolkit) \
343 mozilla/storage \
344 mozilla/db/sqlite3 \
345 mozilla/calendar \
346 mozilla/other-licenses/branding/sunbird \
347 mozilla/other-licenses/7zstub/sunbird \
348 $(NULL)
350 LOCALES_calendar := \
351 $(LOCALES_toolkit) \
352 calendar \
353 other-licenses/branding/sunbird \
354 $(NULL)
356 BOOTSTRAP_calendar := \
357 $(BOOTSTRAP_toolkit) \
358 mozilla/calendar/sunbird/config/mozconfig \
359 $(NULL)
361 MODULES_NS_xulrunner := \
362 $(MODULES_NS_toolkit) \
363 $(NULL)
365 MODULES_xulrunner := \
366 $(MODULES_toolkit) \
367 mozilla/xulrunner \
368 $(NULL)
370 LOCALES_xulrunner := \
371 $(LOCALES_toolkit) \
372 $(NULL)
374 BOOTSTRAP_xulrunner := \
375 $(BOOTSTRAP_toolkit) \
376 mozilla/xulrunner/config/mozconfig \
377 $(NULL)
379 MODULES_NS_camino := \
380 $(MODULES_NS_toolkit) \
381 $(NULL)
383 MODULES_camino := \
384 $(MODULES_core) \
385 mozilla/camino \
386 mozilla/themes \
387 $(NULL)
389 BOOTSTRAP_camino := \
390 $(BOOTSTRAP_toolkit) \
391 mozilla/camino/config/mozconfig \
392 $(NULL)
394 MODULES_tamarin := \
395 mozilla/js/tamarin \
396 mozilla/modules/zlib \
397 $(NULL)
399 MODULES_all := \
400 mozilla/other-licenses/bsdiff \
401 mozilla/other-licenses/libart_lgpl \
402 mozilla/tools/trace-malloc \
403 mozilla/tools/jprof \
404 mozilla/tools/codesighs \
405 mozilla/tools/update-packaging \
406 $(NULL)
408 #######################################################################
409 # Checkout Tags
411 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
412 # and commit this file on that tag.
413 #MOZ_CO_TAG = <tag>
414 NSPR_CO_TAG = NSPR_4_7_1_BETA2
415 NSS_CO_TAG = NSS_3_12_BETA3
416 LDAPCSDK_CO_TAG = LDAPCSDK_6_0_3_CLIENT_BRANCH
417 LOCALES_CO_TAG =
419 #######################################################################
420 # Defines
422 CVS = cvs
423 comma := ,
425 CWD := $(shell pwd)
426 ifneq (1,$(words $(CWD)))
427 $(error The mozilla directory cannot be located in a path with spaces.)
428 endif
430 ifeq "$(CWD)" "/"
431 CWD := /.
432 endif
434 ifneq (, $(wildcard client.mk))
435 # Ran from mozilla directory
436 ROOTDIR := $(shell dirname $(CWD))
437 TOPSRCDIR := $(CWD)
438 else
439 # Ran from mozilla/.. directory (?)
440 ROOTDIR := $(CWD)
441 TOPSRCDIR := $(CWD)/mozilla
442 endif
444 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
445 # work; replace first instance with one forward slash
446 TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
448 ifndef TOPSRCDIR_MOZ
449 TOPSRCDIR_MOZ=$(TOPSRCDIR)
450 endif
452 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
453 DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
454 ifeq ($(DIRNAME),)
455 ROOTDIR := /.
456 endif
458 AUTOCONF := autoconf
459 MKDIR := mkdir
460 SH := /bin/sh
461 ifndef MAKE
462 MAKE := gmake
463 endif
464 PERL ?= perl
465 PYTHON ?= python
467 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
468 ifdef CONFIG_GUESS_SCRIPT
469 CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
470 else
471 _IS_FIRST_CHECKOUT := 1
472 endif
474 ####################################
475 # Sanity checks
477 ifneq (,$(filter MINGW%,$(shell uname -s)))
478 # check for CRLF line endings
479 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
480 $(error This source tree appears to have Windows-style line endings. To \
481 convert it to Unix-style line endings, run \
482 "python mozilla/build/win32/mozilla-dos2unix.py")
483 endif
484 endif
486 ####################################
487 # CVS
489 # Add the CVS root to CVS_FLAGS if needed
490 CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
491 ifneq ($(CVS_ROOT_IN_TREE),)
492 ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
493 CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
494 endif
495 endif
497 CVS_CO_DATE_FLAGS = $(if $(MOZ_CO_DATE),-D "$(MOZ_CO_DATE)")
498 CVS_CO_LOCALES_DATE_FLAGS = $(if $(MOZ_CO_LOCALES_DATE),-D "$(MOZ_CO_LOCALES_DATE)")
499 CVSCO = $(CVS) $(CVS_FLAGS) co $(MOZ_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG)) $(CVS_CO_DATE_FLAGS)
501 MOZ_CO_LOCALES_DATE ?= $(MOZ_CO_DATE)
503 CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
504 CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
506 # if LOCALES_CVSROOT is not specified, set it here
507 # (and let mozconfig override it)
508 LOCALES_CVSROOT ?= :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/l10n
510 ####################################
511 # Load mozconfig Options
513 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
515 MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
516 MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
517 MOZCONFIG_MODULES := mozilla/build/unix/uniq.pl
518 run_for_side_effects := \
519 $(shell cd $(ROOTDIR); \
520 if test "$(_IS_FIRST_CHECKOUT)"; then \
521 $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
522 else true; \
523 fi; \
524 $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
525 include $(TOPSRCDIR)/.mozconfig.mk
527 ####################################
528 # Options that may come from mozconfig
530 MOZ_PROJECT_LIST := $(subst $(comma), ,$(MOZ_CO_PROJECT))
531 MOZ_PROJECT_LIST := $(subst macbrowser,camino,$(MOZ_PROJECT_LIST))
533 ifneq (,$(filter-out $(AVAILABLE_PROJECTS),$(MOZ_PROJECT_LIST)))
534 $(error MOZ_CO_PROJECT contains an unrecognized project.)
535 endif
537 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST)))
538 MOZ_PROJECT_LIST := $(AVAILABLE_PROJECTS)
539 endif
541 MOZ_MODULE_LIST := $(subst $(comma), ,$(MOZ_CO_MODULE)) $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_$(project)))
542 MOZ_MODULE_LIST_NS := $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_NS_$(project)))
543 LOCALE_DIRS := $(MOZ_LOCALE_DIRS) $(foreach project,$(MOZ_PROJECT_LIST),$(LOCALES_$(project)))
545 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),$(BOOTSTRAP_$(project)))
547 # Using $(sort) here because it also removes duplicate entries.
548 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
549 LOCALE_DIRS := $(sort $(LOCALE_DIRS))
550 MOZCONFIG_MODULES := $(sort $(MOZCONFIG_MODULES))
552 # Change CVS flags if anonymous root is requested
553 ifdef MOZ_CO_USE_MIRROR
554 CVS_FLAGS := -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
555 endif
557 # MOZ_CVS_FLAGS - Basic CVS flags
558 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
559 CVS_FLAGS := $(CVS_FLAGS) -q -z 3
560 else
561 CVS_FLAGS := $(MOZ_CVS_FLAGS)
562 endif
564 ifdef MOZ_BUILD_PROJECTS
566 ifndef MOZ_OBJDIR
567 $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
568 endif
569 ifdef MOZ_CURRENT_PROJECT
570 OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
571 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
572 BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
573 else
574 OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
575 MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
576 endif
578 else # MOZ_BUILD_PROJECTS
580 ifdef MOZ_OBJDIR
581 OBJDIR = $(MOZ_OBJDIR)
582 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
583 else
584 OBJDIR := $(TOPSRCDIR)
585 MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
586 endif
588 endif # MOZ_BUILD_PROJECTS
590 ####################################
591 # CVS defines for NSS
593 NSS_CO_MODULE = \
594 mozilla/dbm \
595 mozilla/security/nss \
596 mozilla/security/coreconf \
597 mozilla/security/dbm \
598 $(NULL)
600 NSS_CO_FLAGS := -P
601 ifdef MOZ_CO_FLAGS
602 NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
603 endif
604 NSS_CO_FLAGS := $(NSS_CO_FLAGS) $(if $(NSS_CO_TAG),-r $(NSS_CO_TAG),-A)
606 # Can only pull the tip or branch tags by date
607 ifeq (,$(filter-out HEAD %BRANCH,$(NSS_CO_TAG)))
608 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
609 else
610 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
611 endif
613 ####################################
614 # CVS defines for NSPR
616 NSPR_CO_MODULE = mozilla/nsprpub
617 NSPR_CO_FLAGS := -P
618 ifdef MOZ_CO_FLAGS
619 NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
620 endif
621 NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) $(if $(NSPR_CO_TAG),-r $(NSPR_CO_TAG),-A)
623 # Can only pull the tip or branch tags by date
624 ifeq (,$(filter-out HEAD %BRANCH,$(NSPR_CO_TAG)))
625 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
626 else
627 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
628 endif
630 ####################################
631 # CVS defines for the C LDAP SDK
633 LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
634 LDAPCSDK_CO_FLAGS := -P
635 ifdef MOZ_CO_FLAGS
636 LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
637 endif
638 LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) $(if $(LDAPCSDK_CO_TAG),-r $(LDAPCSDK_CO_TAG),-A)
640 # Can only pull the tip or branch tags by date
641 ifeq (,$(filter-out HEAD %BRANCH,$(LDAPCSDK_CO_TAG)))
642 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
643 else
644 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(LDAPCSDK_CO_MODULE)
645 endif
647 ####################################
648 # Error on obsolete variables.
651 ifdef MOZ_MAPINFO
652 $(warning MOZ_MAPINFO is obsolete, use MOZ_CO_MODULE=mozilla/tools/codesighs instead.)
653 MOZ_MODULE_LIST += mozilla/tools/codesighs
654 endif
655 ifdef MOZ_INTERNAL_LIBART_LGPL
656 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete, use MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl instead.)
657 endif
658 ifdef MOZ_PHOENIX
659 $(warning MOZ_PHOENIX is obsolete.)
660 MOZ_MODULE_LIST += $(MODULES_browser)
661 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
662 endif
663 ifdef MOZ_THUNDERBIRD
664 $(warning MOZ_THUNDERBIRD is obsolete.)
665 MOZ_MODULE_LIST += $(MODULES_mail)
666 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
667 endif
669 ###################################
670 # Checkout main modules
673 # sort is used to remove duplicates.
674 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
675 MOZ_MODULE_LIST_NS := $(sort $(MOZ_MODULE_LIST_NS))
677 ####################################
678 # Suppress standalone modules if they're not needed.
680 CONFIGURES := $(TOPSRCDIR)/configure
681 ifeq (,$(filter mozilla/xpcom,$(MOZ_MODULE_LIST)))
682 CVSCO_NSPR :=
683 else
684 CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
685 endif
687 ifeq (,$(filter mozilla/security/manager,$(MOZ_MODULE_LIST)))
688 CVSCO_NSS :=
689 endif
690 ifeq (,$(filter mozilla/directory/xpcom,$(MOZ_MODULE_LIST)))
691 CVSCO_LDAPCSDK :=
692 else
693 CONFIGURES += $(TOPSRCDIR)/directory/c-sdk/configure
694 endif
696 MODULES_CO_FLAGS := -P
697 ifdef MOZ_CO_FLAGS
698 MODULES_CO_FLAGS := $(MOZ_CO_FLAGS)
699 endif
700 MODULES_CO_FLAGS := $(MODULES_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG),-A)
702 CVSCO_MODULES_NS = $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(MOZ_MODULE_LIST_NS)
704 ifeq (,$(strip $(MOZ_MODULE_LIST)))
705 FASTUPDATE_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
706 CHECKOUT_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
707 else
708 FASTUPDATE_MODULES := fast_update $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST)
709 CHECKOUT_MODULES := cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST);
710 endif
711 ifeq (,$(MOZ_MODULE_LIST_NS))
712 FASTUPDATE_MODULES_NS := true
713 CHECKOUT_MODULES_NS := true
714 else
715 FASTUPDATE_MODULES_NS := fast_update $(CVSCO_MODULES_NS)
716 CHECKOUT_MODULES_NS := cvs_co $(CVSCO_MODULES_NS)
717 endif
719 ###################################
720 # CVS defines for locales
723 LOCALES_CO_FLAGS := -P
724 ifdef MOZ_CO_FLAGS
725 LOCALES_CO_FLAGS := $(MOZ_CO_FLAGS)
726 endif
727 LOCALES_CO_FLAGS := $(LOCALES_CO_FLAGS) $(if $(LOCALES_CO_TAG),-r $(LOCALES_CO_TAG),-A)
729 ifndef MOZ_CO_LOCALES
730 FASTUPDATE_LOCALES := true
731 CHECKOUT_LOCALES := true
732 else
734 override MOZ_CO_LOCALES := $(subst $(comma), ,$(MOZ_CO_LOCALES))
736 ifeq (all,$(MOZ_CO_LOCALES))
737 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),mozilla/$(project)/locales/all-locales)
739 LOCALE_CO_DIRS := $(sort $(foreach project,$(MOZ_PROJECT_LIST),$(foreach locale,$(shell cat mozilla/$(project)/locales/all-locales),l10n/$(locale)/)))
740 else # MOZ_CO_LOCALES != all
741 LOCALE_CO_DIRS = $(sort $(foreach locale,$(MOZ_CO_LOCALES),l10n/$(locale)/))
742 endif
744 CVSCO_LOCALES := $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_LOCALES_DATE_FLAGS) $(LOCALE_CO_DIRS)
746 FASTUPDATE_LOCALES := fast_update $(CVSCO_LOCALES)
747 CHECKOUT_LOCALES := cvs_co $(CVSCO_LOCALES)
748 endif #MOZ_CO_LOCALES
750 #######################################################################
751 # Rules
754 # Print out any options loaded from mozconfig.
755 all build checkout clean depend distclean export libs install realclean::
756 @if test -f .mozconfig.out; then \
757 cat .mozconfig.out; \
758 rm -f .mozconfig.out; \
759 else true; \
762 ifdef _IS_FIRST_CHECKOUT
763 all:: checkout build
764 else
765 all:: checkout alldep
766 endif
768 # Windows equivalents
769 pull_all: checkout
770 build_all: build
771 build_all_dep: alldep
772 build_all_depend: alldep
773 clobber clobber_all: clean
774 pull_and_build_all: checkout alldep
776 # Do everything from scratch
777 everything: checkout clean build
779 ####################################
780 # CVS checkout
782 checkout::
783 # @: Backup the last checkout log.
784 @if test -f $(CVSCO_LOGFILE) ; then \
785 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
786 else true; \
788 ifdef RUN_AUTOCONF_LOCALLY
789 @echo "Removing local configures" ; \
790 cd $(ROOTDIR) && \
791 $(RM) -f $(CONFIGURES)
792 endif
793 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
794 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
795 cd $(ROOTDIR) && \
796 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
797 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
799 # Start the checkout. Split the output to the tty and a log file.
801 real_checkout:
802 @set -e; \
803 cvs_co() { set -e; echo "$$@" ; \
804 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
805 cvs_co $(CVSCO_NSPR); \
806 cvs_co $(CVSCO_NSS); \
807 cvs_co $(CVSCO_LDAPCSDK); \
808 $(CHECKOUT_MODULES_NS); \
809 $(CHECKOUT_MODULES) \
810 $(CHECKOUT_LOCALES);
811 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
812 # update the NSS checkout timestamp, if we checked PSM out
813 @if test -d $(TOPSRCDIR)/security/manager -a \
814 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
815 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
817 ifdef RUN_AUTOCONF_LOCALLY
818 cd $(ROOTDIR) && \
819 $(RM) -f $(CONFIGURES)
820 endif
821 # @: Check the log for conflicts. ;
822 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
823 if test "$$conflicts" ; then \
824 echo "$(MAKE): *** Conflicts during checkout." ;\
825 echo "$$conflicts" ;\
826 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
827 false; \
828 else true; \
831 fast-update:
832 # @: Backup the last checkout log.
833 @if test -f $(CVSCO_LOGFILE) ; then \
834 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
835 else true; \
837 ifdef RUN_AUTOCONF_LOCALLY
838 @echo "Removing local configures" ; \
839 cd $(ROOTDIR) && \
840 $(RM) -f $(CONFIGURES)
841 endif
842 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
843 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
844 cd $(ROOTDIR) && \
845 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
846 @cd $(TOPSRCDIR) && \
847 $(MAKE) -f client.mk real_fast-update
849 # Start the update. Split the output to the tty and a log file.
850 real_fast-update:
851 @set -e; \
852 fast_update() { set -e; config/cvsco-fast-update.pl $$@ 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
853 cvs_co() { set -e; echo "$$@" ; \
854 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
855 fast_update $(CVSCO_NSPR); \
856 cd $(ROOTDIR); \
857 cvs_co $(CVSCO_NSS); \
858 cd mozilla; \
859 fast_update $(CVSCO_LDAPCSDK); \
860 $(FASTUPDATE_MODULES); \
861 $(FASTUPDATE_MODULES_NS); \
862 $(FASTUPDATE_LOCALES);
863 @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
864 # update the NSS checkout timestamp
865 @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
866 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
868 ifdef RUN_AUTOCONF_LOCALLY
869 cd $(ROOTDIR) && \
870 $(RM) -f $(CONFIGURES)
871 endif
872 # @: Check the log for conflicts. ;
873 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
874 if test "$$conflicts" ; then \
875 echo "$(MAKE): *** Conflicts during fast-update." ;\
876 echo "$$conflicts" ;\
877 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
878 false; \
879 else true; \
882 CVSCO_LOGFILE_L10N := $(ROOTDIR)/cvsco-l10n.log
883 CVSCO_LOGFILE_L10N := $(shell echo $(CVSCO_LOGFILE_L10N) | sed s%//%/%)
885 l10n-checkout:
886 # @: Backup the last checkout log.
887 @if test -f $(CVSCO_LOGFILE_L10N) ; then \
888 mv $(CVSCO_LOGFILE_L10N) $(CVSCO_LOGFILE_L10N).old; \
889 else true; \
891 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE_L10N)
892 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
893 cd $(ROOTDIR) && \
894 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
895 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_l10n-checkout
897 FULL_EN_US_DIRS := toolkit \
898 extensions \
899 $(MOZ_PROJECT_LIST) \
900 $(NULL)
902 EN_US_LOCALE_DIRS := $(foreach dir, \
903 $(filter-out toolkit extensions/% $(MOZ_PROJECT_LIST), $(LOCALE_DIRS)), \
904 mozilla/$(dir)/locales)
906 EN_US_CO_DIRS := $(EN_US_LOCALE_DIRS) \
907 $(foreach mod,$(FULL_EN_US_DIRS),mozilla/$(mod)) \
908 mozilla/client.mk \
909 mozilla/configure \
910 mozilla/configure.in \
911 mozilla/allmakefiles.sh \
912 mozilla/build \
913 mozilla/config \
914 $(NULL)
916 # Start the checkout. Split the output to the tty and a log file.
917 real_l10n-checkout:
918 @set -e; \
919 cvs_co() { set -e; echo "$$@" ; \
920 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE_L10N); }; \
921 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(EN_US_CO_DIRS); \
922 cvs_co $(CVSCO_LOCALES)
923 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE_L10N)
924 # @: Check the log for conflicts. ;
925 @conflicts=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
926 if test "$$conflicts" ; then \
927 echo "$(MAKE): *** Conflicts during checkout." ;\
928 echo "$$conflicts" ;\
929 echo "$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
930 false; \
931 else true; \
934 ####################################
935 # Profile-Guided Optimization
936 # To use this, you should set the following variables in your mozconfig
937 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
939 # The profile script should exercise the functionality to be included
940 # in the profile feedback.
942 # This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
943 # is usable in multi-pass builds, where you might not have a runnable
944 # application until all the build passes and postflight scripts have run.
945 ifdef MOZ_OBJDIR
946 PGO_OBJDIR = $(MOZ_OBJDIR)
947 else
948 PGO_OBJDIR := $(TOPSRCDIR)
949 endif
951 profiledbuild::
952 $(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_GENERATE=1
953 OBJDIR=${PGO_OBJDIR} $(PROFILE_GEN_SCRIPT)
954 $(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
955 $(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_USE=1
958 #####################################################
959 # First Checkout
961 ifdef _IS_FIRST_CHECKOUT
962 # First time, do build target in a new process to pick up new files.
963 build::
964 $(MAKE) -f $(TOPSRCDIR)/client.mk build
965 else
967 #####################################################
968 # After First Checkout
970 #####################################################
971 # Build date unification
973 ifdef MOZ_UNIFY_BDATE
974 ifndef MOZ_BUILD_DATE
975 ifdef MOZ_BUILD_PROJECTS
976 MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
977 export MOZ_BUILD_DATE
978 endif
979 endif
980 endif
982 #####################################################
983 # Preflight, before building any project
985 build alldep preflight_all::
986 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
987 # Don't run preflight_all for individual projects in multi-project builds
988 # (when MOZ_CURRENT_PROJECT is set.)
989 ifndef MOZ_BUILD_PROJECTS
990 # Building a single project, OBJDIR is usable.
991 set -e; \
992 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
993 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
994 done
995 else
996 # OBJDIR refers to the project-specific OBJDIR, which is not available at
997 # this point when building multiple projects. Only MOZ_OBJDIR is available.
998 set -e; \
999 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
1000 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1001 done
1002 endif
1003 endif
1005 # If we're building multiple projects, but haven't specified which project,
1006 # loop through them.
1008 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
1009 configure depend build install export libs clean realclean distclean alldep preflight postflight maybe_clobber_profiledbuild::
1010 set -e; \
1011 for app in $(MOZ_BUILD_PROJECTS); do \
1012 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
1013 done
1015 else
1017 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
1018 # individual project in a multi-project build.
1020 ####################################
1021 # Configure
1023 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
1024 CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
1026 ifdef RUN_AUTOCONF_LOCALLY
1027 EXTRA_CONFIG_DEPS := \
1028 $(TOPSRCDIR)/aclocal.m4 \
1029 $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
1030 $(NULL)
1032 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
1033 @echo Generating $@ using autoconf
1034 cd $(TOPSRCDIR); $(AUTOCONF)
1036 $(TOPSRCDIR)/nsprpub/configure: $(TOPSRCDIR)/nsprpub/configure.in $(EXTRA_CONFIG_DEPS)
1037 @echo Generating $@ using autoconf
1038 cd $(TOPSRCDIR)/nsprpub; $(AUTOCONF)
1040 $(TOPSRCDIR)/directory/c-sdk/configure: $(TOPSRCDIR)/directory/c-sdk/configure.in $(EXTRA_CONFIG_DEPS)
1041 @echo Generating $@ using autoconf
1042 cd $(TOPSRCDIR)/directory/c-sdk; $(AUTOCONF)
1043 endif
1045 CONFIG_STATUS_DEPS := \
1046 $(TOPSRCDIR)/configure \
1047 $(TOPSRCDIR)/.mozconfig.mk \
1048 $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
1049 $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
1050 $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
1051 $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
1052 $(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
1053 $(NULL)
1055 # configure uses the program name to determine @srcdir@. Calling it without
1056 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1057 # path of $(TOPSRCDIR).
1058 ifeq ($(TOPSRCDIR),$(OBJDIR))
1059 CONFIGURE = ./configure
1060 else
1061 CONFIGURE = $(TOPSRCDIR)/configure
1062 endif
1064 ifdef MOZ_TOOLS
1065 CONFIGURE = $(TOPSRCDIR)/configure
1066 endif
1068 configure:: $(CONFIGURES)
1069 ifdef MOZ_BUILD_PROJECTS
1070 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1071 endif
1072 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1073 @echo cd $(OBJDIR);
1074 @echo $(CONFIGURE) $(CONFIGURE_ARGS)
1075 @cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
1076 || ( echo "*** Fix above errors and then restart with\
1077 \"$(MAKE) -f client.mk build\"" && exit 1 )
1078 @touch $(OBJDIR)/Makefile
1080 $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
1081 @$(MAKE) -f $(TOPSRCDIR)/client.mk configure
1083 ifneq (,$(CONFIG_STATUS))
1084 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
1085 cd $(OBJDIR); \
1086 CONFIG_FILES=config/autoconf.mk ./config.status
1087 endif
1090 ####################################
1091 # Depend
1093 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1094 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1096 ####################################
1097 # Preflight
1099 build alldep preflight::
1100 ifdef MOZ_PREFLIGHT
1101 set -e; \
1102 for mkfile in $(MOZ_PREFLIGHT); do \
1103 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1104 done
1105 endif
1107 ####################################
1108 # Build it
1110 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1111 $(MOZ_MAKE)
1113 ####################################
1114 # Other targets
1116 # Pass these target onto the real build system
1117 install export libs clean realclean distclean alldep maybe_clobber_profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1118 $(MOZ_MAKE) $@
1120 ####################################
1121 # Postflight
1123 build alldep postflight::
1124 ifdef MOZ_POSTFLIGHT
1125 set -e; \
1126 for mkfile in $(MOZ_POSTFLIGHT); do \
1127 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1128 done
1129 endif
1131 endif # MOZ_CURRENT_PROJECT
1133 ####################################
1134 # Postflight, after building all projects
1136 build alldep postflight_all::
1137 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
1138 # Don't run postflight_all for individual projects in multi-project builds
1139 # (when MOZ_CURRENT_PROJECT is set.)
1140 ifndef MOZ_BUILD_PROJECTS
1141 # Building a single project, OBJDIR is usable.
1142 set -e; \
1143 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1144 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1145 done
1146 else
1147 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1148 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1149 set -e; \
1150 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1151 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1152 done
1153 endif
1154 endif
1156 cleansrcdir:
1157 @cd $(TOPSRCDIR); \
1158 if [ -f Makefile ]; then \
1159 $(MAKE) distclean ; \
1160 else \
1161 echo "Removing object files from srcdir..."; \
1162 rm -fr `find . -type d \( -name .deps -print -o -name CVS \
1163 -o -exec test ! -d {}/CVS \; \) -prune \
1164 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1165 build/autoconf/clean-config.sh; \
1168 # (! IS_FIRST_CHECKOUT)
1169 endif
1171 echo-variable-%:
1172 @echo $($*)
1174 .PHONY: checkout real_checkout depend build profiledbuild maybe_clobber_profiledbuild 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