From 5a32418a040e967887aa6e01e41abc22932471db Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 14 Sep 2006 23:59:39 +0000 Subject: Made more changes, this one has a little extra debug, get the next one. --- src/main.cpp | 16 +++++++++++++++- src/rule.cpp | 5 +++-- src/targetfile.cpp | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 03004fc..1576b0c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,7 @@ public: sFile("build.conf"), sCache(".build.cache"), bDebug( false ), + bPostDebug( false ), sView("plain") { addHelpBanner("Build r?\n\n"); @@ -25,7 +26,9 @@ public: addParam("cache", &sCache, "Set an alternative cache file." ); addParam('d', &bDebug, - "Print out a debug dump of the build.conf", NULL, "true" ); + "Display debug info instead of building", NULL, "true" ); + addParam('D', &bPostDebug, + "Display debug info after building", NULL, "true" ); addParam("help", mkproc(ParamProc::help), "This help"); //pViewer = new ViewerPlain; @@ -63,6 +66,7 @@ public: StaticString sAction; //Viewer *pViewer; bool bDebug; + bool bPostDebug; private: }; @@ -92,11 +96,21 @@ int main( int argc, char *argv[] ) else pBuild->execAction(""); } + if( prm.bPostDebug ) + { + printf("\n\n----------\nDebug dump\n----------\n"); + pBuild->debugDump(); + } } catch( BuildException &e ) { fputs( e.what(), stderr ); fputs( "\n", stderr ); + if( prm.bPostDebug ) + { + printf("\n\n----------\nDebug dump\n----------\n"); + pBuild->debugDump(); + } return 1; } diff --git a/src/rule.cpp b/src/rule.cpp index 3ba4303..dcf62d4 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -81,8 +81,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++ ) + //for( StringList::iterator j = lProduces.begin(); + // j != lProduces.end(); j++ ) + StringList::iterator j = lProduces.begin(); { VarMap mTmp; std::string target = bld.replVars( (*j), (*i), NULL ); diff --git a/src/targetfile.cpp b/src/targetfile.cpp index 3743297..6ea83d5 100644 --- a/src/targetfile.cpp +++ b/src/targetfile.cpp @@ -72,6 +72,7 @@ void TargetFile::clean( Build &bld ) { if( access( (*i)->getTarget().c_str(), W_OK ) == 0 ) { + (*i)->setRule("clean"); bld.getView()->beginPerform( *i ); unlink( (*i)->getTarget().c_str() ); bld.getView()->endPerform(); -- cgit v1.2.3