From b792e9f4b32013c258fd78bc3271dd6730fccda3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 23 Nov 2006 14:31:22 +0000 Subject: Minor tweak keeps the same old behavior for check, but makes clean remove everything in the produces list. --- src/rule.cpp | 12 +++++++----- src/rule.h | 2 +- src/targetfile.cpp | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rule.cpp b/src/rule.cpp index 61ea632..2f87d85 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -12,7 +12,7 @@ Rule::~Rule() { } -StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) +StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf, bool bFirstOnly ) { StringList lOutput; @@ -21,7 +21,7 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) for( RuleList::iterator i = rl.begin(); i != rl.end(); i++ ) { (*i)->setTarget( sTarget ); - StringList tmp = (*i)->execute( bld, lInput, lPerf ); + StringList tmp = (*i)->execute( bld, lInput, lPerf, bFirstOnly ); lOutput.insert( lOutput.end(), tmp.begin(), tmp.end() ); } @@ -84,9 +84,9 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) { for( StringList::iterator i = lMine.begin(); i != lMine.end(); i++ ) { - //for( StringList::iterator j = lProduces.begin(); - // j != lProduces.end(); j++ ) - StringList::iterator j = lProduces.begin(); + for( StringList::iterator j = lProduces.begin(); + j != lProduces.end(); j++ ) + //StringList::iterator j = lProduces.begin(); { VarMap mTmp; StringList cont; @@ -121,6 +121,8 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) } lPerf.push_back( p ); } + if( bFirstOnly ) + break; } } } diff --git a/src/rule.h b/src/rule.h index 98c95a6..c6e8336 100644 --- a/src/rule.h +++ b/src/rule.h @@ -19,7 +19,7 @@ public: Rule(); virtual ~Rule(); - StringList execute( Build &bld, StringList &lInput, PerformList &lPerf ); + StringList execute( Build &bld, StringList &lInput, PerformList &lPerf, bool bFirstOnly=true ); void setTarget( const std::string &sTarget ) { diff --git a/src/targetfile.cpp b/src/targetfile.cpp index 1a73cc6..4cf5361 100644 --- a/src/targetfile.cpp +++ b/src/targetfile.cpp @@ -86,7 +86,7 @@ void TargetFile::clean( Build &bld ) Rule *pRule = bld.getRule( getRule() ); PerformList lPerf; pRule->setTarget( getName() ); - StringList lFinal = pRule->execute( bld, getInput(), lPerf ); + StringList lFinal = pRule->execute( bld, getInput(), lPerf, false ); bld.getView()->beginPerforms( lPerf.size() ); @@ -99,7 +99,6 @@ void TargetFile::clean( Build &bld ) unlink( (*i)->getTarget().c_str() ); bld.getView()->endPerform(); } - } bld.getView()->endPerforms(); -- cgit v1.2.3