diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-08-02 08:04:19 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-08-02 08:04:19 +0000 |
commit | 4ab0bf24ac9634a12a4a518edecae1d42fa331d9 (patch) | |
tree | 75b386895c987bd6f8575140d8c6aa48318ece96 /src/builder.cpp | |
parent | 062fcfb96c56ecfb69b8c3162ced65b63e863752 (diff) | |
download | build-4ab0bf24ac9634a12a4a518edecae1d42fa331d9.tar.gz build-4ab0bf24ac9634a12a4a518edecae1d42fa331d9.tar.bz2 build-4ab0bf24ac9634a12a4a518edecae1d42fa331d9.tar.xz build-4ab0bf24ac9634a12a4a518edecae1d42fa331d9.zip |
Fixed a few minor bugs and added the new viewer system, it allows you to add new
front ends that will display what build is doing in any way you want. cool!
So far we have plain and percent, verbose and make are coming, make should be
really easy, just print out the commands and nothing else.
Diffstat (limited to 'src/builder.cpp')
-rw-r--r-- | src/builder.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/builder.cpp b/src/builder.cpp index c4f2d12..65ae0c2 100644 --- a/src/builder.cpp +++ b/src/builder.cpp | |||
@@ -6,14 +6,16 @@ | |||
6 | #include "target.h" | 6 | #include "target.h" |
7 | #include "build.tab.h" | 7 | #include "build.tab.h" |
8 | #include "rule.h" | 8 | #include "rule.h" |
9 | #include "viewer.h" | ||
9 | 10 | ||
10 | subExceptionDef( BuildException ) | 11 | subExceptionDef( BuildException ) |
11 | 12 | ||
12 | Builder::Builder() : | 13 | Builder::Builder( Viewer &rView ) : |
13 | pDefaultAction( NULL ), | 14 | pDefaultAction( NULL ), |
14 | pLastAddedAction( NULL ), | 15 | pLastAddedAction( NULL ), |
15 | sTmp(""), | 16 | sTmp(""), |
16 | sContext("") | 17 | sContext(""), |
18 | rView( rView ) | ||
17 | { | 19 | { |
18 | } | 20 | } |
19 | 21 | ||
@@ -44,7 +46,11 @@ void Builder::build( const char *sAct ) | |||
44 | pAct = mAction[sAct]; | 46 | pAct = mAction[sAct]; |
45 | } | 47 | } |
46 | 48 | ||
49 | rView.beginAction( sAct, pAct->getNumCommands() ); | ||
50 | |||
47 | pAct->execute( *this ); | 51 | pAct->execute( *this ); |
52 | |||
53 | rView.endAction(); | ||
48 | } | 54 | } |
49 | 55 | ||
50 | void Builder::execute( Action *pAct ) | 56 | void Builder::execute( Action *pAct ) |
@@ -318,6 +324,8 @@ void Builder::genRequiresFor( const char *sName ) | |||
318 | { | 324 | { |
319 | varmap *revars = regexVars( re ); | 325 | varmap *revars = regexVars( re ); |
320 | std::string s = varRepl( (*i).second.c_str(), "", revars ); | 326 | std::string s = varRepl( (*i).second.c_str(), "", revars ); |
327 | rView.beginExtraRequiresCheck( s.c_str() ); | ||
328 | rView.executeCmd( s.c_str() ); | ||
321 | FILE *fcmd = popen( s.c_str(), "r" ); | 329 | FILE *fcmd = popen( s.c_str(), "r" ); |
322 | std::string rhs; | 330 | std::string rhs; |
323 | bool bHeader = true; | 331 | bool bHeader = true; |
@@ -366,6 +374,7 @@ void Builder::genRequiresFor( const char *sName ) | |||
366 | } | 374 | } |
367 | pclose( fcmd ); | 375 | pclose( fcmd ); |
368 | delete revars; | 376 | delete revars; |
377 | rView.endExtraRequiresCheck(); | ||
369 | } | 378 | } |
370 | } | 379 | } |
371 | } | 380 | } |