diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2006-11-23 14:31:22 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2006-11-23 14:31:22 +0000 |
| commit | b792e9f4b32013c258fd78bc3271dd6730fccda3 (patch) | |
| tree | a5b68f9ee9adf15c8b604eb206ef1baf80e03fca | |
| parent | 9868a2005820a4291f97b3080168af39b429a03c (diff) | |
| download | build-b792e9f4b32013c258fd78bc3271dd6730fccda3.tar.gz build-b792e9f4b32013c258fd78bc3271dd6730fccda3.tar.bz2 build-b792e9f4b32013c258fd78bc3271dd6730fccda3.tar.xz build-b792e9f4b32013c258fd78bc3271dd6730fccda3.zip | |
Minor tweak keeps the same old behavior for check, but makes clean remove
everything in the produces list.
| -rw-r--r-- | src/rule.cpp | 12 | ||||
| -rw-r--r-- | src/rule.h | 2 | ||||
| -rw-r--r-- | src/targetfile.cpp | 3 |
3 files changed, 9 insertions, 8 deletions
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() | |||
| 12 | { | 12 | { |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) | 15 | StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf, bool bFirstOnly ) |
| 16 | { | 16 | { |
| 17 | StringList lOutput; | 17 | StringList lOutput; |
| 18 | 18 | ||
| @@ -21,7 +21,7 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) | |||
| 21 | for( RuleList::iterator i = rl.begin(); i != rl.end(); i++ ) | 21 | for( RuleList::iterator i = rl.begin(); i != rl.end(); i++ ) |
| 22 | { | 22 | { |
| 23 | (*i)->setTarget( sTarget ); | 23 | (*i)->setTarget( sTarget ); |
| 24 | StringList tmp = (*i)->execute( bld, lInput, lPerf ); | 24 | StringList tmp = (*i)->execute( bld, lInput, lPerf, bFirstOnly ); |
| 25 | lOutput.insert( lOutput.end(), tmp.begin(), tmp.end() ); | 25 | lOutput.insert( lOutput.end(), tmp.begin(), tmp.end() ); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| @@ -84,9 +84,9 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) | |||
| 84 | { | 84 | { |
| 85 | for( StringList::iterator i = lMine.begin(); i != lMine.end(); i++ ) | 85 | for( StringList::iterator i = lMine.begin(); i != lMine.end(); i++ ) |
| 86 | { | 86 | { |
| 87 | //for( StringList::iterator j = lProduces.begin(); | 87 | for( StringList::iterator j = lProduces.begin(); |
| 88 | // j != lProduces.end(); j++ ) | 88 | j != lProduces.end(); j++ ) |
| 89 | StringList::iterator j = lProduces.begin(); | 89 | //StringList::iterator j = lProduces.begin(); |
| 90 | { | 90 | { |
| 91 | VarMap mTmp; | 91 | VarMap mTmp; |
| 92 | StringList cont; | 92 | StringList cont; |
| @@ -121,6 +121,8 @@ StringList Rule::execute( Build &bld, StringList &lInput, PerformList &lPerf ) | |||
| 121 | } | 121 | } |
| 122 | lPerf.push_back( p ); | 122 | lPerf.push_back( p ); |
| 123 | } | 123 | } |
| 124 | if( bFirstOnly ) | ||
| 125 | break; | ||
| 124 | } | 126 | } |
| 125 | } | 127 | } |
| 126 | } | 128 | } |
| @@ -19,7 +19,7 @@ public: | |||
| 19 | Rule(); | 19 | Rule(); |
| 20 | virtual ~Rule(); | 20 | virtual ~Rule(); |
| 21 | 21 | ||
| 22 | StringList execute( Build &bld, StringList &lInput, PerformList &lPerf ); | 22 | StringList execute( Build &bld, StringList &lInput, PerformList &lPerf, bool bFirstOnly=true ); |
| 23 | 23 | ||
| 24 | void setTarget( const std::string &sTarget ) | 24 | void setTarget( const std::string &sTarget ) |
| 25 | { | 25 | { |
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 ) | |||
| 86 | Rule *pRule = bld.getRule( getRule() ); | 86 | Rule *pRule = bld.getRule( getRule() ); |
| 87 | PerformList lPerf; | 87 | PerformList lPerf; |
| 88 | pRule->setTarget( getName() ); | 88 | pRule->setTarget( getName() ); |
| 89 | StringList lFinal = pRule->execute( bld, getInput(), lPerf ); | 89 | StringList lFinal = pRule->execute( bld, getInput(), lPerf, false ); |
| 90 | 90 | ||
| 91 | bld.getView()->beginPerforms( lPerf.size() ); | 91 | bld.getView()->beginPerforms( lPerf.size() ); |
| 92 | 92 | ||
| @@ -99,7 +99,6 @@ void TargetFile::clean( Build &bld ) | |||
| 99 | unlink( (*i)->getTarget().c_str() ); | 99 | unlink( (*i)->getTarget().c_str() ); |
| 100 | bld.getView()->endPerform(); | 100 | bld.getView()->endPerform(); |
| 101 | } | 101 | } |
| 102 | |||
| 103 | } | 102 | } |
| 104 | 103 | ||
| 105 | bld.getView()->endPerforms(); | 104 | bld.getView()->endPerforms(); |
