Bug 449474, Fx3.0.2 updates should force modules/distribution.js, and use the version...
[mozilla-1.9.git] / client.mk
blob05748839a0d985065c58de828b654ab25ef4cb66
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_RTM
415 NSS_CO_TAG = NSS_3_12_1_RC2
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 += $(if $(wildcard $(TOPSRCDIR)/nsprpub/configure.in), \
685 $(TOPSRCDIR)/nsprpub/configure, )
686 endif
688 ifeq (,$(filter mozilla/security/manager,$(MOZ_MODULE_LIST)))
689 CVSCO_NSS :=
690 endif
691 ifeq (,$(filter mozilla/directory/xpcom,$(MOZ_MODULE_LIST)))
692 CVSCO_LDAPCSDK :=
693 else
694 CONFIGURES += $(TOPSRCDIR)/directory/c-sdk/configure
695 endif
697 MODULES_CO_FLAGS := -P
698 ifdef MOZ_CO_FLAGS
699 MODULES_CO_FLAGS := $(MOZ_CO_FLAGS)
700 endif
701 MODULES_CO_FLAGS := $(MODULES_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG),-A)
703 CVSCO_MODULES_NS = $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(MOZ_MODULE_LIST_NS)
705 ifeq (,$(strip $(MOZ_MODULE_LIST)))
706 FASTUPDATE_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
707 CHECKOUT_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
708 else
709 FASTUPDATE_MODULES := fast_update $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST)
710 CHECKOUT_MODULES := cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST);
711 endif
712 ifeq (,$(MOZ_MODULE_LIST_NS))
713 FASTUPDATE_MODULES_NS := true
714 CHECKOUT_MODULES_NS := true
715 else
716 FASTUPDATE_MODULES_NS := fast_update $(CVSCO_MODULES_NS)
717 CHECKOUT_MODULES_NS := cvs_co $(CVSCO_MODULES_NS)
718 endif
720 ###################################
721 # CVS defines for locales
724 LOCALES_CO_FLAGS := -P
725 ifdef MOZ_CO_FLAGS
726 LOCALES_CO_FLAGS := $(MOZ_CO_FLAGS)
727 endif
728 LOCALES_CO_FLAGS := $(LOCALES_CO_FLAGS) $(if $(LOCALES_CO_TAG),-r $(LOCALES_CO_TAG),-A)
730 ifndef MOZ_CO_LOCALES
731 FASTUPDATE_LOCALES := true
732 CHECKOUT_LOCALES := true
733 else
735 override MOZ_CO_LOCALES := $(subst $(comma), ,$(MOZ_CO_LOCALES))
737 ifeq (all,$(MOZ_CO_LOCALES))
738 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),mozilla/$(project)/locales/all-locales)
740 LOCALE_CO_DIRS := $(sort $(foreach project,$(MOZ_PROJECT_LIST),$(foreach locale,$(shell cat mozilla/$(project)/locales/all-locales),l10n/$(locale)/)))
741 else # MOZ_CO_LOCALES != all
742 LOCALE_CO_DIRS = $(sort $(foreach locale,$(MOZ_CO_LOCALES),l10n/$(locale)/))
743 endif
745 CVSCO_LOCALES := $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_LOCALES_DATE_FLAGS) $(LOCALE_CO_DIRS)
747 FASTUPDATE_LOCALES := fast_update $(CVSCO_LOCALES)
748 CHECKOUT_LOCALES := cvs_co $(CVSCO_LOCALES)
749 endif #MOZ_CO_LOCALES
751 #######################################################################
752 # Rules
755 # Print out any options loaded from mozconfig.
756 all build checkout clean depend distclean export libs install realclean::
757 @if test -f .mozconfig.out; then \
758 cat .mozconfig.out; \
759 rm -f .mozconfig.out; \
760 else true; \
763 ifdef _IS_FIRST_CHECKOUT
764 all:: checkout build
765 else
766 all:: checkout alldep
767 endif
769 # Windows equivalents
770 pull_all: checkout
771 build_all: build
772 build_all_dep: alldep
773 build_all_depend: alldep
774 clobber clobber_all: clean
775 pull_and_build_all: checkout alldep
777 # Do everything from scratch
778 everything: checkout clean build
780 ####################################
781 # CVS checkout
783 checkout::
784 # @: Backup the last checkout log.
785 @if test -f $(CVSCO_LOGFILE) ; then \
786 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
787 else true; \
789 ifdef RUN_AUTOCONF_LOCALLY
790 @echo "Removing local configures" ; \
791 cd $(ROOTDIR) && \
792 $(RM) -f $(CONFIGURES)
793 endif
794 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
795 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
796 cd $(ROOTDIR) && \
797 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
798 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
800 # Start the checkout. Split the output to the tty and a log file.
802 real_checkout:
803 @set -e; \
804 cvs_co() { set -e; echo "$$@" ; \
805 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
806 cvs_co $(CVSCO_NSPR); \
807 cvs_co $(CVSCO_NSS); \
808 cvs_co $(CVSCO_LDAPCSDK); \
809 $(CHECKOUT_MODULES_NS); \
810 $(CHECKOUT_MODULES) \
811 $(CHECKOUT_LOCALES);
812 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
813 # update the NSS checkout timestamp, if we checked PSM out
814 @if test -d $(TOPSRCDIR)/security/manager -a \
815 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
816 echo `date` > $(TOPSRCDIR)/security/manager/.nss.checkout; \
818 ifdef RUN_AUTOCONF_LOCALLY
819 cd $(ROOTDIR) && \
820 $(RM) -f $(CONFIGURES)
821 endif
822 # @: Check the log for conflicts. ;
823 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
824 if test "$$conflicts" ; then \
825 echo "$(MAKE): *** Conflicts during checkout." ;\
826 echo "$$conflicts" ;\
827 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
828 false; \
829 else true; \
832 fast-update:
833 # @: Backup the last checkout log.
834 @if test -f $(CVSCO_LOGFILE) ; then \
835 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
836 else true; \
838 ifdef RUN_AUTOCONF_LOCALLY
839 @echo "Removing local configures" ; \
840 cd $(ROOTDIR) && \
841 $(RM) -f $(CONFIGURES)
842 endif
843 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
844 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
845 cd $(ROOTDIR) && \
846 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
847 @cd $(TOPSRCDIR) && \
848 $(MAKE) -f client.mk real_fast-update
850 # Start the update. Split the output to the tty and a log file.
851 real_fast-update:
852 @set -e; \
853 fast_update() { set -e; config/cvsco-fast-update.pl $$@ 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
854 cvs_co() { set -e; echo "$$@" ; \
855 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
856 fast_update $(CVSCO_NSPR); \
857 cd $(ROOTDIR); \
858 cvs_co $(CVSCO_NSS); \
859 cd mozilla; \
860 fast_update $(CVSCO_LDAPCSDK); \
861 $(FASTUPDATE_MODULES); \
862 $(FASTUPDATE_MODULES_NS); \
863 $(FASTUPDATE_LOCALES);
864 @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
865 # update the NSS checkout timestamp
866 @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
867 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
869 ifdef RUN_AUTOCONF_LOCALLY
870 cd $(ROOTDIR) && \
871 $(RM) -f $(CONFIGURES)
872 endif
873 # @: Check the log for conflicts. ;
874 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
875 if test "$$conflicts" ; then \
876 echo "$(MAKE): *** Conflicts during fast-update." ;\
877 echo "$$conflicts" ;\
878 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
879 false; \
880 else true; \
883 CVSCO_LOGFILE_L10N := $(ROOTDIR)/cvsco-l10n.log
884 CVSCO_LOGFILE_L10N := $(shell echo $(CVSCO_LOGFILE_L10N) | sed s%//%/%)
886 l10n-checkout:
887 # @: Backup the last checkout log.
888 @if test -f $(CVSCO_LOGFILE_L10N) ; then \
889 mv $(CVSCO_LOGFILE_L10N) $(CVSCO_LOGFILE_L10N).old; \
890 else true; \
892 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE_L10N)
893 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
894 cd $(ROOTDIR) && \
895 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
896 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_l10n-checkout
898 FULL_EN_US_DIRS := toolkit \
899 extensions \
900 $(MOZ_PROJECT_LIST) \
901 $(NULL)
903 EN_US_LOCALE_DIRS := $(foreach dir, \
904 $(filter-out toolkit extensions/% $(MOZ_PROJECT_LIST) other-licenses/%, $(LOCALE_DIRS)), \
905 mozilla/$(dir)/locales) \
906 mozilla/$(filter other-licenses/%, $(LOCALE_DIRS))
908 EN_US_CO_DIRS := $(EN_US_LOCALE_DIRS) \
909 $(foreach mod,$(FULL_EN_US_DIRS),mozilla/$(mod)) \
910 mozilla/client.mk \
911 mozilla/configure \
912 mozilla/configure.in \
913 mozilla/allmakefiles.sh \
914 mozilla/build \
915 mozilla/config \
916 $(NULL)
918 # Start the checkout. Split the output to the tty and a log file.
919 real_l10n-checkout:
920 @set -e; \
921 cvs_co() { set -e; echo "$$@" ; \
922 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE_L10N); }; \
923 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(EN_US_CO_DIRS); \
924 cvs_co $(CVSCO_LOCALES)
925 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE_L10N)
926 # @: Check the log for conflicts. ;
927 @conflicts=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
928 if test "$$conflicts" ; then \
929 echo "$(MAKE): *** Conflicts during checkout." ;\
930 echo "$$conflicts" ;\
931 echo "$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
932 false; \
933 else true; \
936 ####################################
937 # Profile-Guided Optimization
938 # To use this, you should set the following variables in your mozconfig
939 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
941 # The profile script should exercise the functionality to be included
942 # in the profile feedback.
944 # This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
945 # is usable in multi-pass builds, where you might not have a runnable
946 # application until all the build passes and postflight scripts have run.
947 ifdef MOZ_OBJDIR
948 PGO_OBJDIR = $(MOZ_OBJDIR)
949 else
950 PGO_OBJDIR := $(TOPSRCDIR)
951 endif
953 profiledbuild::
954 $(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_GENERATE=1
955 OBJDIR=${PGO_OBJDIR} $(PROFILE_GEN_SCRIPT)
956 $(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
957 $(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_USE=1
960 #####################################################
961 # First Checkout
963 ifdef _IS_FIRST_CHECKOUT
964 # First time, do build target in a new process to pick up new files.
965 build::
966 $(MAKE) -f $(TOPSRCDIR)/client.mk build
967 else
969 #####################################################
970 # After First Checkout
972 #####################################################
973 # Build date unification
975 ifdef MOZ_UNIFY_BDATE
976 ifndef MOZ_BUILD_DATE
977 ifdef MOZ_BUILD_PROJECTS
978 MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
979 export MOZ_BUILD_DATE
980 endif
981 endif
982 endif
984 #####################################################
985 # Preflight, before building any project
987 build alldep preflight_all::
988 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
989 # Don't run preflight_all for individual projects in multi-project builds
990 # (when MOZ_CURRENT_PROJECT is set.)
991 ifndef MOZ_BUILD_PROJECTS
992 # Building a single project, OBJDIR is usable.
993 set -e; \
994 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
995 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
996 done
997 else
998 # OBJDIR refers to the project-specific OBJDIR, which is not available at
999 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1000 set -e; \
1001 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
1002 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1003 done
1004 endif
1005 endif
1007 # If we're building multiple projects, but haven't specified which project,
1008 # loop through them.
1010 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
1011 configure depend build install export libs clean realclean distclean alldep preflight postflight maybe_clobber_profiledbuild::
1012 set -e; \
1013 for app in $(MOZ_BUILD_PROJECTS); do \
1014 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
1015 done
1017 else
1019 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
1020 # individual project in a multi-project build.
1022 ####################################
1023 # Configure
1025 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
1026 CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
1028 ifdef RUN_AUTOCONF_LOCALLY
1029 EXTRA_CONFIG_DEPS := \
1030 $(TOPSRCDIR)/aclocal.m4 \
1031 $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
1032 $(NULL)
1034 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
1035 @echo Generating $@ using autoconf
1036 cd $(TOPSRCDIR); $(AUTOCONF)
1038 $(TOPSRCDIR)/nsprpub/configure: $(TOPSRCDIR)/nsprpub/configure.in $(EXTRA_CONFIG_DEPS)
1039 @echo Generating $@ using autoconf
1040 cd $(TOPSRCDIR)/nsprpub; $(AUTOCONF)
1042 $(TOPSRCDIR)/directory/c-sdk/configure: $(TOPSRCDIR)/directory/c-sdk/configure.in $(EXTRA_CONFIG_DEPS)
1043 @echo Generating $@ using autoconf
1044 cd $(TOPSRCDIR)/directory/c-sdk; $(AUTOCONF)
1045 endif
1047 CONFIG_STATUS_DEPS := \
1048 $(TOPSRCDIR)/configure \
1049 $(TOPSRCDIR)/.mozconfig.mk \
1050 $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
1051 $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
1052 $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
1053 $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
1054 $(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
1055 $(NULL)
1057 # configure uses the program name to determine @srcdir@. Calling it without
1058 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1059 # path of $(TOPSRCDIR).
1060 ifeq ($(TOPSRCDIR),$(OBJDIR))
1061 CONFIGURE = ./configure
1062 else
1063 CONFIGURE = $(TOPSRCDIR)/configure
1064 endif
1066 ifdef MOZ_TOOLS
1067 CONFIGURE = $(TOPSRCDIR)/configure
1068 endif
1070 configure:: $(CONFIGURES)
1071 ifdef MOZ_BUILD_PROJECTS
1072 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1073 endif
1074 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1075 @echo cd $(OBJDIR);
1076 @echo $(CONFIGURE) $(CONFIGURE_ARGS)
1077 @cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
1078 || ( echo "*** Fix above errors and then restart with\
1079 \"$(MAKE) -f client.mk build\"" && exit 1 )
1080 @touch $(OBJDIR)/Makefile
1082 $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
1083 @$(MAKE) -f $(TOPSRCDIR)/client.mk configure
1085 ifneq (,$(CONFIG_STATUS))
1086 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
1087 cd $(OBJDIR); \
1088 CONFIG_FILES=config/autoconf.mk ./config.status
1089 endif
1092 ####################################
1093 # Depend
1095 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1096 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1098 ####################################
1099 # Preflight
1101 build alldep preflight::
1102 ifdef MOZ_PREFLIGHT
1103 set -e; \
1104 for mkfile in $(MOZ_PREFLIGHT); do \
1105 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1106 done
1107 endif
1109 ####################################
1110 # Build it
1112 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1113 $(MOZ_MAKE)
1115 ####################################
1116 # Other targets
1118 # Pass these target onto the real build system
1119 install export libs clean realclean distclean alldep maybe_clobber_profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1120 $(MOZ_MAKE) $@
1122 ####################################
1123 # Postflight
1125 build alldep postflight::
1126 ifdef MOZ_POSTFLIGHT
1127 set -e; \
1128 for mkfile in $(MOZ_POSTFLIGHT); do \
1129 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1130 done
1131 endif
1133 endif # MOZ_CURRENT_PROJECT
1135 ####################################
1136 # Postflight, after building all projects
1138 build alldep postflight_all::
1139 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
1140 # Don't run postflight_all for individual projects in multi-project builds
1141 # (when MOZ_CURRENT_PROJECT is set.)
1142 ifndef MOZ_BUILD_PROJECTS
1143 # Building a single project, OBJDIR is usable.
1144 set -e; \
1145 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1146 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1147 done
1148 else
1149 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1150 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1151 set -e; \
1152 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1153 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1154 done
1155 endif
1156 endif
1158 cleansrcdir:
1159 @cd $(TOPSRCDIR); \
1160 if [ -f Makefile ]; then \
1161 $(MAKE) distclean ; \
1162 else \
1163 echo "Removing object files from srcdir..."; \
1164 rm -fr `find . -type d \( -name .deps -print -o -name CVS \
1165 -o -exec test ! -d {}/CVS \; \) -prune \
1166 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1167 build/autoconf/clean-config.sh; \
1170 # (! IS_FIRST_CHECKOUT)
1171 endif
1173 echo-variable-%:
1174 @echo $($*)
1176 .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