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 |
---|
9 | if $(NT) |
---|
10 | { |
---|
11 | CATENATE = type ; |
---|
12 | } |
---|
13 | else |
---|
14 | { |
---|
15 | CATENATE = cat ; |
---|
16 | } |
---|
17 | |
---|
18 | # invoke the given action rule `act' to build target from sources |
---|
19 | rule 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 |
---|
27 | rule make ( target : sources * : act ) |
---|
28 | { |
---|
29 | DEPENDS all : $(target) ; |
---|
30 | do-make $(target) : $(sources) : $(act) ; |
---|
31 | } |
---|
32 | |
---|
33 | X1 = X1-global ; |
---|
34 | X2 = X2-global ; |
---|
35 | X3 = X3-global ; |
---|
36 | |
---|
37 | module 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 | |
---|
54 | module 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 | |
---|
65 | actions act { echo act $(<): $(X1) $(X2) $(X3) } |
---|
66 | |
---|
67 | make t1 : : act ; |
---|
68 | make t2 : : act ; |
---|
69 | make t3 : : act ; |
---|
70 | |
---|
71 | X1 on t1 = X1-t1 ; |
---|
72 | X2 on t2 = X2-t2 ; |
---|
73 | X3 on t3 = X3-t3 ; |
---|
74 | |
---|
75 | DEPENDS all : t1 t2 t3 ; |
---|
Note: See
TracBrowser
for help on using the repository browser.