diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/targetfile.cpp | 14 | ||||
-rw-r--r-- | src/viewer.cpp | 8 | ||||
-rw-r--r-- | src/viewer.h | 2 | ||||
-rw-r--r-- | src/viewerplainpct.cpp | 26 | ||||
-rw-r--r-- | src/viewerplainpct.h | 5 |
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 | ||
43 | void Viewer::skipRequiresCheck( bool bCached, const std::string &sName ) | ||
44 | { | ||
45 | } | ||
46 | |||
43 | void Viewer::beginPerform( Perform *pPerform ) | 47 | void Viewer::beginPerform( Perform *pPerform ) |
44 | { | 48 | { |
45 | } | 49 | } |
@@ -48,6 +52,10 @@ void Viewer::endPerform() | |||
48 | { | 52 | { |
49 | } | 53 | } |
50 | 54 | ||
55 | void Viewer::skipPerform( Perform *pPerform ) | ||
56 | { | ||
57 | } | ||
58 | |||
51 | void Viewer::beginExecute() | 59 | void 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 | |||
67 | void ViewerPlainPct::endRequiresCheck() | 67 | void ViewerPlainPct::endRequiresCheck() |
68 | { | 68 | { |
69 | iCP++; | 69 | iCP++; |
70 | bDidReq = true; | 70 | //bDidReq = true; |
71 | } | ||
72 | |||
73 | void 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 | ||
73 | void ViewerPlainPct::beginPerform( Perform *pPerform ) | 81 | void ViewerPlainPct::beginPerform( Perform *pPerform ) |
@@ -79,16 +87,24 @@ void ViewerPlainPct::beginPerform( Perform *pPerform ) | |||
79 | 87 | ||
80 | void ViewerPlainPct::endPerform() | 88 | void ViewerPlainPct::endPerform() |
81 | { | 89 | { |
82 | if(!bDidReq) | 90 | //if(!bDidReq) |
83 | iCP++; | 91 | iCP++; |
84 | bDidReq = false; | 92 | //bDidReq = false; |
93 | } | ||
94 | |||
95 | void 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 | ||
87 | void ViewerPlainPct::beginPerforms( int nCount ) | 103 | void 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 | ||
94 | void ViewerPlainPct::beginAction( const std::string &sName, int nCommands ) | 110 | void 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 | ||
30 | private: | 33 | private: |
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; |