aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-09-12 19:33:43 +0000
committerMike Buland <eichlan@xagasoft.com>2006-09-12 19:33:43 +0000
commit1dc59875ed1e072a0c87b10e1bb43d7be2311ec8 (patch)
treedabee4f6c64856b176b9f398fc578148697c512e
parent249d3a1b6bd6a602605013ac1bca2b92c7a361c9 (diff)
downloadbuild-1dc59875ed1e072a0c87b10e1bb43d7be2311ec8.tar.gz
build-1dc59875ed1e072a0c87b10e1bb43d7be2311ec8.tar.bz2
build-1dc59875ed1e072a0c87b10e1bb43d7be2311ec8.tar.xz
build-1dc59875ed1e072a0c87b10e1bb43d7be2311ec8.zip
clean now works, the -c option will come later.
-rw-r--r--build.conf2
-rw-r--r--src/targetfile.cpp20
2 files changed, 20 insertions, 2 deletions
diff --git a/build.conf b/build.conf
index 43f176d..18e4eec 100644
--- a/build.conf
+++ b/build.conf
@@ -1,7 +1,7 @@
1# build.conf for build, kind of whacky, eh? 1# build.conf for build, kind of whacky, eh?
2 2
3default action: check targets() 3default action: check targets()
4"clean" action: clean "build" 4"clean" action: clean targets()
5"rebuild" action: clean "build", check "build" 5"rebuild" action: clean "build", check "build"
6 6
7set "CXXFLAGS" += "-ggdb -Ilibbu++/src" 7set "CXXFLAGS" += "-ggdb -Ilibbu++/src"
diff --git a/src/targetfile.cpp b/src/targetfile.cpp
index ddb1c18..3743297 100644
--- a/src/targetfile.cpp
+++ b/src/targetfile.cpp
@@ -61,7 +61,25 @@ void TargetFile::check( Build &bld )
61 61
62void TargetFile::clean( Build &bld ) 62void TargetFile::clean( Build &bld )
63{ 63{
64 printf("Target file cleaning: %s\n", getName().c_str() ); 64 Rule *pRule = bld.getRule( getRule() );
65 PerformList lPerf;
66 pRule->setTarget( getName() );
67 StringList lFinal = pRule->execute( bld, getInput(), lPerf );
68
69 bld.getView()->beginPerforms( lPerf.size() );
70
71 for( PerformList::iterator i = lPerf.begin(); i != lPerf.end(); i++ )
72 {
73 if( access( (*i)->getTarget().c_str(), W_OK ) == 0 )
74 {
75 bld.getView()->beginPerform( *i );
76 unlink( (*i)->getTarget().c_str() );
77 bld.getView()->endPerform();
78 }
79
80 }
81
82 bld.getView()->endPerforms();
65} 83}
66 84
67time_t TargetFile::getTime( Build &bld, std::string str ) 85time_t TargetFile::getTime( Build &bld, std::string str )