Bug 487345 - Crash [@ nsObjectLoadingContent::Instantiate] when enabling Flashblock...
[mozilla-1.9.git] / client.mk
blob11e288f671d99b507c1edcb47f4ddde8a47f9bc8
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 $(NULL)
388 BOOTSTRAP_camino := \
389 $(BOOTSTRAP_toolkit) \
390 mozilla/camino/config/mozconfig \
391 $(NULL)
393 MODULES_tamarin := \
394 mozilla/js/tamarin \
395 mozilla/modules/zlib \
396 $(NULL)
398 MODULES_all := \
399 mozilla/other-licenses/bsdiff \
400 mozilla/other-licenses/libart_lgpl \
401 mozilla/tools/trace-malloc \
402 mozilla/tools/jprof \
403 mozilla/tools/codesighs \
404 mozilla/tools/update-packaging \
405 $(NULL)
407 #######################################################################
408 # Checkout Tags
410 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
411 # and commit this file on that tag.
412 #MOZ_CO_TAG = <tag>
413 NSPR_CO_TAG = NSPR_4_7_3_RTM
414 NSS_CO_TAG = NSS_3_12_2_WITH_CKBI_1_73_RTM
415 LDAPCSDK_CO_TAG = LDAPCSDK_6_0_3_CLIENT_BRANCH
416 LOCALES_CO_TAG =
418 #######################################################################
419 # Defines
421 CVS = cvs
422 comma := ,
424 CWD := $(shell pwd)
425 ifneq (1,$(words $(CWD)))
426 $(error The mozilla directory cannot be located in a path with spaces.)
427 endif
429 ifeq "$(CWD)" "/"
430 CWD := /.
431 endif
433 ifneq (, $(wildcard client.mk))
434 # Ran from mozilla directory
435 ROOTDIR := $(shell dirname $(CWD))
436 TOPSRCDIR := $(CWD)
437 else
438 # Ran from mozilla/.. directory (?)
439 ROOTDIR := $(CWD)
440 TOPSRCDIR := $(CWD)/mozilla
441 endif
443 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
444 # work; replace first instance with one forward slash
445 TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
447 ifndef TOPSRCDIR_MOZ
448 TOPSRCDIR_MOZ=$(TOPSRCDIR)
449 endif
451 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
452 DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
453 ifeq ($(DIRNAME),)
454 ROOTDIR := /.
455 endif
457 AUTOCONF := autoconf
458 MKDIR := mkdir
459 SH := /bin/sh
460 ifndef MAKE
461 MAKE := gmake
462 endif
463 PERL ?= perl
464 PYTHON ?= python
466 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
467 ifdef CONFIG_GUESS_SCRIPT
468 CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
469 else
470 _IS_FIRST_CHECKOUT := 1
471 endif
473 ####################################
474 # Sanity checks
476 ifneq (,$(filter MINGW%,$(shell uname -s)))
477 # check for CRLF line endings
478 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
479 $(error This source tree appears to have Windows-style line endings. To \
480 convert it to Unix-style line endings, run \
481 "python mozilla/build/win32/mozilla-dos2unix.py")
482 endif
483 endif
485 ####################################
486 # CVS
488 # Add the CVS root to CVS_FLAGS if needed
489 CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
490 ifneq ($(CVS_ROOT_IN_TREE),)
491 ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
492 CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
493 endif
494 endif
496 CVS_CO_DATE_FLAGS = $(if $(MOZ_CO_DATE),-D "$(MOZ_CO_DATE)")
497 CVS_CO_LOCALES_DATE_FLAGS = $(if $(MOZ_CO_LOCALES_DATE),-D "$(MOZ_CO_LOCALES_DATE)")
498 CVSCO = $(CVS) $(CVS_FLAGS) co $(MOZ_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG)) $(CVS_CO_DATE_FLAGS)
500 MOZ_CO_LOCALES_DATE ?= $(MOZ_CO_DATE)
502 CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
503 CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
505 # if LOCALES_CVSROOT is not specified, set it here
506 # (and let mozconfig override it)
507 LOCALES_CVSROOT ?= :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/l10n
509 ####################################
510 # Load mozconfig Options
512 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
514 MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
515 MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
516 MOZCONFIG_MODULES := mozilla/build/unix/uniq.pl
517 run_for_side_effects := \
518 $(shell cd $(ROOTDIR); \
519 if test "$(_IS_FIRST_CHECKOUT)"; then \
520 $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
521 else true; \
522 fi; \
523 $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
524 include $(TOPSRCDIR)/.mozconfig.mk
526 ####################################
527 # Options that may come from mozconfig
529 MOZ_PROJECT_LIST := $(subst $(comma), ,$(MOZ_CO_PROJECT))
530 MOZ_PROJECT_LIST := $(subst macbrowser,camino,$(MOZ_PROJECT_LIST))
532 ifneq (,$(filter-out $(AVAILABLE_PROJECTS),$(MOZ_PROJECT_LIST)))
533 $(error MOZ_CO_PROJECT contains an unrecognized project.)
534 endif
536 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST)))
537 MOZ_PROJECT_LIST := $(AVAILABLE_PROJECTS)
538 endif
540 MOZ_MODULE_LIST := $(subst $(comma), ,$(MOZ_CO_MODULE)) $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_$(project)))
541 MOZ_MODULE_LIST_NS := $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_NS_$(project)))
542 LOCALE_DIRS := $(MOZ_LOCALE_DIRS) $(foreach project,$(MOZ_PROJECT_LIST),$(LOCALES_$(project)))
544 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),$(BOOTSTRAP_$(project)))
546 # Using $(sort) here because it also removes duplicate entries.
547 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
548 LOCALE_DIRS := $(sort $(LOCALE_DIRS))
549 MOZCONFIG_MODULES := $(sort $(MOZCONFIG_MODULES))
551 # Change CVS flags if anonymous root is requested
552 ifdef MOZ_CO_USE_MIRROR
553 CVS_FLAGS := -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
554 endif
556 # MOZ_CVS_FLAGS - Basic CVS flags
557 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
558 CVS_FLAGS := $(CVS_FLAGS) -q -z 3
559 else
560 CVS_FLAGS := $(MOZ_CVS_FLAGS)
561 endif
563 ifdef MOZ_BUILD_PROJECTS
565 ifndef MOZ_OBJDIR
566 $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
567 endif
568 ifdef MOZ_CURRENT_PROJECT
569 OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
570 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
571 BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
572 else
573 OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
574 MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
575 endif
577 else # MOZ_BUILD_PROJECTS
579 ifdef MOZ_OBJDIR
580 OBJDIR = $(MOZ_OBJDIR)
581 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
582 else
583 OBJDIR := $(TOPSRCDIR)
584 MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
585 endif
587 endif # MOZ_BUILD_PROJECTS
589 ####################################
590 # CVS defines for NSS
592 NSS_CO_MODULE = \
593 mozilla/dbm \
594 mozilla/security/nss \
595 mozilla/security/coreconf \
596 mozilla/security/dbm \
597 $(NULL)
599 NSS_CO_FLAGS := -P
600 ifdef MOZ_CO_FLAGS
601 NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
602 endif
603 NSS_CO_FLAGS := $(NSS_CO_FLAGS) $(if $(NSS_CO_TAG),-r $(NSS_CO_TAG),-A)
605 # Can only pull the tip or branch tags by date
606 ifeq (,$(filter-out HEAD %BRANCH,$(NSS_CO_TAG)))
607 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
608 else
609 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
610 endif
612 ####################################
613 # CVS defines for NSPR
615 NSPR_CO_MODULE = mozilla/nsprpub
616 NSPR_CO_FLAGS := -P
617 ifdef MOZ_CO_FLAGS
618 NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
619 endif
620 NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) $(if $(NSPR_CO_TAG),-r $(NSPR_CO_TAG),-A)
622 # Can only pull the tip or branch tags by date
623 ifeq (,$(filter-out HEAD %BRANCH,$(NSPR_CO_TAG)))
624 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
625 else
626 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
627 endif
629 ####################################
630 # CVS defines for the C LDAP SDK
632 LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
633 LDAPCSDK_CO_FLAGS := -P
634 ifdef MOZ_CO_FLAGS
635 LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
636 endif
637 LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) $(if $(LDAPCSDK_CO_TAG),-r $(LDAPCSDK_CO_TAG),-A)
639 # Can only pull the tip or branch tags by date
640 ifeq (,$(filter-out HEAD %BRANCH,$(LDAPCSDK_CO_TAG)))
641 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
642 else
643 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(LDAPCSDK_CO_MODULE)
644 endif
646 ####################################
647 # Error on obsolete variables.
650 ifdef MOZ_MAPINFO
651 $(warning MOZ_MAPINFO is obsolete, use MOZ_CO_MODULE=mozilla/tools/codesighs instead.)
652 MOZ_MODULE_LIST += mozilla/tools/codesighs
653 endif
654 ifdef MOZ_INTERNAL_LIBART_LGPL
655 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete, use MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl instead.)
656 endif
657 ifdef MOZ_PHOENIX
658 $(warning MOZ_PHOENIX is obsolete.)
659 MOZ_MODULE_LIST += $(MODULES_browser)
660 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
661 endif
662 ifdef MOZ_THUNDERBIRD
663 $(warning MOZ_THUNDERBIRD is obsolete.)
664 MOZ_MODULE_LIST += $(MODULES_mail)
665 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
666 endif
668 ###################################
669 # Checkout main modules
672 # sort is used to remove duplicates.
673 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
674 MOZ_MODULE_LIST_NS := $(sort $(MOZ_MODULE_LIST_NS))
676 ####################################
677 # Suppress standalone modules if they're not needed.
679 CONFIGURES := $(TOPSRCDIR)/configure
680 ifeq (,$(filter mozilla/xpcom,$(MOZ_MODULE_LIST)))
681 CVSCO_NSPR :=
682 else
683 CONFIGURES += $(if $(wildcard $(TOPSRCDIR)/nsprpub/configure.in), \
684 $(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 echo `date` > $(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) other-licenses/%, $(LOCALE_DIRS)), \
904 mozilla/$(dir)/locales) \
905 mozilla/$(filter other-licenses/%, $(LOCALE_DIRS))
907 EN_US_CO_DIRS := $(EN_US_LOCALE_DIRS) \
908 $(foreach mod,$(FULL_EN_US_DIRS),mozilla/$(mod)) \
909 mozilla/client.mk \
910 mozilla/configure \
911 mozilla/configure.in \
912 mozilla/allmakefiles.sh \
913 mozilla/build \
914 mozilla/config \
915 $(NULL)
917 # Start the checkout. Split the output to the tty and a log file.
918 real_l10n-checkout:
919 @set -e; \
920 cvs_co() { set -e; echo "$$@" ; \
921 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE_L10N); }; \
922 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(EN_US_CO_DIRS); \
923 cvs_co $(CVSCO_LOCALES)
924 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE_L10N)
925 # @: Check the log for conflicts. ;
926 @conflicts=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
927 if test "$$conflicts" ; then \
928 echo "$(MAKE): *** Conflicts during checkout." ;\
929 echo "$$conflicts" ;\
930 echo "$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
931 false; \
932 else true; \
935 ####################################
936 # Profile-Guided Optimization
937 # To use this, you should set the following variables in your mozconfig
938 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
940 # The profile script should exercise the functionality to be included
941 # in the profile feedback.
943 # This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
944 # is usable in multi-pass builds, where you might not have a runnable
945 # application until all the build passes and postflight scripts have run.
946 ifdef MOZ_OBJDIR
947 PGO_OBJDIR = $(MOZ_OBJDIR)
948 else
949 PGO_OBJDIR := $(TOPSRCDIR)
950 endif
952 profiledbuild::
953 $(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_GENERATE=1
954 OBJDIR=${PGO_OBJDIR} $(PROFILE_GEN_SCRIPT)
955 $(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
956 $(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_USE=1
959 #####################################################
960 # First Checkout
962 ifdef _IS_FIRST_CHECKOUT
963 # First time, do build target in a new process to pick up new files.
964 build::
965 $(MAKE) -f $(TOPSRCDIR)/client.mk build
966 else
968 #####################################################
969 # After First Checkout
971 #####################################################
972 # Build date unification
974 ifdef MOZ_UNIFY_BDATE
975 ifndef MOZ_BUILD_DATE
976 ifdef MOZ_BUILD_PROJECTS
977 MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
978 export MOZ_BUILD_DATE
979 endif
980 endif
981 endif
983 #####################################################
984 # Preflight, before building any project
986 build alldep preflight_all::
987 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
988 # Don't run preflight_all for individual projects in multi-project builds
989 # (when MOZ_CURRENT_PROJECT is set.)
990 ifndef MOZ_BUILD_PROJECTS
991 # Building a single project, OBJDIR is usable.
992 set -e; \
993 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
994 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
995 done
996 else
997 # OBJDIR refers to the project-specific OBJDIR, which is not available at
998 # this point when building multiple projects. Only MOZ_OBJDIR is available.
999 set -e; \
1000 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
1001 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1002 done
1003 endif
1004 endif
1006 # If we're building multiple projects, but haven't specified which project,
1007 # loop through them.
1009 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
1010 configure depend build install export libs clean realclean distclean alldep preflight postflight maybe_clobber_profiledbuild::
1011 set -e; \
1012 for app in $(MOZ_BUILD_PROJECTS); do \
1013 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
1014 done
1016 else
1018 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
1019 # individual project in a multi-project build.
1021 ####################################
1022 # Configure
1024 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
1025 CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
1027 ifdef RUN_AUTOCONF_LOCALLY
1028 EXTRA_CONFIG_DEPS := \
1029 $(TOPSRCDIR)/aclocal.m4 \
1030 $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
1031 $(NULL)
1033 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
1034 @echo Generating $@ using autoconf
1035 cd $(TOPSRCDIR); $(AUTOCONF)
1037 $(TOPSRCDIR)/nsprpub/configure: $(TOPSRCDIR)/nsprpub/configure.in $(EXTRA_CONFIG_DEPS)
1038 @echo Generating $@ using autoconf
1039 cd $(TOPSRCDIR)/nsprpub; $(AUTOCONF)
1041 $(TOPSRCDIR)/directory/c-sdk/configure: $(TOPSRCDIR)/directory/c-sdk/configure.in $(EXTRA_CONFIG_DEPS)
1042 @echo Generating $@ using autoconf
1043 cd $(TOPSRCDIR)/directory/c-sdk; $(AUTOCONF)
1044 endif
1046 CONFIG_STATUS_DEPS := \
1047 $(TOPSRCDIR)/configure \
1048 $(TOPSRCDIR)/.mozconfig.mk \
1049 $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
1050 $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
1051 $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
1052 $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
1053 $(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
1054 $(NULL)
1056 # configure uses the program name to determine @srcdir@. Calling it without
1057 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1058 # path of $(TOPSRCDIR).
1059 ifeq ($(TOPSRCDIR),$(OBJDIR))
1060 CONFIGURE = ./configure
1061 else
1062 CONFIGURE = $(TOPSRCDIR)/configure
1063 endif
1065 ifdef MOZ_TOOLS
1066 CONFIGURE = $(TOPSRCDIR)/configure
1067 endif
1069 configure:: $(CONFIGURES)
1070 ifdef MOZ_BUILD_PROJECTS
1071 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1072 endif
1073 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1074 @echo cd $(OBJDIR);
1075 @echo $(CONFIGURE) $(CONFIGURE_ARGS)
1076 @cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
1077 || ( echo "*** Fix above errors and then restart with\
1078 \"$(MAKE) -f client.mk build\"" && exit 1 )
1079 @touch $(OBJDIR)/Makefile
1081 $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
1082 @$(MAKE) -f $(TOPSRCDIR)/client.mk configure
1084 ifneq (,$(CONFIG_STATUS))
1085 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
1086 cd $(OBJDIR); \
1087 CONFIG_FILES=config/autoconf.mk ./config.status
1088 endif
1091 ####################################
1092 # Depend
1094 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1095 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1097 ####################################
1098 # Preflight
1100 build alldep preflight::
1101 ifdef MOZ_PREFLIGHT
1102 set -e; \
1103 for mkfile in $(MOZ_PREFLIGHT); do \
1104 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1105 done
1106 endif
1108 ####################################
1109 # Build it
1111 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1112 $(MOZ_MAKE)
1114 ####################################
1115 # Other targets
1117 # Pass these target onto the real build system
1118 install export libs clean realclean distclean alldep maybe_clobber_profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1119 $(MOZ_MAKE) $@
1121 ####################################
1122 # Postflight
1124 build alldep postflight::
1125 ifdef MOZ_POSTFLIGHT
1126 set -e; \
1127 for mkfile in $(MOZ_POSTFLIGHT); do \
1128 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1129 done
1130 endif
1132 endif # MOZ_CURRENT_PROJECT
1134 ####################################
1135 # Postflight, after building all projects
1137 build alldep postflight_all::
1138 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
1139 # Don't run postflight_all for individual projects in multi-project builds
1140 # (when MOZ_CURRENT_PROJECT is set.)
1141 ifndef MOZ_BUILD_PROJECTS
1142 # Building a single project, OBJDIR is usable.
1143 set -e; \
1144 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1145 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1146 done
1147 else
1148 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1149 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1150 set -e; \
1151 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1152 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1153 done
1154 endif
1155 endif
1157 cleansrcdir:
1158 @cd $(TOPSRCDIR); \
1159 if [ -f Makefile ]; then \
1160 $(MAKE) distclean ; \
1161 else \
1162 echo "Removing object files from srcdir..."; \
1163 rm -fr `find . -type d \( -name .deps -print -o -name CVS \
1164 -o -exec test ! -d {}/CVS \; \) -prune \
1165 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1166 build/autoconf/clean-config.sh; \
1169 # (! IS_FIRST_CHECKOUT)
1170 endif
1172 echo-variable-%:
1173 @echo $($*)
1175 .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