aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-11-04 00:07:51 +0000
committerMike Buland <eichlan@xagasoft.com>2006-11-04 00:07:51 +0000
commit9868a2005820a4291f97b3080168af39b429a03c (patch)
tree22302b3f3344c378fb530575fb4de8842a0f7681
parent863a1f4ce1d7b70f9a73edb16b0de1c753087152 (diff)
downloadbuild-9868a2005820a4291f97b3080168af39b429a03c.tar.gz
build-9868a2005820a4291f97b3080168af39b429a03c.tar.bz2
build-9868a2005820a4291f97b3080168af39b429a03c.tar.xz
build-9868a2005820a4291f97b3080168af39b429a03c.zip
Getting closer to the percents making some damn sense.
-rw-r--r--src/targetfile.cpp14
-rw-r--r--src/viewer.cpp8
-rw-r--r--src/viewer.h2
-rw-r--r--src/viewerplainpct.cpp26
-rw-r--r--src/viewerplainpct.h5
5 files changed, 48 insertions, 7 deletions
diff --git a/src/targetfile.cpp b/src/targetfile.cpp
index dacf521..1a73cc6 100644
--- a/src/targetfile.cpp
+++ b/src/targetfile.cpp
@@ -38,16 +38,19 @@ void TargetFile::check( Build &bld )
38 { 38 {
39 time_t tTarget = getTime( bld, (*i)->getTarget() ); 39 time_t tTarget = getTime( bld, (*i)->getTarget() );
40 StringList &reqs = bld.getRequires( (*i)->getTarget() ); 40 StringList &reqs = bld.getRequires( (*i)->getTarget() );
41 bool bExtras = false; 41 bool bExtras = false, bBuilt = false, bUpdate = false;
42 for( StringList::iterator j = reqs.begin(); j != reqs.end(); j++ ) 42 for( StringList::iterator j = reqs.begin(); j != reqs.end(); j++ )
43 { 43 {
44 //bld.chainTarget( *j ); 44 //bld.chainTarget( *j );
45 if( getTime( bld, *j ) > tTarget ) 45 if( getTime( bld, *j ) > tTarget )
46 { 46 {
47 if( bUpdate == false )
48 bld.getView()->skipRequiresCheck( false, (*i)->getTarget() ) ;
47 bld.getView()->beginPerform( *i ); 49 bld.getView()->beginPerform( *i );
48 (*i)->execute( bld ); 50 (*i)->execute( bld );
49 bld.getView()->endPerform(); 51 bld.getView()->endPerform();
50 updateTime( (*i)->getTarget() ); 52 updateTime( (*i)->getTarget() );
53 bBuilt = true;
51 break; 54 break;
52 } 55 }
53 if( bExtras == false ) 56 if( bExtras == false )
@@ -59,11 +62,20 @@ void TargetFile::check( Build &bld )
59 if( !bld.getCached( (*i)->getTarget(), tTarget, reqs ) ) 62 if( !bld.getCached( (*i)->getTarget(), tTarget, reqs ) )
60 { 63 {
61 bld.updateCache( (*i)->getTarget(), (*i)->getReqFuncs(), reqs ); 64 bld.updateCache( (*i)->getTarget(), (*i)->getReqFuncs(), reqs );
65 bUpdate = true;
62 } 66 }
63 bExtras = true; 67 bExtras = true;
64 } 68 }
65 } 69 }
66 } 70 }
71 if( bBuilt == false )
72 {
73 if( bUpdate == false )
74 {
75 bld.getView()->skipRequiresCheck( false, (*i)->getTarget() );
76 }
77 bld.getView()->skipPerform( *i );
78 }
67 } 79 }
68 80
69 bld.getView()->endPerforms(); 81 bld.getView()->endPerforms();
diff --git a/src/viewer.cpp b/src/viewer.cpp
index 5998316..1f3b26f 100644
--- a/src/viewer.cpp
+++ b/src/viewer.cpp
@@ -40,6 +40,10 @@ void Viewer::endRequiresCheck()
40{ 40{
41} 41}
42 42
43void Viewer::skipRequiresCheck( bool bCached, const std::string &sName )
44{
45}
46
43void Viewer::beginPerform( Perform *pPerform ) 47void Viewer::beginPerform( Perform *pPerform )
44{ 48{
45} 49}
@@ -48,6 +52,10 @@ void Viewer::endPerform()
48{ 52{
49} 53}
50 54
55void Viewer::skipPerform( Perform *pPerform )
56{
57}
58
51void Viewer::beginExecute() 59void Viewer::beginExecute()
52{ 60{
53} 61}
diff --git a/src/viewer.h b/src/viewer.h
index 86410f0..7ee6b21 100644
--- a/src/viewer.h
+++ b/src/viewer.h
@@ -23,8 +23,10 @@ public:
23 23
24 virtual void beginRequiresCheck( bool bCached, const std::string &sName ); 24 virtual void beginRequiresCheck( bool bCached, const std::string &sName );
25 virtual void endRequiresCheck(); 25 virtual void endRequiresCheck();
26 virtual void skipRequiresCheck( bool bCached, const std::string &sName );
26 virtual void beginPerform( Perform *pPerform ); 27 virtual void beginPerform( Perform *pPerform );
27 virtual void endPerform(); 28 virtual void endPerform();
29 virtual void skipPerform( Perform *pPerform );
28 virtual void beginExecute(); 30 virtual void beginExecute();
29 virtual void endExecute(); 31 virtual void endExecute();
30 virtual void executeCmd( const std::string &sCmd ); 32 virtual void executeCmd( const std::string &sCmd );
diff --git a/src/viewerplainpct.cpp b/src/viewerplainpct.cpp
index a7baff1..dcf90ec 100644
--- a/src/viewerplainpct.cpp
+++ b/src/viewerplainpct.cpp
@@ -67,7 +67,15 @@ void ViewerPlainPct::beginRequiresCheck( bool bCached, const std::string &sName
67void ViewerPlainPct::endRequiresCheck() 67void ViewerPlainPct::endRequiresCheck()
68{ 68{
69 iCP++; 69 iCP++;
70 bDidReq = true; 70 //bDidReq = true;
71}
72
73void ViewerPlainPct::skipRequiresCheck( bool bCached, const std::string &sName )
74{
75 iCP++;
76/* printHead();
77 indent();
78 printf("[%3d%%] ! deps: %s\n", (int)round(((double)iCP/(double)iTP)*100.0), sName.c_str() );*/
71} 79}
72 80
73void ViewerPlainPct::beginPerform( Perform *pPerform ) 81void ViewerPlainPct::beginPerform( Perform *pPerform )
@@ -79,16 +87,24 @@ void ViewerPlainPct::beginPerform( Perform *pPerform )
79 87
80void ViewerPlainPct::endPerform() 88void ViewerPlainPct::endPerform()
81{ 89{
82 if(!bDidReq) 90 //if(!bDidReq)
83 iCP++; 91 iCP++;
84 bDidReq = false; 92 //bDidReq = false;
93}
94
95void ViewerPlainPct::skipPerform( Perform *pPerform )
96{
97 iCP++;
98/* printHead();
99 indent();
100 printf("[%3d%%] ! %8s: %s\n", (int)round(((double)iCP/(double)iTP)*100.0), pPerform->getRule().c_str(), pPerform->getTarget().c_str() );*/
85} 101}
86 102
87void ViewerPlainPct::beginPerforms( int nCount ) 103void ViewerPlainPct::beginPerforms( int nCount )
88{ 104{
89 iTP = nCount; 105 iTP = nCount*2;
90 iCP = 1; 106 iCP = 1;
91 bDidReq = false; 107 //bDidReq = false;
92} 108}
93 109
94void ViewerPlainPct::beginAction( const std::string &sName, int nCommands ) 110void ViewerPlainPct::beginAction( const std::string &sName, int nCommands )
diff --git a/src/viewerplainpct.h b/src/viewerplainpct.h
index 5a57ef0..aa9a228 100644
--- a/src/viewerplainpct.h
+++ b/src/viewerplainpct.h
@@ -20,6 +20,9 @@ public:
20 virtual void endPerform(); 20 virtual void endPerform();
21 virtual void beginPerforms( int nCount ); 21 virtual void beginPerforms( int nCount );
22 22
23 virtual void skipRequiresCheck( bool bCached, const std::string &sName );
24 virtual void skipPerform( Perform *pPerform );
25
23 virtual void beginAction( const std::string &sName, int nCommands ); 26 virtual void beginAction( const std::string &sName, int nCommands );
24 27
25 virtual void endAction(); 28 virtual void endAction();
@@ -28,7 +31,7 @@ public:
28 void indent(); 31 void indent();
29 32
30private: 33private:
31 bool bDidReq; 34 //bool bDidReq;
32 int iTP, iCP, iTC, iCC; 35 int iTP, iCP, iTC, iCC;
33 36
34 bool bRunClean; 37 bool bRunClean;