Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/tools/notfile.jam @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 1.9 KB
Line 
1#  Copyright (c) 2005 Vladimir Prus.
2#
3#  Use, modification and distribution is subject to the Boost Software
4#  License Version 1.0. (See accompanying file LICENSE_1_0.txt or
5#  http://www.boost.org/LICENSE_1_0.txt)
6
7import generators ;
8import type ;
9import feature ;
10import project ;
11import targets ;
12import toolset ;
13import "class" : new ;
14
15feature.feature action : : free ;
16type.register NOTFILE_MAIN ;
17
18
19
20class notfile-generator : generator
21{
22    rule __init__ ( * : * )
23    {
24        generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
25    }
26   
27    rule run ( project name ? : property-set : sources * : multiple ? )
28    {
29        local action ;
30        local action-name = [ $(property-set).get <action> ] ;
31       
32        local m = [ MATCH ^@(.*) : $(action-name) ] ;
33       
34        if $(m)       
35        {
36            action = [ new action $(sources) : $(m[1])
37              : $(property-set) ] ;               
38        }
39        else
40        {
41            action = [ new action $(sources) : notfile.run
42              : $(property-set) ] ;             
43        }               
44        return [ new notfile-target $(name) : $(project) : $(action) ] ;
45    }       
46}
47
48generators.register [ new notfile-generator notfile.main : : NOTFILE_MAIN ] ;
49
50toolset.flags notfile.run ACTION : <action> ;
51actions run
52{
53    $(ACTION)
54}
55
56
57rule notfile ( target-name : action + : sources * : requirements * : default-build * )
58{
59  local project = [ project.current ] ;
60   
61  requirements += <action>$(action) ;
62   
63  targets.main-target-alternative
64    [ new typed-target $(target-name) : $(project) : NOTFILE_MAIN
65        : [ targets.main-target-sources $(sources) : $(target-name) ]
66        : [ targets.main-target-requirements $(requirements) : $(project) ]
67        : [ targets.main-target-default-build $(default-build) : $(project) ]
68    ] ;
69}
70
71IMPORT $(__name__) : notfile : : notfile ;
72
73
Note: See TracBrowser for help on using the repository browser.