diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-09-12 19:33:43 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-09-12 19:33:43 +0000 |
commit | 1dc59875ed1e072a0c87b10e1bb43d7be2311ec8 (patch) | |
tree | dabee4f6c64856b176b9f398fc578148697c512e | |
parent | 249d3a1b6bd6a602605013ac1bca2b92c7a361c9 (diff) | |
download | build-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.conf | 2 | ||||
-rw-r--r-- | src/targetfile.cpp | 20 |
2 files changed, 20 insertions, 2 deletions
@@ -1,7 +1,7 @@ | |||
1 | # build.conf for build, kind of whacky, eh? | 1 | # build.conf for build, kind of whacky, eh? |
2 | 2 | ||
3 | default action: check targets() | 3 | default 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 | ||
7 | set "CXXFLAGS" += "-ggdb -Ilibbu++/src" | 7 | set "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 | ||
62 | void TargetFile::clean( Build &bld ) | 62 | void 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 | ||
67 | time_t TargetFile::getTime( Build &bld, std::string str ) | 85 | time_t TargetFile::getTime( Build &bld, std::string str ) |