aboutsummaryrefslogtreecommitdiff
path: root/src/buildparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildparser.cpp')
-rw-r--r--src/buildparser.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/buildparser.cpp b/src/buildparser.cpp
index 6c3337f..04147d8 100644
--- a/src/buildparser.cpp
+++ b/src/buildparser.cpp
@@ -129,7 +129,7 @@ void BuildParser::filterList()
129 } 129 }
130} 130}
131 131
132StringList BuildParser::buildToStringList( const BuildList &lSrc, const StringList &lIn ) 132StringList BuildParser::buildToStringList( const BuildList &lSrc, const StringList &lIn, Build *pPass )
133{ 133{
134 StringList lOut; 134 StringList lOut;
135 135
@@ -137,7 +137,28 @@ StringList BuildParser::buildToStringList( const BuildList &lSrc, const StringLi
137 { 137 {
138 if( (*i).second ) 138 if( (*i).second )
139 { 139 {
140 (*i).second->execute( NULL, lIn, lOut ); 140 (*i).second->execute( pPass, lIn, lOut );
141 }
142 else
143 {
144 lOut.push_back( (*i).first );
145 }
146 }
147
148 return lOut;
149}
150
151StringList BuildParser::buildToStringListDup( const BuildList &lSrc, const StringList &lIn, Build &bld, const std::string &sCont, VarMap *mExtra, Build *pPass )
152{
153 StringList lOut;
154
155 for( BuildList::const_iterator i = lSrc.begin(); i != lSrc.end(); i++ )
156 {
157 if( (*i).second )
158 {
159 Function *pTmp = (*i).second->duplicate( bld, sCont, mExtra );
160 pTmp->execute( pPass, lIn, lOut );
161 delete pTmp;
141 } 162 }
142 else 163 else
143 { 164 {
@@ -384,8 +405,12 @@ Build *BuildParser::genBuild()
384 pTarget->setName( *j ); 405 pTarget->setName( *j );
385 pTarget->setRule( (*i).second.sRule ); 406 pTarget->setRule( (*i).second.sRule );
386 407
387 StringList lInputs = buildToStringList( 408 VarMap mExtra;
388 (*i).second.lInput, StringList() 409 mExtra["target"] = (*j);
410
411 StringList lInputs = buildToStringListDup(
412 (*i).second.lInput, StringList(),
413 *bld, *j, &mExtra
389 ); 414 );
390 pTarget->getInput().insert( 415 pTarget->getInput().insert(
391 pTarget->getInput().end(), 416 pTarget->getInput().end(),
@@ -480,7 +505,7 @@ Build *BuildParser::genBuild()
480 j != (*i).second.end(); j++ ) 505 j != (*i).second.end(); j++ )
481 { 506 {
482 StringList lWhat = buildToStringList( 507 StringList lWhat = buildToStringList(
483 (*j).second, StringList() 508 (*j).second, StringList(), bld
484 ); 509 );
485 510
486 for( StringList::iterator k = lWhat.begin(); 511 for( StringList::iterator k = lWhat.begin();