1 # Copyright 2003, 2005, 2007 Dave Abrahams
2 # Copyright 2006, 2007 Rene Rivera
3 # Copyright 2003, 2004, 2005, 2006 Vladimir Prus
4 # Distributed under the Boost Software License, Version 1.0.
5 # (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
8 # This file is part of Boost Build version 2. You can think of it as forming the
9 # main() routine. It is invoked by the bootstrapping code in bootstrap.jam.
11 import build-request ;
13 import "class" : new ;
31 import virtual-target ;
34 ################################################################################
38 ################################################################################
40 # Shortcut used in this module for accessing used command-line parameters.
41 .argv = [ modules.peek : ARGV ] ;
43 # Flag indicating we should display additional debugging information related to
44 # locating and loading Boost Build configuration files.
45 .debug-config = [ MATCH ^(--debug-configuration)$ : $(.argv) ] ;
47 # Virtual targets obtained when building main targets references on the command
48 # line. When running 'bjam --clean main_target' we want to clean only files
49 # belonging to that main target so we need to record which targets are produced
51 .results-of-main-targets = ;
53 # Was an XML dump requested?
54 .out-xml = [ MATCH ^--out-xml=(.*)$ : $(.argv) ] ;
56 # Default toolset & version to be used in case no other toolset has been used
57 # explicitly by either the loaded configuration files, the loaded project build
58 # scripts or an explicit toolset request on the command line. If not specified,
59 # an arbitrary default will be used based on the current host OS. This value,
60 # while not strictly necessary, has been added to allow testing Boost-Build's
61 # default toolset usage functionality.
63 .default-toolset-version = ;
66 ################################################################################
70 ################################################################################
72 # Returns the property set with the free features from the currently processed
75 rule command-line-free-features ( )
77 return $(.command-line-free-features) ;
81 # Returns the location of the build system. The primary use case is building
82 # Boost where it is sometimes needed to get the location of other components
83 # (e.g. BoostBook files) and it is convenient to use locations relative to the
88 local r = [ modules.binding build-system ] ;
93 # Sets the default toolset & version to be used in case no other toolset has
94 # been used explicitly by either the loaded configuration files, the loaded
95 # project build scripts or an explicit toolset request on the command line. For
96 # more detailed information see the comment related to used global variables.
98 rule set-default-toolset ( toolset : version ? )
100 .default-toolset = $(toolset) ;
101 .default-toolset-version = $(version) ;
104 rule set-pre-build-hook ( function )
106 .pre-build-hook = $(function) ;
109 rule set-post-build-hook ( function )
111 .post-build-hook = $(function) ;
114 ################################################################################
118 ################################################################################
120 # Returns actual Jam targets to be used for executing a clean request.
122 local rule actual-clean-targets ( )
124 # The cleaning is tricky. Say, if user says 'bjam --clean foo' where 'foo'
125 # is a directory, then we want to clean targets which are in 'foo' as well
126 # as those in any children Jamfiles under foo but not in any unrelated
127 # Jamfiles. To achieve this we first mark all projects explicitly detected
128 # as targets for this build system run as needing to be cleaned.
129 for local t in $(targets)
131 if [ class.is-a $(t) : project-target ]
133 local project = [ $(t).project-module ] ;
134 .should-clean-project.$(project) = true ;
138 # Construct a list of targets explicitly detected on this build system run
139 # as a result of building main targets.
140 local targets-to-clean ;
141 for local t in $(.results-of-main-targets)
143 # Do not include roots or sources.
144 targets-to-clean += [ virtual-target.traverse $(t) ] ;
146 targets-to-clean = [ sequence.unique $(targets-to-clean) ] ;
149 for local t in [ virtual-target.all-targets ]
151 # Remove only derived targets and only those asked to be cleaned,
152 # whether directly or by belonging to one of the removed projects.
153 local p = [ $(t).project ] ;
154 if [ $(t).action ] && ( $(t) in $(targets-to-clean) ||
155 [ should-clean-project [ $(p).project-module ] ] )
161 local to-clean-actual ;
162 for local t in $(to-clean)
164 to-clean-actual += [ $(t).actualize ] ;
166 return $(to-clean-actual) ;
170 # Given a target id, try to find and return the corresponding target. This is
171 # only invoked when there is no Jamfile in ".". This code somewhat duplicates
172 # code in project-target.find but we can not reuse that code without a
173 # project-targets instance.
175 local rule find-target ( target-id )
177 local split = [ MATCH (.*)//(.*) : $(target-id) ] ;
182 pm = [ project.find $(split[1]) : "." ] ;
186 pm = [ project.find $(target-id) : "." ] ;
192 result = [ project.target $(pm) ] ;
197 result = [ $(result).find $(split[2]) ] ;
204 # Initializes a new configuration module.
206 local rule initialize-config-module ( module-name : location ? )
208 project.initialize $(module-name) : $(location) ;
209 if USER_MODULE in [ RULENAMES ]
211 USER_MODULE $(module-name) ;
216 # Helper rule used to load configuration files. Loads the first configuration
217 # file with the given 'filename' at 'path' into module with name 'module-name'.
218 # Not finding the requested file may or may not be treated as an error depending
219 # on the must-find parameter. Returns a normalized path to the loaded
220 # configuration file or nothing if no file was loaded.
222 local rule load-config ( module-name : filename : path + : must-find ? )
226 local path-string = $(path) ;
227 if $(path-string) = "" { path-string = . ; }
228 ECHO notice: Searching '$(path-string)' for $(module-name)
229 configuration file '$(filename)'. ;
231 local where = [ GLOB $(path) : $(filename) ] ;
234 where = [ NORMALIZE_PATH $(where[1]) ] ;
237 local where-string = $(where:D) ;
238 if $(where-string) = "" { where-string = . ; }
239 where-string = '$(where-string)' ;
240 ECHO notice: Loading $(module-name) configuration file '$(filename)'
241 from $(where-string:J=" "). ;
244 # Set source location so that path-constant in config files with
245 # relative paths work. This is of most importance for
246 # project-config.jam, but may be used in other config files as well.
247 local attributes = [ project.attributes $(module-name) ] ;
248 $(attributes).set source-location : $(where:D) : exact ;
249 modules.load $(module-name) : $(filename) : $(path) ;
250 project.load-used-projects $(module-name) ;
252 else if $(must-find) || $(.debug-config)
254 local path-string = $(path) ;
255 if $(path-string) = "" { path-string = . ; }
256 path-string = '$(path-string)' ;
257 path-string = $(path-string:J=" ") ;
261 errors.user-error Configuration file '$(filename)' not found "in"
264 ECHO notice: Configuration file '$(filename)' not found "in"
271 # Loads all the configuration files used by Boost Build in the following order:
274 # Loaded only if specified on the command-line using the --test-config
275 # command-line parameter. It is ok for this file not to exist even if specified.
276 # If this configuration file is loaded, regular site and user configuration
277 # files will not be. If a relative path is specified, file is searched for in
278 # the current folder.
281 # Always named site-config.jam. Will only be found if located on the system
282 # root path (Windows), /etc (non-Windows), user's home folder or the Boost Build
283 # path, in that order. Not loaded in case the test-config configuration file is
284 # loaded or the --ignore-site-config command-line option is specified.
287 # Named user-config.jam by default or may be named explicitly using the
288 # --user-config command-line option or the BOOST_BUILD_USER_CONFIG environment
289 # variable. If named explicitly the file is looked for from the current working
290 # directory and if the default one is used then it is searched for in the
291 # user's home directory and the Boost Build path, in that order. Not loaded in
292 # case either the test-config configuration file is loaded or an empty file name
293 # is explicitly specified. If the file name has been given explicitly then the
296 # -- project-config --
297 # Always named project-config.jam. Looked up in the current working folder and
298 # then upwards through its parents up to the root folder.
300 # Test configurations have been added primarily for use by Boost Build's
301 # internal unit testing system but may be used freely in other places as well.
303 local rule load-configuration-files
305 # Flag indicating that site configuration should not be loaded.
306 local ignore-site-config =
307 [ MATCH ^(--ignore-site-config)$ : $(.argv) ] ;
309 initialize-config-module test-config ;
310 local test-config = [ MATCH ^--test-config=(.*)$ : $(.argv) ] ;
311 local uq = [ MATCH \"(.*)\" : $(test-config) ] ;
314 test-config = $(uq) ;
318 local where = [ load-config test-config : $(test-config:BS) :
324 ECHO "notice: Regular site and user configuration files will" ;
325 ECHO "notice: be ignored due to the test configuration being"
335 local user-path = [ os.home-directories ] [ os.environ BOOST_BUILD_PATH ] ;
336 local site-path = /etc $(user-path) ;
337 if [ os.name ] in NT CYGWIN
339 site-path = [ modules.peek : SystemRoot ] $(user-path) ;
342 if $(.debug-config) && ! $(test-config) && $(ignore-site-config)
344 ECHO "notice: Site configuration files will be ignored due to the" ;
345 ECHO "notice: --ignore-site-config command-line option." ;
348 initialize-config-module site-config ;
349 if ! $(test-config) && ! $(ignore-site-config)
351 load-config site-config : site-config.jam : $(site-path) ;
354 initialize-config-module user-config ;
357 local user-config = [ MATCH ^--user-config=(.*)$ : $(.argv) ] ;
358 user-config = $(user-config[-1]) ;
359 user-config ?= [ os.environ BOOST_BUILD_USER_CONFIG ] ;
360 # Special handling for the case when the OS does not strip the quotes
361 # around the file name, as is the case when using Cygwin bash.
362 user-config = [ utility.unquote $(user-config) ] ;
363 local explicitly-requested = $(user-config) ;
364 user-config ?= user-config.jam ;
368 if $(explicitly-requested)
370 # Treat explicitly entered user paths as native OS path
371 # references and, if non-absolute, root them at the current
373 user-config = [ path.make $(user-config) ] ;
374 user-config = [ path.root $(user-config) [ path.pwd ] ] ;
375 user-config = [ path.native $(user-config) ] ;
379 ECHO notice: Loading explicitly specified user configuration
381 ECHO " $(user-config)" ;
384 load-config user-config : $(user-config:BS) : $(user-config:D)
389 load-config user-config : $(user-config) : $(user-path) ;
392 else if $(.debug-config)
394 ECHO notice: User configuration file loading explicitly disabled. ;
398 # We look for project-config.jam from "." upward. I am not sure this is 100%
399 # right decision, we might as well check for it only alongside the Jamroot
401 # - We need to load project-config.jam before Jamroot
402 # - We probably need to load project-config.jam even if there is no Jamroot
403 # - e.g. to implement automake-style out-of-tree builds.
404 local file = [ path.glob "." : project-config.jam ] ;
407 file = [ path.glob-in-parents "." : project-config.jam ] ;
411 initialize-config-module project-config : $(file:D) ;
412 load-config project-config : project-config.jam : $(file:D) ;
419 # Autoconfigure toolsets based on any instances of --toolset=xx,yy,...zz or
420 # toolset=xx,yy,...zz in the command line. May return additional properties to
421 # be processed as if they had been specified by the user.
423 local rule process-explicit-toolset-requests
425 local extra-properties ;
427 local option-toolsets = [ regex.split-list [ MATCH ^--toolset=(.*)$ : $(.argv) ] : "," ] ;
428 local feature-toolsets = [ regex.split-list [ MATCH ^toolset=(.*)$ : $(.argv) ] : "," ] ;
430 for local t in $(option-toolsets) $(feature-toolsets)
432 # Parse toolset-version/properties.
433 local toolset = [ MATCH ([^/]+)/?.* : $(t) ] ;
434 local properties = [ feature.expand-subfeatures <toolset>$(toolset) : true ] ;
435 local toolset-property = [ property.select <toolset> : $(properties) ] ;
437 if $(toolset-property:G=) in [ feature.values <toolset> ]
442 # If the toolset is not known, configure it now.
444 # TODO: we should do 'using $(toolset)' in case no version has been
445 # specified and there are no versions defined for the given toolset to
446 # allow the toolset to configure its default version. For this we need
447 # to know how to detect whether a given toolset has any versions
448 # defined. An alternative would be to do this whenever version is not
449 # specified but that would require that toolsets correctly handle the
450 # case when their default version is configured multiple times which
451 # should be checked for all existing toolsets first.
457 ECHO "notice: [cmdline-cfg] toolset $(toolset) not"
458 "previously configured; attempting to auto-configure now" ;
460 local t,v = [ MATCH ([^-]+)-?(.+)? : $(toolset) ] ;
461 toolset.using $(t,v[1]) : $(t,v[2]) ;
464 # Make sure we get an appropriate property into the build request in
465 # case toolset has been specified using the "--toolset=..." command-line
467 if ! $(t) in $(.argv) $(feature-toolsets)
471 ECHO notice: [cmdline-cfg] adding toolset=$(t) to the build
474 extra-properties += toolset=$(t) ;
478 return $(extra-properties) ;
482 # Returns whether the given project (identifed by its project module) should be
483 # cleaned because it or any of its parent projects have already been marked as
484 # needing to be cleaned in this build. As an optimization, will explicitly mark
485 # all encountered project needing to be cleaned in case thay have not already
488 local rule should-clean-project ( project )
490 if ! $(.should-clean-project.$(project))-is-defined
493 if ! [ project.is-jamroot-module $(project) ]
495 local parent = [ project.attribute $(project) parent-module ] ;
498 r = [ should-clean-project $(parent) ] ;
501 .should-clean-project.$(project) = $(r) ;
504 return $(.should-clean-project.$(project)) ;
508 ################################################################################
513 ################################################################################
516 if --version in $(.argv)
522 version.verify-engine-version ;
524 load-configuration-files ;
526 # Load explicitly specified toolset modules.
527 local extra-properties = [ process-explicit-toolset-requests ] ;
529 # Load the actual project build script modules. We always load the project
530 # in the current folder so 'use-project' directives have any chance of being
531 # seen. Otherwise, we would not be able to refer to subprojects using target
533 local current-project ;
535 local current-module = [ project.find "." : "." ] ;
538 current-project = [ project.target $(current-module) ] ;
542 # Load the default toolset module if no other has already been specified.
543 if ! [ feature.values <toolset> ]
545 local default-toolset = $(.default-toolset) ;
546 local default-toolset-version = ;
547 if $(default-toolset)
549 default-toolset-version = $(.default-toolset-version) ;
553 default-toolset = gcc ;
556 default-toolset = msvc ;
558 else if [ os.name ] = VMS
560 default-toolset = vmsdecc ;
562 else if [ os.name ] = MACOSX
564 default-toolset = darwin ;
568 ECHO "warning: No toolsets are configured." ;
569 ECHO "warning: Configuring default toolset" \"$(default-toolset)\". ;
570 ECHO "warning: If the default is wrong, your build may not work correctly." ;
571 ECHO "warning: Use the \"toolset=xxxxx\" option to override our guess." ;
572 ECHO "warning: For more configuration options, please consult" ;
573 ECHO "warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" ;
575 toolset.using $(default-toolset) : $(default-toolset-version) ;
579 # Parse command line for targets and properties. Note that this requires
580 # that all project files already be loaded.
581 # FIXME: This is not entirely true. Additional project files may be loaded
582 # only later via the project.find() rule when dereferencing encountered
583 # target ids containing explicit project references. See what to do about
584 # those as such 'lazy loading' may cause problems that are then extremely
585 # difficult to debug.
586 local build-request = [ build-request.from-command-line $(.argv)
587 $(extra-properties) ] ;
588 local target-ids = [ $(build-request).get-at 1 ] ;
589 local properties = [ $(build-request).get-at 2 ] ;
592 # Check that we actually found something to build.
593 if ! $(current-project) && ! $(target-ids)
596 errors.user-error no Jamfile "in" current directory found, and no target
597 references specified. ;
601 # Flags indicating that this build system run has been started in order to
602 # clean existing instead of create new targets. Note that these are not the
603 # final flag values as they may get changed later on due to some special
604 # targets being specified on the command line.
605 local clean ; if "--clean" in $(.argv) { clean = true ; }
606 local cleanall ; if "--clean-all" in $(.argv) { cleanall = true ; }
609 # List of explicitly requested files to build. Any target references read
610 # from the command line parameter not recognized as one of the targets
611 # defined in the loaded Jamfiles will be interpreted as an explicitly
612 # requested file to build. If any such files are explicitly requested then
613 # only those files and the targets they depend on will be built and they
614 # will be searched for among targets that would have been built had there
615 # been no explicitly requested files.
616 local explicitly-requested-files
619 # List of Boost Build meta-targets, virtual-targets and actual Jam targets
620 # constructed in this build system run.
622 local virtual-targets ;
623 local actual-targets ;
626 # Process each target specified on the command-line and convert it into
627 # internal Boost Build target objects. Detect special clean target. If no
628 # main Boost Build targets were explictly requested use the current project
630 for local id in $(target-ids)
639 if $(current-project)
641 t = [ $(current-project).find $(id) : no-error ] ;
645 t = [ find-target $(id) ] ;
650 ECHO "notice: could not find main target" $(id) ;
651 ECHO "notice: assuming it is a name of file to create." ;
652 explicitly-requested-files += $(id) ;
662 targets += [ project.target [ project.module-name "." ] ] ;
665 if [ option.get dump-generators : : true ]
670 # We wish to put config.log in the build directory corresponding to Jamroot,
671 # so that the location does not differ depending on the directory we run the
672 # build from. The amount of indirection necessary here is scary.
673 local first-project = [ $(targets[0]).project ] ;
674 local first-project-root-location = [ $(first-project).get project-root ] ;
675 local first-project-root-module = [ project.load
676 $(first-project-root-location) ] ;
677 local first-project-root = [ project.target $(first-project-root-module) ] ;
678 local first-build-build-dir = [ $(first-project-root).build-dir ] ;
679 configure.set-log-file $(first-build-build-dir)/config.log ;
680 config-cache.load $(first-build-build-dir)/project-cache.jam ;
682 # Expand properties specified on the command line into multiple property
683 # sets consisting of all legal property combinations. Each expanded property
684 # set will be used for a single build run. E.g. if multiple toolsets are
685 # specified then requested targets will be built with each of them.
686 # The expansion is being performed as late as possible so that the feature
687 # validation is performed after all necessary modules (including project targets
688 # on the command line) have been loaded.
691 expanded += [ build-request.convert-command-line-elements $(properties) ] ;
692 expanded = [ build-request.expand-no-defaults $(expanded) ] ;
694 for local e in $(expanded)
696 xexpanded += [ property-set.create [ feature.split $(e) ] ] ;
698 expanded = $(xexpanded) ;
702 expanded = [ property-set.empty ] ;
705 # Now that we have a set of targets to build and a set of property sets to
706 # build the targets with, we can start the main build process by using each
707 # property set to generate virtual targets from all of our listed targets
708 # and any of their dependants.
709 for local p in $(expanded)
711 .command-line-free-features = [ property-set.create [ $(p).free ] ] ;
712 for local t in $(targets)
714 local g = [ $(t).generate $(p) ] ;
715 if ! [ class.is-a $(t) : project-target ]
717 .results-of-main-targets += $(g[2-]) ;
719 virtual-targets += $(g[2-]) ;
724 # Convert collected virtual targets into actual raw Jam targets.
725 for t in $(virtual-targets)
727 actual-targets += [ $(t).actualize ] ;
733 # If XML data output has been requested prepare additional rules and targets
734 # so we can hook into Jam to collect build data while its building and have
735 # it trigger the final XML report generation after all the planned targets
739 # Get a qualified virtual target name.
740 rule full-target-name ( target )
742 local name = [ $(target).name ] ;
743 local project = [ $(target).project ] ;
744 local project-path = [ $(project).get location ] ;
745 return $(project-path)//$(name) ;
748 # Generate an XML file containing build statistics for each constituent.
750 rule out-xml ( xml-file : constituents * )
752 # Prepare valid XML header and footer with some basic info.
755 local os = [ modules.peek : OS OSPLAT JAMUNAME ] "" ;
756 local timestamp = [ modules.peek : JAMDATE ] ;
757 local cwd = [ PWD ] ;
758 local command = $(.argv) ;
759 local bb-version = [ version.boost-build ] ;
760 .header on $(xml-file) =
761 "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
762 "$(nl)<build format=\"1.0\" version=\"$(bb-version)\">"
763 "$(nl) <os name=\"$(os[1])\" platform=\"$(os[2])\"><![CDATA[$(os[3-]:J= )]]></os>"
764 "$(nl) <timestamp><![CDATA[$(timestamp)]]></timestamp>"
765 "$(nl) <directory><![CDATA[$(cwd)]]></directory>"
766 "$(nl) <command><![CDATA[\"$(command:J=\" \")\"]]></command>"
768 .footer on $(xml-file) =
771 # Generate the target dependency graph.
772 .contents on $(xml-file) +=
774 for local t in [ virtual-target.all-targets ]
776 local action = [ $(t).action ] ;
778 # If a target has no action, it has no dependencies.
780 local name = [ full-target-name $(t) ] ;
781 local sources = [ $(action).sources ] ;
783 for local s in $(sources)
785 dependencies += [ full-target-name $(s) ] ;
788 local path = [ $(t).path ] ;
789 local jam-target = [ $(t).actual-name ] ;
791 .contents on $(xml-file) +=
793 "$(nl) <name><![CDATA[$(name)]]></name>"
794 "$(nl) <dependencies>"
795 "$(nl) <dependency><![CDATA[$(dependencies)]]></dependency>"
796 "$(nl) </dependencies>"
797 "$(nl) <path><![CDATA[$(path)]]></path>"
798 "$(nl) <jam-target><![CDATA[$(jam-target)]]></jam-target>"
803 .contents on $(xml-file) +=
806 # Build $(xml-file) after $(constituents). Do so even if a
807 # constituent action fails and regenerate the xml on every bjam run.
808 INCLUDES $(xml-file) : $(constituents) ;
810 __ACTION_RULE__ on $(xml-file) =
811 build-system.out-xml.generate-action ;
812 out-xml.generate $(xml-file) ;
815 # The actual build actions are here; if we did this work in the actions
816 # clause we would have to form a valid command line containing the
817 # result of @(...) below (the name of the XML file).
819 rule out-xml.generate-action ( args * : xml-file
820 : command status start end user system : output ? )
823 [ on $(xml-file) return $(.header) $(.contents) $(.footer) ] ;
824 local f = @($(xml-file):E=$(contents)) ;
827 # Nothing to do here; the *real* actions happen in
828 # out-xml.generate-action.
829 actions quietly out-xml.generate { }
831 # Define the out-xml file target, which depends on all the targets so
832 # that it runs the collection after the targets have run.
833 out-xml $(.out-xml) : $(actual-targets) ;
835 # Set up a global __ACTION_RULE__ that records all the available
836 # statistics about each actual target in a variable "on" the --out-xml
839 rule out-xml.collect ( xml-file : target : command status start end user
844 # Open the action with some basic info.
845 .contents on $(xml-file) +=
846 "$(nl) <action status=\"$(status)\" start=\"$(start)\" end=\"$(end)\" user=\"$(user)\" system=\"$(system)\">" ;
848 # If we have an action object we can print out more detailed info.
849 local action = [ on $(target) return $(.action) ] ;
852 local action-name = [ $(action).action-name ] ;
853 local action-sources = [ $(action).sources ] ;
854 local action-props = [ $(action).properties ] ;
856 # The qualified name of the action which we created the target.
857 .contents on $(xml-file) +=
858 "$(nl) <name><![CDATA[$(action-name)]]></name>" ;
860 # The sources that made up the target.
861 .contents on $(xml-file) +=
863 for local source in $(action-sources)
865 local source-actual = [ $(source).actual-name ] ;
866 .contents on $(xml-file) +=
867 "$(nl) <source><![CDATA[$(source-actual)]]></source>" ;
869 .contents on $(xml-file) +=
872 # The properties that define the conditions under which the
874 .contents on $(xml-file) +=
875 "$(nl) <properties>" ;
876 for local prop in [ $(action-props).raw ]
878 local prop-name = [ MATCH ^<(.*)>$ : $(prop:G) ] ;
879 .contents on $(xml-file) +=
880 "$(nl) <property name=\"$(prop-name)\"><![CDATA[$(prop:G=)]]></property>" ;
882 .contents on $(xml-file) +=
883 "$(nl) </properties>" ;
886 local locate = [ on $(target) return $(LOCATE) ] ;
888 .contents on $(xml-file) +=
889 "$(nl) <jam-target><![CDATA[$(target)]]></jam-target>"
890 "$(nl) <path><![CDATA[$(target:G=:R=$(locate))]]></path>"
891 "$(nl) <command><![CDATA[$(command)]]></command>"
892 "$(nl) <output><![CDATA[$(output)]]></output>" ;
893 .contents on $(xml-file) +=
897 # When no __ACTION_RULE__ is set "on" a target, the search falls back to
901 __ACTION_RULE__ = build-system.out-xml.collect
902 [ modules.peek build-system : .out-xml ] ;
908 out-xml.generate-action
910 build-system.out-xml.collect
911 build-system.out-xml.generate-action
915 local j = [ option.get jobs ] ;
918 modules.poke : PARALLELISM : $(j) ;
921 local k = [ option.get keep-going : true : true ] ;
922 if $(k) in "on" "yes" "true"
924 modules.poke : KEEP_GOING : 1 ;
926 else if $(k) in "off" "no" "false"
928 modules.poke : KEEP_GOING : 0 ;
932 EXIT "error: Invalid value for the --keep-going option" ;
935 # The 'all' pseudo target is not strictly needed expect in the case when we
936 # use it below but people often assume they always have this target
937 # available and do not declare it themselves before use which may cause
938 # build failures with an error message about not being able to build the
942 # And now that all the actual raw Jam targets and all the dependencies
943 # between them have been prepared all that is left is to tell Jam to update
945 if $(explicitly-requested-files)
947 # Note that this case can not be joined with the regular one when only
948 # exact Boost Build targets are requested as here we do not build those
949 # requested targets but only use them to construct the dependency tree
950 # needed to build the explicitly requested files.
951 UPDATE $(explicitly-requested-files:G=e) $(.out-xml) ;
959 common.Clean clean : [ actual-clean-targets ] ;
964 configure.print-configure-checks-summary ;
966 if $(.pre-build-hook)
971 DEPENDS all : $(actual-targets) ;
972 if UPDATE_NOW in [ RULENAMES ]
974 local ok = [ UPDATE_NOW all ] ;
975 # Force sequence updating of regular targets, then the xml
976 # log output target. To ensure the output records all built
977 # as otherwise if could execute out-of-sequence when
978 # doing parallel builds.
981 UPDATE_NOW $(.out-xml) : : ignore-minus-n ;
983 if $(.post-build-hook)
985 $(.post-build-hook) $(ok) ;
987 # Prevent automatic update of the 'all' target, now that we have
988 # explicitly updated what we wanted.
993 UPDATE all $(.out-xml) ;