mirror of
https://github.com/boostorg/build.git
synced 2026-02-02 20:52:13 +00:00
185 lines
3.8 KiB
Plaintext
Executable File
185 lines
3.8 KiB
Plaintext
Executable File
# (C) Copyright David Abrahams 2001-2003. Permission to copy, use,
|
|
# modify, sell and distribute this software is granted provided this
|
|
# copyright notice appears in all copies. This software is provided
|
|
# "as is" without express or implied warranty, and with no claim as
|
|
# to its suitability for any purpose.
|
|
|
|
# This file is part of Boost.Build version 2. You can think of it as
|
|
# forming the main() routine. It is invoked by the bootstrapping code
|
|
# in bootstrap.jam.
|
|
#
|
|
# The version of bootstrap.jam invoking this lives in
|
|
# tools/build/kernel until BBv1 is retired, so that BBv1 can have its
|
|
# bootstrap.jam in this directory.
|
|
|
|
import project ;
|
|
import targets ;
|
|
import sequence ;
|
|
import modules ;
|
|
import feature ;
|
|
import property-set ;
|
|
import build-request ;
|
|
import errors : error ;
|
|
import "class" : new ;
|
|
|
|
import builtin ;
|
|
import make ;
|
|
import os ;
|
|
|
|
import version ;
|
|
|
|
# Check if we can load 'test-config.jam'. If we can, load it and
|
|
# ignore user configs.
|
|
local test-config = [ GLOB [ modules.peek : BOOST_BUILD_PATH ] : test-config.jam ] ;
|
|
if $(test-config)
|
|
{
|
|
import test-config ;
|
|
}
|
|
|
|
if ! $(test-config) && ! --ignore-config in [ modules.peek : ARGV ]
|
|
{
|
|
module site-config
|
|
{
|
|
import toolset : using ;
|
|
}
|
|
|
|
module user-config
|
|
{
|
|
import toolset : using ;
|
|
}
|
|
|
|
local user-path = [ modules.peek : HOME ] [ modules.peek : BOOST_BUILD_PATH ] ;
|
|
if [ os.name ] in NT CYGWIN
|
|
{
|
|
modules.load site-config : : [ modules.peek : SystemRoot ] $(user-path) ;
|
|
modules.load user-config : : $(user-path) ;
|
|
}
|
|
else
|
|
{
|
|
modules.load site-config : : /etc $(user-path) ;
|
|
modules.load user-config : : $(user-path) ;
|
|
}
|
|
}
|
|
|
|
if USER_MODULE in [ RULENAMES ]
|
|
{
|
|
USER_MODULE site-config user-config ;
|
|
}
|
|
|
|
|
|
|
|
if --version in [ modules.peek : ARGV ]
|
|
{
|
|
version.print ;
|
|
EXIT ;
|
|
}
|
|
|
|
# We always load project in "." so that 'use-project' directives has
|
|
# any chance of been seen. Otherwise, we won't be able to refer to
|
|
# subprojects using target ids.
|
|
current-project = [ project.target [ project.load "." ] ] ;
|
|
|
|
if ! [ feature.values <toolset> ]
|
|
{
|
|
ECHO "warning: no toolsets are configured." ;
|
|
ECHO "warning: you won't be able to build C++ programs." ;
|
|
ECHO "warning: please consult the documentation." ;
|
|
ECHO ;
|
|
}
|
|
|
|
|
|
|
|
build-request = [ build-request.from-command-line [ modules.peek : ARGV ] ] ;
|
|
|
|
properties = [ $(build-request).get-at 2 ] ;
|
|
|
|
if $(properties)
|
|
{
|
|
expanded = [ build-request.expand-no-defaults $(properties) ] ;
|
|
local xexpanded ;
|
|
for local e in $(expanded)
|
|
{
|
|
xexpanded += [ property-set.create [ feature.split $(e) ] ] ;
|
|
}
|
|
expanded = $(xexpanded) ;
|
|
}
|
|
|
|
|
|
local target-ids = [ $(build-request).get-at 1 ] ;
|
|
local targets
|
|
local clean ;
|
|
|
|
|
|
if "--clean" in [ modules.peek : ARGV ]
|
|
{
|
|
clean = true ;
|
|
}
|
|
|
|
for local id in $(target-ids)
|
|
{
|
|
if $(id) = clean
|
|
{
|
|
clean = true ;
|
|
}
|
|
else
|
|
{
|
|
local t = [ $(current-project).find $(id) ] ;
|
|
if ! $(t)
|
|
{
|
|
error target $(id) does not exist ;
|
|
}
|
|
else
|
|
{
|
|
targets += $(t) ;
|
|
}
|
|
}
|
|
}
|
|
|
|
if ! $(targets)
|
|
{
|
|
targets += [ project.target [ project.module-name "." ] ] ;
|
|
}
|
|
|
|
virtual-targets = ;
|
|
|
|
if $(expanded)
|
|
{
|
|
for local p in $(expanded)
|
|
{
|
|
for local t in $(targets)
|
|
{
|
|
local g = [ $(t).generate $(p) ] ;
|
|
virtual-targets += $(g[2-]) ;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for local t in $(targets)
|
|
{
|
|
local g = [ $(t).generate [ property-set.empty ] ] ;
|
|
virtual-targets += $(g[2-]) ;
|
|
}
|
|
}
|
|
|
|
|
|
actual-targets = ;
|
|
for t in $(virtual-targets)
|
|
{
|
|
actual-targets += [ $(t).actualize ] ;
|
|
}
|
|
NOTFILE all ;
|
|
DEPENDS all : $(actual-targets) ;
|
|
|
|
if $(clean)
|
|
{
|
|
UPDATE clean ;
|
|
}
|
|
else
|
|
{
|
|
UPDATE all ;
|
|
}
|
|
|
|
|
|
|