Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/module-actions/bootstrap.jam @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.4 KB
Line 
1# Copyright 2003 Dave Abrahams
2# Copyright 2006 Rene Rivera
3# Distributed under the Boost Software License, Version 1.0.
4# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
5
6# Demonstration that module variables have the right effect in actions
7
8# Set a variable which says how to dump a file to stdout
9if $(NT)
10{
11    CATENATE = type ;
12}
13else
14{
15    CATENATE = cat ;
16}
17
18# invoke the given action rule `act' to build target from sources
19rule do-make ( target : sources * : act )
20{
21    DEPENDS $(target) : $(sources) ;
22    $(act) $(target) : $(sources) ;
23}
24
25# top-level version of do-make which causes target to be built by
26# default
27rule make ( target : sources * : act )
28{
29    DEPENDS all : $(target) ;
30    do-make $(target) : $(sources) : $(act) ;
31}
32
33X1 = X1-global ;
34X2 = X2-global ;
35X3 = X3-global ;
36
37module A
38{
39    X1 = X1-A ;
40   
41    rule act ( target )
42    {
43        NOTFILE $(target) ;
44        ALWAYS $(target) ;
45    }
46   
47    actions act { echo A.act $(<): $(X1) $(X2) $(X3) }
48   
49    make t1 : : A.act ;
50    make t2 : : A.act ;
51    make t3 : : A.act ;
52}
53
54module B
55{
56    X2 = X2-B ;
57   
58    actions act { echo B.act $(<): $(X1) $(X2) $(X3) }
59   
60    make t1 : : B.act ;
61    make t2 : : B.act ;
62    make t3 : : B.act ;
63}
64
65actions act { echo act $(<): $(X1) $(X2) $(X3) }
66
67make t1 : : act ;
68make t2 : : act ;
69make t3 : : act ;
70
71X1 on t1 = X1-t1 ;
72X2 on t2 = X2-t2 ;
73X3 on t3 = X3-t3 ;
74
75DEPENDS all : t1 t2 t3 ;
Note: See TracBrowser for help on using the repository browser.