1 # Copyright 2002, 2003, 2004, 2005 Dave Abrahams
2 # Copyright 2002, 2005, 2006, 2007, 2010 Rene Rivera
3 # Copyright 2006 Juergen Hunold
4 # Copyright 2005 Toon Knapen
5 # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
6 # Distributed under the Boost Software License, Version 1.0.
7 # (See accompanying file LICENSE_1_0.txt or copy at
8 # http://www.boost.org/LICENSE_1_0.txt)
10 # Defines standard features and rules.
13 import "class" : new ;
16 import features/__init_features__ ;
32 import types/register ;
34 import virtual-target ;
38 # Generators need the target types registered first. So this import needs
40 import generators/__init_generators__ ;
42 # FIXME: the following generate module import is not needed here but removing it
43 # too hastily will break using code (e.g. the main Boost library Jamroot file)
44 # that forgot to import the generate module before calling the generate rule.
48 variant debug : <optimization>off <debug-symbols>on <inlining>off
49 <runtime-debugging>on ;
50 variant release : <optimization>speed <debug-symbols>off <inlining>full
51 <runtime-debugging>off <define>NDEBUG ;
52 variant profile : release : <profiling>on <debug-symbols>on ;
55 class preprocessed-target-class : basic-target
58 rule construct ( name : sources * : property-set )
60 local result = [ generators.construct [ project ]
61 $(name) : PREPROCESSED_CPP : $(property-set) : $(sources) ] ;
64 result = [ generators.construct [ project ]
65 $(name) : PREPROCESSED_C : $(property-set) : $(sources) ] ;
74 local p = [ project ] ;
76 "In project" [ $(p).name ] :
77 "Could not construct preprocessed file \"$(name)\" from $(s:J=, )." ;
83 rule preprocessed ( name : sources * : requirements * : default-build * :
84 usage-requirements * )
86 local project = [ project.current ] ;
87 return [ targets.main-target-alternative
88 [ new preprocessed-target-class $(name) : $(project)
89 : [ targets.main-target-sources $(sources) : $(name) ]
90 : [ targets.main-target-requirements $(requirements) : $(project) ]
91 : [ targets.main-target-default-build $(default-build) : $(project) ]
92 : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
96 IMPORT $(__name__) : preprocessed : : preprocessed ;