diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-09-14 23:59:39 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-09-14 23:59:39 +0000 |
commit | 5a32418a040e967887aa6e01e41abc22932471db (patch) | |
tree | b43cd556e925cd07d2a25be622c7894a1c76e794 | |
parent | c831a3947d7ac517fceaf8981d56c5ddcdaf26b1 (diff) | |
download | build-5a32418a040e967887aa6e01e41abc22932471db.tar.gz build-5a32418a040e967887aa6e01e41abc22932471db.tar.bz2 build-5a32418a040e967887aa6e01e41abc22932471db.tar.xz build-5a32418a040e967887aa6e01e41abc22932471db.zip |
Made more changes, this one has a little extra debug, get the next one.
Diffstat (limited to '')
-rw-r--r-- | src/main.cpp | 16 | ||||
-rw-r--r-- | src/rule.cpp | 5 | ||||
-rw-r--r-- | src/targetfile.cpp | 1 |
3 files changed, 19 insertions, 3 deletions
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: | |||
13 | sFile("build.conf"), | 13 | sFile("build.conf"), |
14 | sCache(".build.cache"), | 14 | sCache(".build.cache"), |
15 | bDebug( false ), | 15 | bDebug( false ), |
16 | bPostDebug( false ), | ||
16 | sView("plain") | 17 | sView("plain") |
17 | { | 18 | { |
18 | addHelpBanner("Build r?\n\n"); | 19 | addHelpBanner("Build r?\n\n"); |
@@ -25,7 +26,9 @@ public: | |||
25 | addParam("cache", &sCache, | 26 | addParam("cache", &sCache, |
26 | "Set an alternative cache file." ); | 27 | "Set an alternative cache file." ); |
27 | addParam('d', &bDebug, | 28 | addParam('d', &bDebug, |
28 | "Print out a debug dump of the build.conf", NULL, "true" ); | 29 | "Display debug info instead of building", NULL, "true" ); |
30 | addParam('D', &bPostDebug, | ||
31 | "Display debug info after building", NULL, "true" ); | ||
29 | addParam("help", mkproc(ParamProc::help), | 32 | addParam("help", mkproc(ParamProc::help), |
30 | "This help"); | 33 | "This help"); |
31 | //pViewer = new ViewerPlain; | 34 | //pViewer = new ViewerPlain; |
@@ -63,6 +66,7 @@ public: | |||
63 | StaticString sAction; | 66 | StaticString sAction; |
64 | //Viewer *pViewer; | 67 | //Viewer *pViewer; |
65 | bool bDebug; | 68 | bool bDebug; |
69 | bool bPostDebug; | ||
66 | 70 | ||
67 | private: | 71 | private: |
68 | }; | 72 | }; |
@@ -92,11 +96,21 @@ int main( int argc, char *argv[] ) | |||
92 | else | 96 | else |
93 | pBuild->execAction(""); | 97 | pBuild->execAction(""); |
94 | } | 98 | } |
99 | if( prm.bPostDebug ) | ||
100 | { | ||
101 | printf("\n\n----------\nDebug dump\n----------\n"); | ||
102 | pBuild->debugDump(); | ||
103 | } | ||
95 | } | 104 | } |
96 | catch( BuildException &e ) | 105 | catch( BuildException &e ) |
97 | { | 106 | { |
98 | fputs( e.what(), stderr ); | 107 | fputs( e.what(), stderr ); |
99 | fputs( "\n", stderr ); | 108 | fputs( "\n", stderr ); |
109 | if( prm.bPostDebug ) | ||
110 | { | ||
111 | printf("\n\n----------\nDebug dump\n----------\n"); | ||
112 | pBuild->debugDump(); | ||
113 | } | ||
100 | return 1; | 114 | return 1; |
101 | } | 115 | } |
102 | 116 | ||
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 ) | |||
81 | { | 81 | { |
82 | for( StringList::iterator i = lMine.begin(); i != lMine.end(); i++ ) | 82 | for( StringList::iterator i = lMine.begin(); i != lMine.end(); i++ ) |
83 | { | 83 | { |
84 | for( StringList::iterator j = lProduces.begin(); | 84 | //for( StringList::iterator j = lProduces.begin(); |
85 | j != lProduces.end(); j++ ) | 85 | // j != lProduces.end(); j++ ) |
86 | StringList::iterator j = lProduces.begin(); | ||
86 | { | 87 | { |
87 | VarMap mTmp; | 88 | VarMap mTmp; |
88 | std::string target = bld.replVars( (*j), (*i), NULL ); | 89 | 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 ) | |||
72 | { | 72 | { |
73 | if( access( (*i)->getTarget().c_str(), W_OK ) == 0 ) | 73 | if( access( (*i)->getTarget().c_str(), W_OK ) == 0 ) |
74 | { | 74 | { |
75 | (*i)->setRule("clean"); | ||
75 | bld.getView()->beginPerform( *i ); | 76 | bld.getView()->beginPerform( *i ); |
76 | unlink( (*i)->getTarget().c_str() ); | 77 | unlink( (*i)->getTarget().c_str() ); |
77 | bld.getView()->endPerform(); | 78 | bld.getView()->endPerform(); |