aboutsummaryrefslogtreecommitdiff
path: root/src/rule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.cpp')
-rw-r--r--src/rule.cpp37
1 files changed, 29 insertions, 8 deletions
diff --git a/src/rule.cpp b/src/rule.cpp
index a7ebf9b..a240855 100644
--- a/src/rule.cpp
+++ b/src/rule.cpp
@@ -2,8 +2,7 @@
2#include "builder.h" // for BuildException 2#include "builder.h" // for BuildException
3 3
4Rule::Rule( const char *sName ) : 4Rule::Rule( const char *sName ) :
5 sName( sName ), 5 sName( sName )
6 sProduces("{target}")
7{ 6{
8} 7}
9 8
@@ -14,11 +13,23 @@ Rule::~Rule()
14 13
15void Rule::debug() 14void Rule::debug()
16{ 15{
17 printf(" Rule %s produces %s:\n", 16 printf(" Rule %s:\n",
18 sName.getString(), 17 sName.getString()
19 sProduces.getString()
20 ); 18 );
21 printf(" Matches "); 19 printf(" Produces: ");
20 if( lProduces.empty() )
21 printf("{target}");
22 else
23 {
24 for( std::list<std::string>::iterator i = lProduces.begin();
25 i != lProduces.end(); i++ )
26 {
27 if( i != lProduces.begin() )
28 printf(", ");
29 printf("%s", (*i).c_str() );
30 }
31 }
32 printf("\n Matches ");
22 if( mHow == matchOne ) 33 if( mHow == matchOne )
23 printf("one "); 34 printf("one ");
24 else if( mHow == matchAll ) 35 else if( mHow == matchAll )
@@ -31,9 +42,9 @@ void Rule::debug()
31 printf("\"%s\"\n", sPerfCmd.getString() ); 42 printf("\"%s\"\n", sPerfCmd.getString() );
32} 43}
33 44
34void Rule::setProduces( const char *sP ) 45void Rule::addProduces( const char *sP )
35{ 46{
36 sProduces = sP; 47 lProduces.push_back( sP );
37} 48}
38 49
39void Rule::setMatches( Matches how, const char *sW ) 50void Rule::setMatches( Matches how, const char *sW )
@@ -59,3 +70,13 @@ void Rule::setPerforms( Perform pwhat, const char *sperfcmd )
59 sPerfCmd = sperfcmd; 70 sPerfCmd = sperfcmd;
60} 71}
61 72
73std::list<std::string> Rule::execute( Builder &bld, std::list<std::string> lInput )
74{
75 std::list<Rule *> lRule = bld.findRuleChain( this );
76
77 std::list<std::string> ret;
78
79 return ret;
80
81}
82