2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00
Files
build/new/build-system.jam
2003-01-23 11:22:47 +00:00

153 lines
2.9 KiB
Plaintext

# (C) Copyright David Abrahams 2001. 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.
import project ;
import sequence ;
import modules ;
import feature ;
import build-request ;
import errors : error ;
import builtin ;
import make ;
import os ;
import version ;
if ! --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 --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.
project.load "." ;
if [ MATCH (--dump-projects) : [ modules.peek : ARGV ] ]
{
project-root.print ;
}
build-request = [ build-request.from-command-line [ modules.peek : ARGV ] ] ;
properties = [ $(build-request).get-at 2 ] ;
if $(properties)
{
expanded = [ build-request.expand $(properties) ] ;
}
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 = [ project.find-target $(id) : "." ] ;
if ! $(t)
{
error target $(id) does not exist ;
}
else
{
targets += $(t) ;
}
}
}
if ! $(targets)
{
targets += [ project.target "." ] ;
}
virtual-targets = ;
if $(expanded)
{
for local p in $(expanded)
{
for local t in $(targets)
{
$(t).direct-build-request [ feature.split $(p) ] ;
}
}
for local p in $(expanded)
{
for local t in $(targets)
{
virtual-targets += [ $(t).generate [ feature.split $(p) ] ] ;
}
}
}
else
{
for local t in $(targets)
{
virtual-targets += [ $(t).generate ] ;
}
}
actual-targets = ;
for t in $(virtual-targets)
{
actual-targets += [ $(t).actualize ] ;
}
NOTFILE all ;
DEPENDS all : $(actual-targets) ;
if $(clean)
{
UPDATE clean ;
}
else
{
UPDATE all ;
}