Imported Upstream version 1.51.0
[platform/upstream/boost.git] / tools / build / v2 / test / unused / jamroot.jam
1 # Copyright 2003 Vladimir Prus 
2 # Distributed under the Boost Software License, Version 1.0. 
3 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 
4
5
6 import type ;
7 import generators ;
8 import print ;
9 import virtual-target ;
10 import "class" : new ;
11 import modules ;
12 import targets ;
13 import project ;
14
15
16 type.register X : x ;
17
18 class test-target-class : basic-target
19 {
20     rule __init__ ( name : project )
21     {
22         basic-target.__init__ $(name) : $(project) ;
23     }
24         
25     rule construct ( name : source-targets * : property-set )
26     {
27         if [ modules.peek : GENERATE_NOTHING ]
28         {
29             return [ property-set.empty ] ;
30         }
31         else if [ modules.peek : GENERATE_ONLY_UNUSABLE ] 
32         {
33             return [ property-set.empty ]
34               [ virtual-target.from-file b.x : . : $(self.project) ] 
35               ;             
36         }
37         else
38         {            
39             return [ property-set.empty ]
40               [ virtual-target.from-file b.x : . : $(self.project) ] 
41               [ virtual-target.from-file b.cpp : . : $(self.project) ] 
42                 ; 
43         }        
44     }
45     
46     rule compute-usage-requirements ( rproperties : targets * )
47     {
48         return [ property-set.create <define>FOO ] ;
49     }
50 }
51
52 rule make-b-main-target
53 {
54     local project = [ project.current ] ;    
55     
56     targets.main-target-alternative 
57       [ new test-target-class b : $(project) ] ;
58 }
59
60 IMPORT $(__name__) : make-b-main-target : : make-b-main-target ;