diff options
Diffstat (limited to 'src/build.cpp')
-rw-r--r-- | src/build.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/build.cpp b/src/build.cpp index 03d3c5a..bf867af 100644 --- a/src/build.cpp +++ b/src/build.cpp | |||
@@ -11,6 +11,14 @@ Build::~Build() | |||
11 | { | 11 | { |
12 | } | 12 | } |
13 | 13 | ||
14 | void Build::execAction( const std::string &sWhat ) | ||
15 | { | ||
16 | if( mAction.find( sWhat ) == mAction.end() ) | ||
17 | throw BuildException("No action matches %s.", sWhat.c_str() ); | ||
18 | |||
19 | return; | ||
20 | } | ||
21 | |||
14 | void Build::addTarget( Target *pTarget ) | 22 | void Build::addTarget( Target *pTarget ) |
15 | { | 23 | { |
16 | TargetMap::iterator i = mTarget.find( pTarget->getName() ); | 24 | TargetMap::iterator i = mTarget.find( pTarget->getName() ); |
@@ -34,6 +42,11 @@ void Build::addRule( Rule *pRule ) | |||
34 | mRule[pRule->getName()] = pRule; | 42 | mRule[pRule->getName()] = pRule; |
35 | } | 43 | } |
36 | 44 | ||
45 | void Build::addAction( Action *pAction ) | ||
46 | { | ||
47 | mAction[pAction->getName()] = pAction; | ||
48 | } | ||
49 | |||
37 | void Build::set( const std::string &cont, const std::string &var, const std::string &val ) | 50 | void Build::set( const std::string &cont, const std::string &var, const std::string &val ) |
38 | { | 51 | { |
39 | if( cont == "" ) | 52 | if( cont == "" ) |
@@ -149,5 +162,16 @@ void Build::debugDump() | |||
149 | printf(" Produces:\n"); | 162 | printf(" Produces:\n"); |
150 | printf(" Requires:\n"); | 163 | printf(" Requires:\n"); |
151 | } | 164 | } |
165 | |||
166 | printf("Actions:\n"); | ||
167 | for( ActionMap::iterator i = mAction.begin(); i != mAction.end(); i++ ) | ||
168 | { | ||
169 | printf(" %s: ", (*i).first.c_str() ); | ||
170 | for( (*i).second->begin(); !(*i).second->isEnded(); (*i).second->next() ) | ||
171 | { | ||
172 | printf("%d:%s ", (*i).second->getAct(), (*i).second->getWhat().c_str() ); | ||
173 | } | ||
174 | printf("\n"); | ||
175 | } | ||
152 | } | 176 | } |
153 | 177 | ||