removing printf
[mozilla-central.git] / client.mk
blob1fdcc2aa9ce661659e43c46b66c4a7b2ea59c756
1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
12 # License.
14 # The Original Code is mozilla.org code.
16 # The Initial Developer of the Original Code is
17 # Netscape Communications Corporation.
18 # Portions created by the Initial Developer are Copyright (C) 1998
19 # the Initial Developer. All Rights Reserved.
21 # Contributor(s):
22 # Stephen Lamm
23 # Benjamin Smedberg <bsmedberg@covad.net>
24 # Chase Phillips <chase@mozilla.org>
25 # Mark Mentovai <mark@moxienet.com>
27 # Alternatively, the contents of this file may be used under the terms of
28 # either the GNU General Public License Version 2 or later (the "GPL"), or
29 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 # in which case the provisions of the GPL or the LGPL are applicable instead
31 # of those above. If you wish to allow use of your version of this file only
32 # under the terms of either the GPL or the LGPL, and not to allow others to
33 # use your version of this file under the terms of the MPL, indicate your
34 # decision by deleting the provisions above and replace them with the notice
35 # and other provisions required by the GPL or the LGPL. If you do not delete
36 # the provisions above, a recipient may use your version of this file under
37 # the terms of any one of the MPL, the GPL or the LGPL.
39 # ***** END LICENSE BLOCK *****
41 # Build a mozilla application.
43 # To checkout and build a tree,
44 # 1. cvs co mozilla/client.mk
45 # 2. cd mozilla
46 # 3. create your .mozconfig file with
47 # mk_add_options MOZ_CO_PROJECT=
48 # suite,browser
49 # 4. gmake -f client.mk
51 # This script will pick up the CVSROOT from the CVS/Root file. If you wish
52 # to use a different CVSROOT, you must set CVSROOT in your environment:
54 # export CVSROOT=:pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
55 # export CVSROOT=:pserver:username%somedomain.org@cvs.mozilla.org:/cvsroot
57 # You must specify which products/modules you wish to checkout, with
58 # MOZ_CO_PROJECT and MOZ_CO_MODULE variables.
60 # MOZ_CO_PROJECT possibilities include the following:
61 # suite (Seamonkey suite)
62 # browser (aka Firefox)
63 # mail (aka Thunderbird)
64 # minimo (small browser for devices)
65 # composer (standalone composer, aka NVU)
66 # calendar (aka Sunbird, use this to build the calendar extensions also)
67 # xulrunner
68 # camino
69 # tamarin
71 # Other common MOZ_CO_MODULE options include the following:
72 # mozilla/other-licenses/libart_lgpl
73 # mozilla/other-licenses/bsdiff
74 # mozilla/tools/codesighs
76 # Other targets (gmake -f client.mk [targets...]),
77 # checkout
78 # build
79 # clean (realclean is now the same as clean)
80 # distclean
82 # See http://www.mozilla.org/build/ for more information.
84 # Options:
85 # MOZ_BUILD_PROJECTS - Build multiple projects in subdirectories
86 # of MOZ_OBJDIR
87 # MOZ_OBJDIR - Destination object directory
88 # MOZ_CO_DATE - Date tag to use for checkout (default: none)
89 # MOZ_CO_LOCALES_DATE - Date tag to use for locale checkout
90 # (default: MOZ_CO_DATE)
91 # MOZ_CO_MODULE - Module to checkout
92 # MOZ_CVS_FLAGS - Flags to pass cvs (default: -q -z3)
93 # MOZ_CO_FLAGS - Flags to pass after 'cvs co' (default: -P)
94 # MOZ_MAKE_FLAGS - Flags to pass to $(MAKE)
95 # MOZ_CO_LOCALES - localizations to pull (MOZ_CO_LOCALES="de-DE,pt-BR")
96 # MOZ_LOCALE_DIRS - directories which contain localizations
97 # LOCALES_CVSROOT - CVSROOT to use to pull localizations
98 # MOZ_PREFLIGHT_ALL } - Makefiles to run before any project in
99 # MOZ_PREFLIGHT } MOZ_BUILD_PROJECTS, before each project, after
100 # MOZ_POSTFLIGHT } each project, and after all projects; these
101 # MOZ_POSTFLIGHT_ALL } variables contain space-separated lists
102 # MOZ_UNIFY_BDATE - Set to use the same bdate for each project in
103 # MOZ_BUILD_PROJECTS
106 AVAILABLE_PROJECTS = \
107 all \
108 suite \
109 toolkit \
110 browser \
111 mail \
112 minimo \
113 composer \
114 calendar \
115 xulrunner \
116 camino \
117 necko \
118 tamarin \
119 $(NULL)
121 # Trailing / on top-level mozilla dir required to stop fast-update thinking
122 # it is a module name.
123 MODULES_NS_necko := \
124 mozilla/ \
125 $(NULL)
127 MODULES_necko := \
128 mozilla/README \
129 mozilla/config \
130 mozilla/build \
131 mozilla/intl \
132 mozilla/modules/libpref \
133 mozilla/modules/zlib \
134 mozilla/netwerk \
135 mozilla/xpcom \
136 mozilla/tools/test-harness \
137 $(NULL)
139 MODULES_NS_core := \
140 $(MODULES_NS_necko) \
141 mozilla/js \
142 mozilla/js/src \
143 mozilla/js/jsd \
144 mozilla/db \
145 $(NULL)
147 MODULES_core := \
148 $(MODULES_necko) \
149 mozilla/caps \
150 mozilla/content \
151 mozilla/db/mdb \
152 mozilla/db/mork \
153 mozilla/docshell \
154 mozilla/dom \
155 mozilla/editor \
156 mozilla/embedding \
157 mozilla/extensions \
158 mozilla/gfx \
159 mozilla/parser \
160 mozilla/layout \
161 mozilla/jpeg \
162 mozilla/js/src/fdlibm \
163 mozilla/js/src/liveconnect \
164 mozilla/js/src/xpconnect \
165 mozilla/js/jsd/idl \
166 mozilla/modules/libimg \
167 mozilla/modules/libjar \
168 mozilla/modules/libpr0n \
169 mozilla/modules/libreg \
170 mozilla/modules/libutil \
171 mozilla/modules/oji \
172 mozilla/modules/plugin \
173 mozilla/modules/staticmod \
174 mozilla/plugin/oji \
175 mozilla/profile \
176 mozilla/rdf \
177 mozilla/security/manager \
178 mozilla/sun-java \
179 mozilla/ipc/ipcd \
180 mozilla/modules/libpr0n \
181 mozilla/modules/libmar \
182 mozilla/modules/libbz2 \
183 mozilla/accessible \
184 mozilla/other-licenses/atk-1.0 \
185 mozilla/other-licenses/ia2 \
186 mozilla/security/manager \
187 mozilla/tools/elf-dynstr-gc \
188 mozilla/uriloader \
189 mozilla/view \
190 mozilla/webshell \
191 mozilla/widget \
192 mozilla/xpfe \
193 mozilla/xpinstall \
194 mozilla/toolkit \
195 mozilla/storage \
196 mozilla/db/sqlite3 \
197 mozilla/db/morkreader \
198 mozilla/testing/mochitest \
199 $(NULL)
201 LOCALES_necko := \
202 netwerk \
203 $(NULL)
205 LOCALES_core := \
206 $(LOCALES_necko) \
207 dom \
208 $(NULL)
210 BOOTSTRAP_necko := \
211 mozilla/browser/config/version.txt \
212 mozilla/mail/config/version.txt \
213 mozilla/calendar/sunbird/config/version.txt \
214 mozilla/suite/config/version.txt \
215 $(NULL)
217 BOOTSTRAP_core := \
218 $(BOOTSTRAP_necko) \
219 $(NULL)
221 MODULES_NS_toolkit := \
222 $(MODULES_NS_core) \
223 $(NULL)
225 MODULES_toolkit := \
226 $(MODULES_core) \
227 mozilla/chrome \
228 $(NULL)
230 LOCALES_toolkit := \
231 $(LOCALES_core) \
232 toolkit \
233 security/manager \
234 $(NULL)
236 BOOTSTRAP_toolkit := \
237 $(BOOTSTRAP_core) \
238 $(NULL)
240 MODULES_NS_suite := \
241 $(MODULES_NS_toolkit) \
242 $(NULL)
244 MODULES_suite := \
245 $(MODULES_toolkit) \
246 mozilla/directory/xpcom \
247 mozilla/mailnews \
248 mozilla/themes \
249 mozilla/suite \
250 mozilla/other-licenses/7zstub/seamonkey \
251 $(NULL)
253 LOCALES_suite := \
254 $(LOCALES_toolkit) \
255 suite \
256 editor/ui \
257 extensions/reporter \
258 $(NULL)
260 BOOTSTRAP_suite := \
261 $(BOOTSTRAP_toolkit) \
262 $(NULL)
264 MODULES_NS_browser := \
265 $(MODULES_NS_toolkit) \
266 $(NULL)
268 MODULES_browser := \
269 $(MODULES_toolkit) \
270 mozilla/browser \
271 mozilla/other-licenses/branding/firefox \
272 mozilla/other-licenses/7zstub/firefox \
273 $(NULL)
275 LOCALES_browser := \
276 $(LOCALES_toolkit) \
277 browser \
278 extensions/reporter \
279 extensions/spellcheck \
280 other-licenses/branding/firefox \
281 $(NULL)
283 BOOTSTRAP_browser := \
284 $(BOOTSTRAP_toolkit) \
285 mozilla/browser/config/mozconfig \
286 $(NULL)
288 MODULES_NS_minimo := \
289 $(MODULES_NS_toolkit) \
290 $(NULL)
292 MODULES_minimo := \
293 $(MODULES_toolkit) \
294 mozilla/minimo \
295 $(NULL)
297 BOOTSTRAP_minimo := \
298 $(BOOTSTRAP_toolkit) \
299 $(NULL)
301 MODULES_NS_mail := \
302 $(MODULES_NS_toolkit) \
303 $(NULL)
305 MODULES_mail := \
306 $(MODULES_toolkit) \
307 mozilla/directory/xpcom \
308 mozilla/mailnews \
309 mozilla/mail \
310 mozilla/other-licenses/branding/thunderbird \
311 mozilla/other-licenses/7zstub/thunderbird \
312 $(NULL)
314 LOCALES_mail := \
315 $(LOCALES_toolkit) \
316 mail \
317 other-licenses/branding/thunderbird \
318 editor/ui \
319 extensions/spellcheck \
320 $(NULL)
322 BOOTSTRAP_mail := \
323 $(BOOTSTRAP_toolkit) \
324 mozilla/mail/config/mozconfig \
325 $(NULL)
327 MODULES_composer := \
328 $(MODULES_toolkit) \
329 mozilla/composer \
330 $(NULL)
332 MODULES_NS_calendar := \
333 $(MODULES_NS_toolkit) \
334 $(NULL)
336 MODULES_calendar := \
337 $(MODULES_toolkit) \
338 mozilla/storage \
339 mozilla/db/sqlite3 \
340 mozilla/calendar \
341 mozilla/other-licenses/branding/sunbird \
342 mozilla/other-licenses/7zstub/sunbird \
343 $(NULL)
345 LOCALES_calendar := \
346 $(LOCALES_toolkit) \
347 calendar \
348 other-licenses/branding/sunbird \
349 $(NULL)
351 BOOTSTRAP_calendar := \
352 $(BOOTSTRAP_toolkit) \
353 mozilla/calendar/sunbird/config/mozconfig \
354 $(NULL)
356 MODULES_NS_xulrunner := \
357 $(MODULES_NS_toolkit) \
358 $(NULL)
360 MODULES_xulrunner := \
361 $(MODULES_toolkit) \
362 mozilla/xulrunner \
363 $(NULL)
365 LOCALES_xulrunner := \
366 $(LOCALES_toolkit) \
367 $(NULL)
369 BOOTSTRAP_xulrunner := \
370 $(BOOTSTRAP_toolkit) \
371 mozilla/xulrunner/config/mozconfig \
372 $(NULL)
374 MODULES_NS_camino := \
375 $(MODULES_NS_toolkit) \
376 $(NULL)
378 MODULES_camino := \
379 $(MODULES_core) \
380 mozilla/camino \
381 mozilla/themes \
382 $(NULL)
384 BOOTSTRAP_camino := \
385 $(BOOTSTRAP_toolkit) \
386 mozilla/camino/config/mozconfig \
387 $(NULL)
389 MODULES_tamarin := \
390 mozilla/js/tamarin \
391 mozilla/modules/zlib \
392 $(NULL)
394 MODULES_all := \
395 mozilla/other-licenses/bsdiff \
396 mozilla/other-licenses/libart_lgpl \
397 mozilla/tools/trace-malloc \
398 mozilla/tools/jprof \
399 mozilla/tools/codesighs \
400 mozilla/tools/update-packaging \
401 $(NULL)
403 #######################################################################
404 # Checkout Tags
406 # For branches, uncomment the MOZ_CO_TAG line with the proper tag,
407 # and commit this file on that tag.
408 #MOZ_CO_TAG = <tag>
409 NSPR_CO_TAG = NSPRPUB_PRE_4_2_CLIENT_BRANCH
410 NSS_CO_TAG = NSS_3_11_7_WITH_CKBI_1_64_RTM
411 LDAPCSDK_CO_TAG = LDAPCSDK_6_0_3_CLIENT_BRANCH
412 LOCALES_CO_TAG =
414 #######################################################################
415 # Defines
417 CVS = cvs
418 comma := ,
420 CWD := $(shell pwd)
421 ifneq (1,$(words $(CWD)))
422 $(error The mozilla directory cannot be located in a path with spaces.)
423 endif
425 ifeq "$(CWD)" "/"
426 CWD := /.
427 endif
429 ifneq (, $(wildcard client.mk))
430 # Ran from mozilla directory
431 ROOTDIR := $(shell dirname $(CWD))
432 TOPSRCDIR := $(CWD)
433 else
434 # Ran from mozilla/.. directory (?)
435 ROOTDIR := $(CWD)
436 TOPSRCDIR := $(CWD)/mozilla
437 endif
439 # on os2, TOPSRCDIR may have two forward slashes in a row, which doesn't
440 # work; replace first instance with one forward slash
441 TOPSRCDIR := $(shell echo "$(TOPSRCDIR)" | sed -e 's%//%/%')
443 ifndef TOPSRCDIR_MOZ
444 TOPSRCDIR_MOZ=$(TOPSRCDIR)
445 endif
447 # if ROOTDIR equals only drive letter (i.e. "C:"), set to "/"
448 DIRNAME := $(shell echo "$(ROOTDIR)" | sed -e 's/^.://')
449 ifeq ($(DIRNAME),)
450 ROOTDIR := /.
451 endif
453 AUTOCONF := autoconf
454 MKDIR := mkdir
455 SH := /bin/sh
456 ifndef MAKE
457 MAKE := gmake
458 endif
459 PERL ?= perl
461 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
462 ifdef CONFIG_GUESS_SCRIPT
463 CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
464 else
465 _IS_FIRST_CHECKOUT := 1
466 endif
468 ####################################
469 # Sanity checks
471 ifneq (,$(filter MINGW%,$(shell uname -s)))
472 # check for CRLF line endings
473 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
474 $(error This source tree appears to have Windows-style line endings. To \
475 convert it to Unix-style line endings, run \
476 "python mozilla/build/win32/mozilla-dos2unix.py")
477 endif
478 endif
480 ####################################
481 # CVS
483 # Add the CVS root to CVS_FLAGS if needed
484 CVS_ROOT_IN_TREE := $(shell cat $(TOPSRCDIR)/CVS/Root 2>/dev/null)
485 ifneq ($(CVS_ROOT_IN_TREE),)
486 ifneq ($(CVS_ROOT_IN_TREE),$(CVSROOT))
487 CVS_FLAGS := -d $(CVS_ROOT_IN_TREE)
488 endif
489 endif
491 CVS_CO_DATE_FLAGS = $(if $(MOZ_CO_DATE),-D "$(MOZ_CO_DATE)")
492 CVS_CO_LOCALES_DATE_FLAGS = $(if $(MOZ_CO_LOCALES_DATE),-D "$(MOZ_CO_LOCALES_DATE)")
493 CVSCO = $(CVS) $(CVS_FLAGS) co $(MOZ_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG)) $(CVS_CO_DATE_FLAGS)
495 MOZ_CO_LOCALES_DATE ?= $(MOZ_CO_DATE)
497 CVSCO_LOGFILE := $(ROOTDIR)/cvsco.log
498 CVSCO_LOGFILE := $(shell echo $(CVSCO_LOGFILE) | sed s%//%/%)
500 # if LOCALES_CVSROOT is not specified, set it here
501 # (and let mozconfig override it)
502 LOCALES_CVSROOT ?= :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/l10n
504 ####################################
505 # Load mozconfig Options
507 # See build pages, http://www.mozilla.org/build/ for how to set up mozconfig.
509 MOZCONFIG_LOADER := mozilla/build/autoconf/mozconfig2client-mk
510 MOZCONFIG_FINDER := mozilla/build/autoconf/mozconfig-find
511 MOZCONFIG_MODULES := mozilla/build/unix/uniq.pl
512 run_for_side_effects := \
513 $(shell cd $(ROOTDIR); \
514 if test "$(_IS_FIRST_CHECKOUT)"; then \
515 $(CVSCO) $(MOZCONFIG_FINDER) $(MOZCONFIG_LOADER) $(MOZCONFIG_MODULES); \
516 else true; \
517 fi; \
518 $(MOZCONFIG_LOADER) $(TOPSRCDIR) mozilla/.mozconfig.mk > mozilla/.mozconfig.out)
519 include $(TOPSRCDIR)/.mozconfig.mk
521 ####################################
522 # Options that may come from mozconfig
524 MOZ_PROJECT_LIST := $(subst $(comma), ,$(MOZ_CO_PROJECT))
525 MOZ_PROJECT_LIST := $(subst macbrowser,camino,$(MOZ_PROJECT_LIST))
527 ifneq (,$(filter-out $(AVAILABLE_PROJECTS),$(MOZ_PROJECT_LIST)))
528 $(error MOZ_CO_PROJECT contains an unrecognized project.)
529 endif
531 ifeq (all,$(filter all,$(MOZ_PROJECT_LIST)))
532 MOZ_PROJECT_LIST := $(AVAILABLE_PROJECTS)
533 endif
535 MOZ_MODULE_LIST := $(subst $(comma), ,$(MOZ_CO_MODULE)) $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_$(project)))
536 MOZ_MODULE_LIST_NS := $(foreach project,$(MOZ_PROJECT_LIST),$(MODULES_NS_$(project)))
537 LOCALE_DIRS := $(MOZ_LOCALE_DIRS) $(foreach project,$(MOZ_PROJECT_LIST),$(LOCALES_$(project)))
539 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),$(BOOTSTRAP_$(project)))
541 # Using $(sort) here because it also removes duplicate entries.
542 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
543 LOCALE_DIRS := $(sort $(LOCALE_DIRS))
544 MOZCONFIG_MODULES := $(sort $(MOZCONFIG_MODULES))
546 # Change CVS flags if anonymous root is requested
547 ifdef MOZ_CO_USE_MIRROR
548 CVS_FLAGS := -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot
549 endif
551 # MOZ_CVS_FLAGS - Basic CVS flags
552 ifeq "$(origin MOZ_CVS_FLAGS)" "undefined"
553 CVS_FLAGS := $(CVS_FLAGS) -q -z 3
554 else
555 CVS_FLAGS := $(MOZ_CVS_FLAGS)
556 endif
558 ifdef MOZ_BUILD_PROJECTS
560 ifndef MOZ_OBJDIR
561 $(error When MOZ_BUILD_PROJECTS is set, you must set MOZ_OBJDIR)
562 endif
563 ifdef MOZ_CURRENT_PROJECT
564 OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
565 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
566 BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
567 else
568 OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
569 MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
570 endif
572 else # MOZ_BUILD_PROJECTS
574 ifdef MOZ_OBJDIR
575 OBJDIR = $(MOZ_OBJDIR)
576 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
577 else
578 OBJDIR := $(TOPSRCDIR)
579 MOZ_MAKE := $(MAKE) $(MOZ_MAKE_FLAGS)
580 endif
582 endif # MOZ_BUILD_PROJECTS
584 ####################################
585 # CVS defines for NSS
587 NSS_CO_MODULE = \
588 mozilla/dbm \
589 mozilla/security/nss \
590 mozilla/security/coreconf \
591 mozilla/security/dbm \
592 $(NULL)
594 NSS_CO_FLAGS := -P
595 ifdef MOZ_CO_FLAGS
596 NSS_CO_FLAGS := $(MOZ_CO_FLAGS)
597 endif
598 NSS_CO_FLAGS := $(NSS_CO_FLAGS) $(if $(NSS_CO_TAG),-r $(NSS_CO_TAG),-A)
600 # Can only pull the tip or branch tags by date
601 ifeq (,$(filter-out HEAD %BRANCH,$(NSS_CO_TAG)))
602 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSS_CO_MODULE)
603 else
604 CVSCO_NSS = $(CVS) $(CVS_FLAGS) co $(NSS_CO_FLAGS) $(NSS_CO_MODULE)
605 endif
607 ####################################
608 # CVS defines for NSPR
610 NSPR_CO_MODULE = mozilla/nsprpub
611 NSPR_CO_FLAGS := -P
612 ifdef MOZ_CO_FLAGS
613 NSPR_CO_FLAGS := $(MOZ_CO_FLAGS)
614 endif
615 NSPR_CO_FLAGS := $(NSPR_CO_FLAGS) $(if $(NSPR_CO_TAG),-r $(NSPR_CO_TAG),-A)
617 # Can only pull the tip or branch tags by date
618 ifeq (,$(filter-out HEAD %BRANCH,$(NSPR_CO_TAG)))
619 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(NSPR_CO_MODULE)
620 else
621 CVSCO_NSPR = $(CVS) $(CVS_FLAGS) co $(NSPR_CO_FLAGS) $(NSPR_CO_MODULE)
622 endif
624 ####################################
625 # CVS defines for the C LDAP SDK
627 LDAPCSDK_CO_MODULE = mozilla/directory/c-sdk
628 LDAPCSDK_CO_FLAGS := -P
629 ifdef MOZ_CO_FLAGS
630 LDAPCSDK_CO_FLAGS := $(MOZ_CO_FLAGS)
631 endif
632 LDAPCSDK_CO_FLAGS := $(LDAPCSDK_CO_FLAGS) $(if $(LDAPCSDK_CO_TAG),-r $(LDAPCSDK_CO_TAG),-A)
634 # Can only pull the tip or branch tags by date
635 ifeq (,$(filter-out HEAD %BRANCH,$(LDAPCSDK_CO_TAG)))
636 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(LDAPCSDK_CO_MODULE)
637 else
638 CVSCO_LDAPCSDK = $(CVS) $(CVS_FLAGS) co $(LDAPCSDK_CO_FLAGS) $(LDAPCSDK_CO_MODULE)
639 endif
641 ####################################
642 # Error on obsolete variables.
645 ifdef MOZ_MAPINFO
646 $(warning MOZ_MAPINFO is obsolete, use MOZ_CO_MODULE=mozilla/tools/codesighs instead.)
647 MOZ_MODULE_LIST += mozilla/tools/codesighs
648 endif
649 ifdef MOZ_INTERNAL_LIBART_LGPL
650 $(error MOZ_INTERNAL_LIBART_LGPL is obsolete, use MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl instead.)
651 endif
652 ifdef MOZ_PHOENIX
653 $(warning MOZ_PHOENIX is obsolete.)
654 MOZ_MODULE_LIST += $(MODULES_browser)
655 # $(error MOZ_PHOENIX is obsolete, use MOZ_CO_PROJECT=browser and --enable-application=browser)
656 endif
657 ifdef MOZ_THUNDERBIRD
658 $(warning MOZ_THUNDERBIRD is obsolete.)
659 MOZ_MODULE_LIST += $(MODULES_mail)
660 # $(error MOZ_THUNDERBIRD is obsolete, use MOZ_CO_PROJECT=mail and --enable-application=mail)
661 endif
663 ###################################
664 # Checkout main modules
667 # sort is used to remove duplicates.
668 MOZ_MODULE_LIST := $(sort $(MOZ_MODULE_LIST))
669 MOZ_MODULE_LIST_NS := $(sort $(MOZ_MODULE_LIST_NS))
671 ####################################
672 # Suppress standalone modules if they're not needed.
674 CONFIGURES := $(TOPSRCDIR)/configure
675 ifeq (,$(filter mozilla/xpcom,$(MOZ_MODULE_LIST)))
676 CVSCO_NSPR :=
677 else
678 CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
679 endif
681 ifeq (,$(filter mozilla/security/manager,$(MOZ_MODULE_LIST)))
682 CVSCO_NSS :=
683 endif
684 ifeq (,$(filter mozilla/directory/xpcom,$(MOZ_MODULE_LIST)))
685 CVSCO_LDAPCSDK :=
686 else
687 CONFIGURES += $(TOPSRCDIR)/directory/c-sdk/configure
688 endif
690 MODULES_CO_FLAGS := -P
691 ifdef MOZ_CO_FLAGS
692 MODULES_CO_FLAGS := $(MOZ_CO_FLAGS)
693 endif
694 MODULES_CO_FLAGS := $(MODULES_CO_FLAGS) $(if $(MOZ_CO_TAG),-r $(MOZ_CO_TAG),-A)
696 CVSCO_MODULES_NS = $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(MOZ_MODULE_LIST_NS)
698 ifeq (,$(strip $(MOZ_MODULE_LIST)))
699 FASTUPDATE_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
700 CHECKOUT_MODULES = $(error No modules or projects were specified. Use MOZ_CO_PROJECT to specify a project for checkout.)
701 else
702 FASTUPDATE_MODULES := fast_update $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST)
703 CHECKOUT_MODULES := cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(MOZ_MODULE_LIST);
704 endif
705 ifeq (,$(MOZ_MODULE_LIST_NS))
706 FASTUPDATE_MODULES_NS := true
707 CHECKOUT_MODULES_NS := true
708 else
709 FASTUPDATE_MODULES_NS := fast_update $(CVSCO_MODULES_NS)
710 CHECKOUT_MODULES_NS := cvs_co $(CVSCO_MODULES_NS)
711 endif
713 ###################################
714 # CVS defines for locales
717 LOCALES_CO_FLAGS := -P
718 ifdef MOZ_CO_FLAGS
719 LOCALES_CO_FLAGS := $(MOZ_CO_FLAGS)
720 endif
721 LOCALES_CO_FLAGS := $(LOCALES_CO_FLAGS) $(if $(LOCALES_CO_TAG),-r $(LOCALES_CO_TAG),-A)
723 ifndef MOZ_CO_LOCALES
724 FASTUPDATE_LOCALES := true
725 CHECKOUT_LOCALES := true
726 else
728 override MOZ_CO_LOCALES := $(subst $(comma), ,$(MOZ_CO_LOCALES))
730 ifeq (all,$(MOZ_CO_LOCALES))
731 MOZCONFIG_MODULES += $(foreach project,$(MOZ_PROJECT_LIST),mozilla/$(project)/locales/all-locales)
733 LOCALE_CO_DIRS := $(sort $(foreach project,$(MOZ_PROJECT_LIST),$(foreach locale,$(shell cat mozilla/$(project)/locales/all-locales),$(foreach dir,$(LOCALES_$(project)),l10n/$(locale)/$(dir)))))
734 else # MOZ_CO_LOCALES != all
735 LOCALE_CO_DIRS = $(sort $(foreach locale,$(MOZ_CO_LOCALES),$(foreach dir,$(LOCALE_DIRS),l10n/$(locale)/$(dir))))
736 endif
738 CVSCO_LOCALES := $(CVS) $(CVS_FLAGS) -d $(LOCALES_CVSROOT) co $(LOCALES_CO_FLAGS) $(CVS_CO_LOCALES_DATE_FLAGS) $(LOCALE_CO_DIRS)
740 FASTUPDATE_LOCALES := fast_update $(CVSCO_LOCALES)
741 CHECKOUT_LOCALES := cvs_co $(CVSCO_LOCALES)
742 endif #MOZ_CO_LOCALES
744 #######################################################################
745 # Rules
748 # Print out any options loaded from mozconfig.
749 all build checkout clean depend distclean export libs install realclean::
750 @if test -f .mozconfig.out; then \
751 cat .mozconfig.out; \
752 rm -f .mozconfig.out; \
753 else true; \
756 ifdef _IS_FIRST_CHECKOUT
757 all:: checkout build
758 else
759 all:: checkout alldep
760 endif
762 # Windows equivalents
763 pull_all: checkout
764 build_all: build
765 build_all_dep: alldep
766 build_all_depend: alldep
767 clobber clobber_all: clean
768 pull_and_build_all: checkout alldep
770 # Do everything from scratch
771 everything: checkout clean build
773 ####################################
774 # CVS checkout
776 checkout::
777 # @: Backup the last checkout log.
778 @if test -f $(CVSCO_LOGFILE) ; then \
779 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
780 else true; \
782 ifdef RUN_AUTOCONF_LOCALLY
783 @echo "Removing local configures" ; \
784 cd $(ROOTDIR) && \
785 $(RM) -f $(CONFIGURES)
786 endif
787 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
788 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
789 cd $(ROOTDIR) && \
790 $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
791 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_checkout
793 # Start the checkout. Split the output to the tty and a log file.
795 real_checkout:
796 @set -e; \
797 cvs_co() { set -e; echo "$$@" ; \
798 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
799 cvs_co $(CVSCO_NSPR); \
800 cvs_co $(CVSCO_NSS); \
801 cvs_co $(CVSCO_LDAPCSDK); \
802 $(CHECKOUT_MODULES_NS); \
803 $(CHECKOUT_MODULES) \
804 $(CHECKOUT_LOCALES);
805 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE)
806 # update the NSS checkout timestamp, if we checked PSM out
807 @if test -d $(TOPSRCDIR)/security/manager -a \
808 `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
809 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
811 ifdef RUN_AUTOCONF_LOCALLY
812 cd $(ROOTDIR) && \
813 $(RM) -f $(CONFIGURES)
814 endif
815 # @: Check the log for conflicts. ;
816 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
817 if test "$$conflicts" ; then \
818 echo "$(MAKE): *** Conflicts during checkout." ;\
819 echo "$$conflicts" ;\
820 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
821 false; \
822 else true; \
825 fast-update:
826 # @: Backup the last checkout log.
827 @if test -f $(CVSCO_LOGFILE) ; then \
828 mv $(CVSCO_LOGFILE) $(CVSCO_LOGFILE).old; \
829 else true; \
831 ifdef RUN_AUTOCONF_LOCALLY
832 @echo "Removing local configures" ; \
833 cd $(ROOTDIR) && \
834 $(RM) -f $(CONFIGURES)
835 endif
836 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE)
837 @echo '$(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
838 cd $(ROOTDIR) && \
839 $(CVSCO) mozilla/client.mk $(MOZCONFIG_MODULES)
840 @cd $(TOPSRCDIR) && \
841 $(MAKE) -f client.mk real_fast-update
843 # Start the update. Split the output to the tty and a log file.
844 real_fast-update:
845 @set -e; \
846 fast_update() { set -e; config/cvsco-fast-update.pl $$@ 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
847 cvs_co() { set -e; echo "$$@" ; \
848 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE); }; \
849 fast_update $(CVSCO_NSPR); \
850 cd $(ROOTDIR); \
851 cvs_co $(CVSCO_NSS); \
852 cd mozilla; \
853 fast_update $(CVSCO_LDAPCSDK); \
854 $(FASTUPDATE_MODULES); \
855 $(FASTUPDATE_MODULES_NS); \
856 $(FASTUPDATE_LOCALES);
857 @echo "fast_update finish: "`date` | tee -a $(CVSCO_LOGFILE)
858 # update the NSS checkout timestamp
859 @if test `egrep -c '^(U|C) mozilla/security/(nss|coreconf)' $(CVSCO_LOGFILE) 2>/dev/null` != 0; then \
860 touch $(TOPSRCDIR)/security/manager/.nss.checkout; \
862 ifdef RUN_AUTOCONF_LOCALLY
863 cd $(ROOTDIR) && \
864 $(RM) -f $(CONFIGURES)
865 endif
866 # @: Check the log for conflicts. ;
867 @conflicts=`egrep "^C " $(CVSCO_LOGFILE)` ;\
868 if test "$$conflicts" ; then \
869 echo "$(MAKE): *** Conflicts during fast-update." ;\
870 echo "$$conflicts" ;\
871 echo "$(MAKE): Refer to $(CVSCO_LOGFILE) for full log." ;\
872 false; \
873 else true; \
876 CVSCO_LOGFILE_L10N := $(ROOTDIR)/cvsco-l10n.log
877 CVSCO_LOGFILE_L10N := $(shell echo $(CVSCO_LOGFILE_L10N) | sed s%//%/%)
879 l10n-checkout:
880 # @: Backup the last checkout log.
881 @if test -f $(CVSCO_LOGFILE_L10N) ; then \
882 mv $(CVSCO_LOGFILE_L10N) $(CVSCO_LOGFILE_L10N).old; \
883 else true; \
885 @echo "checkout start: "`date` | tee $(CVSCO_LOGFILE_L10N)
886 @echo '$(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)'; \
887 cd $(ROOTDIR) && \
888 $(CVSCO) $(CVS_CO_DATE_FLAGS) mozilla/client.mk $(MOZCONFIG_MODULES)
889 @cd $(ROOTDIR) && $(MAKE) -f mozilla/client.mk real_l10n-checkout
891 EN_US_CO_DIRS := $(sort $(foreach dir,$(LOCALE_DIRS),mozilla/$(dir)/locales)) \
892 $(foreach mod,$(MOZ_PROJECT_LIST),mozilla/$(mod)/config) \
893 mozilla/client.mk \
894 $(MOZCONFIG_MODULES) \
895 mozilla/configure \
896 mozilla/configure.in \
897 mozilla/allmakefiles.sh \
898 mozilla/build \
899 mozilla/config \
900 $(NULL)
902 EN_US_CO_FILES_NS := \
903 mozilla/toolkit/mozapps/installer \
904 $(NULL)
906 # Start the checkout. Split the output to the tty and a log file.
907 real_l10n-checkout:
908 @set -e; \
909 cvs_co() { set -e; echo "$$@" ; \
910 "$$@" 2>&1 | tee -a $(CVSCO_LOGFILE_L10N); }; \
911 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) $(EN_US_CO_DIRS); \
912 cvs_co $(CVS) $(CVS_FLAGS) co $(MODULES_CO_FLAGS) $(CVS_CO_DATE_FLAGS) -l $(EN_US_CO_FILES_NS); \
913 cvs_co $(CVSCO_LOCALES)
914 @echo "checkout finish: "`date` | tee -a $(CVSCO_LOGFILE_L10N)
915 # @: Check the log for conflicts. ;
916 @conflicts=`egrep "^C " $(CVSCO_LOGFILE_L10N)` ;\
917 if test "$$conflicts" ; then \
918 echo "$(MAKE): *** Conflicts during checkout." ;\
919 echo "$$conflicts" ;\
920 echo "$(MAKE): Refer to $(CVSCO_LOGFILE_L10N) for full log." ;\
921 false; \
922 else true; \
925 #####################################################
926 # First Checkout
928 ifdef _IS_FIRST_CHECKOUT
929 # First time, do build target in a new process to pick up new files.
930 build::
931 $(MAKE) -f $(TOPSRCDIR)/client.mk build
932 else
934 #####################################################
935 # After First Checkout
937 #####################################################
938 # Build date unification
940 ifdef MOZ_UNIFY_BDATE
941 ifndef MOZ_BUILD_DATE
942 ifdef MOZ_BUILD_PROJECTS
943 MOZ_BUILD_DATE = $(shell $(PERL) -I$(TOPSRCDIR)/config $(TOPSRCDIR)/config/bdate.pl)
944 export MOZ_BUILD_DATE
945 endif
946 endif
947 endif
949 #####################################################
950 # Preflight, before building any project
952 build profiledbuild alldep preflight_all::
953 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_PREFLIGHT_ALL),,1))
954 # Don't run preflight_all for individual projects in multi-project builds
955 # (when MOZ_CURRENT_PROJECT is set.)
956 ifndef MOZ_BUILD_PROJECTS
957 # Building a single project, OBJDIR is usable.
958 set -e; \
959 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
960 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
961 done
962 else
963 # OBJDIR refers to the project-specific OBJDIR, which is not available at
964 # this point when building multiple projects. Only MOZ_OBJDIR is available.
965 set -e; \
966 for mkfile in $(MOZ_PREFLIGHT_ALL); do \
967 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
968 done
969 endif
970 endif
972 # If we're building multiple projects, but haven't specified which project,
973 # loop through them.
975 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_BUILD_PROJECTS),,1))
976 configure depend build profiledbuild install export libs clean realclean distclean alldep preflight postflight::
977 set -e; \
978 for app in $(MOZ_BUILD_PROJECTS); do \
979 $(MAKE) -f $(TOPSRCDIR)/client.mk $@ MOZ_CURRENT_PROJECT=$$app; \
980 done
982 else
984 # MOZ_CURRENT_PROJECT: either doing a single-project build, or building an
985 # individual project in a multi-project build.
987 ####################################
988 # Configure
990 CONFIG_STATUS = $(wildcard $(OBJDIR)/config.status)
991 CONFIG_CACHE = $(wildcard $(OBJDIR)/config.cache)
993 ifdef RUN_AUTOCONF_LOCALLY
994 EXTRA_CONFIG_DEPS := \
995 $(TOPSRCDIR)/aclocal.m4 \
996 $(wildcard $(TOPSRCDIR)/build/autoconf/*.m4) \
997 $(NULL)
999 $(TOPSRCDIR)/configure: $(TOPSRCDIR)/configure.in $(EXTRA_CONFIG_DEPS)
1000 @echo Generating $@ using autoconf
1001 cd $(TOPSRCDIR); $(AUTOCONF)
1003 $(TOPSRCDIR)/nsprpub/configure: $(TOPSRCDIR)/nsprpub/configure.in $(EXTRA_CONFIG_DEPS)
1004 @echo Generating $@ using autoconf
1005 cd $(TOPSRCDIR)/nsprpub; $(AUTOCONF)
1007 $(TOPSRCDIR)/directory/c-sdk/configure: $(TOPSRCDIR)/directory/c-sdk/configure.in $(EXTRA_CONFIG_DEPS)
1008 @echo Generating $@ using autoconf
1009 cd $(TOPSRCDIR)/directory/c-sdk; $(AUTOCONF)
1010 endif
1012 CONFIG_STATUS_DEPS := \
1013 $(TOPSRCDIR)/configure \
1014 $(TOPSRCDIR)/allmakefiles.sh \
1015 $(TOPSRCDIR)/.mozconfig.mk \
1016 $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
1017 $(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
1018 $(wildcard $(TOPSRCDIR)/mailnews/makefiles) \
1019 $(wildcard $(TOPSRCDIR)/themes/makefiles) \
1020 $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
1021 $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
1022 $(NULL)
1024 # configure uses the program name to determine @srcdir@. Calling it without
1025 # $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
1026 # path of $(TOPSRCDIR).
1027 ifeq ($(TOPSRCDIR),$(OBJDIR))
1028 CONFIGURE = ./configure
1029 else
1030 CONFIGURE = $(TOPSRCDIR)/configure
1031 endif
1033 ifdef MOZ_TOOLS
1034 CONFIGURE = $(TOPSRCDIR)/configure
1035 endif
1037 configure:: $(CONFIGURES)
1038 ifdef MOZ_BUILD_PROJECTS
1039 @if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
1040 endif
1041 @if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
1042 @echo cd $(OBJDIR);
1043 @echo $(CONFIGURE) $(CONFIGURE_ARGS)
1044 @cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
1045 || ( echo "*** Fix above errors and then restart with\
1046 \"$(MAKE) -f client.mk build\"" && exit 1 )
1047 @touch $(OBJDIR)/Makefile
1049 $(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
1050 @$(MAKE) -f $(TOPSRCDIR)/client.mk configure
1052 ifneq (,$(CONFIG_STATUS))
1053 $(OBJDIR)/config/autoconf.mk: $(TOPSRCDIR)/config/autoconf.mk.in
1054 cd $(OBJDIR); \
1055 CONFIG_FILES=config/autoconf.mk ./config.status
1056 endif
1059 ####################################
1060 # Depend
1062 depend:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1063 $(MOZ_MAKE) export && $(MOZ_MAKE) depend
1065 ####################################
1066 # Preflight
1068 build profiledbuild alldep preflight::
1069 ifdef MOZ_PREFLIGHT
1070 set -e; \
1071 for mkfile in $(MOZ_PREFLIGHT); do \
1072 $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1073 done
1074 endif
1076 ####################################
1077 # Build it
1079 build:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1080 $(MOZ_MAKE)
1082 ####################################
1083 # Profile-feedback build (gcc only)
1084 # To use this, you should set the following variables in your mozconfig
1085 # mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
1087 # The profile script should exercise the functionality to be included
1088 # in the profile feedback.
1090 profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1091 $(MOZ_MAKE) MOZ_PROFILE_GENERATE=1
1092 OBJDIR=${OBJDIR} $(PROFILE_GEN_SCRIPT)
1093 $(MOZ_MAKE) clobber_all
1094 $(MOZ_MAKE) MOZ_PROFILE_USE=1
1095 find $(OBJDIR) -name "*.da" -exec rm {} \;
1097 ####################################
1098 # Other targets
1100 # Pass these target onto the real build system
1101 install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
1102 $(MOZ_MAKE) $@
1104 ####################################
1105 # Postflight
1107 build profiledbuild alldep postflight::
1108 ifdef MOZ_POSTFLIGHT
1109 set -e; \
1110 for mkfile in $(MOZ_POSTFLIGHT); do \
1111 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1112 done
1113 endif
1115 endif # MOZ_CURRENT_PROJECT
1117 ####################################
1118 # Postflight, after building all projects
1120 build profiledbuild alldep postflight_all::
1121 ifeq (,$(MOZ_CURRENT_PROJECT)$(if $(MOZ_POSTFLIGHT_ALL),,1))
1122 # Don't run postflight_all for individual projects in multi-project builds
1123 # (when MOZ_CURRENT_PROJECT is set.)
1124 ifndef MOZ_BUILD_PROJECTS
1125 # Building a single project, OBJDIR is usable.
1126 set -e; \
1127 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1128 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
1129 done
1130 else
1131 # OBJDIR refers to the project-specific OBJDIR, which is not available at
1132 # this point when building multiple projects. Only MOZ_OBJDIR is available.
1133 set -e; \
1134 for mkfile in $(MOZ_POSTFLIGHT_ALL); do \
1135 $(MAKE) -f $(TOPSRCDIR)/$$mkfile postflight_all TOPSRCDIR=$(TOPSRCDIR) MOZ_OBJDIR=$(MOZ_OBJDIR) MOZ_BUILD_PROJECTS="$(MOZ_BUILD_PROJECTS)"; \
1136 done
1137 endif
1138 endif
1140 cleansrcdir:
1141 @cd $(TOPSRCDIR); \
1142 if [ -f Makefile ]; then \
1143 $(MAKE) distclean ; \
1144 else \
1145 echo "Removing object files from srcdir..."; \
1146 rm -fr `find . -type d \( -name .deps -print -o -name CVS \
1147 -o -exec test ! -d {}/CVS \; \) -prune \
1148 -o \( -name '*.[ao]' -o -name '*.so' \) -type f -print`; \
1149 build/autoconf/clean-config.sh; \
1152 # (! IS_FIRST_CHECKOUT)
1153 endif
1155 echo-variable-%:
1156 @echo $($*)
1158 .PHONY: checkout real_checkout depend build export libs alldep install clean realclean distclean cleansrcdir pull_all build_all clobber clobber_all pull_and_build_all everything configure preflight_all preflight postflight postflight_all