Index: Source/cmGlobalUnixMakefileGenerator3.cxx =================================================================== --- Source/cmGlobalUnixMakefileGenerator3.cxx (revision 3012) +++ Source/cmGlobalUnixMakefileGenerator3.cxx (working copy) @@ -787,7 +787,7 @@ progressDir += t->first; lg->AppendEcho(commands,progressDir.c_str()); - this->AppendGlobalTargetDepends(depends,t->second); + this->AppendGlobalTargetDepends(depends,t->second, "/all"); lg->WriteMakeRule(ruleFileStream, "All Build rule for target.", localName.c_str(), depends, commands, true); @@ -874,8 +874,10 @@ makeTargetName += "/clean"; depends.clear(); commands.clear(); + commands.push_back(lg->GetRecursiveMakeCall (makefileName.c_str(), makeTargetName.c_str())); + this->AppendGlobalTargetDepends(depends,t->second, "/clean"); lg->WriteMakeRule(ruleFileStream, "clean rule for target.", makeTargetName.c_str(), depends, commands, true); commands.clear(); @@ -1095,7 +1097,7 @@ void cmGlobalUnixMakefileGenerator3 ::AppendGlobalTargetDepends(std::vector& depends, - cmTarget& target) + cmTarget& target, const char *subtarget) { // Keep track of dependencies already listed. std::set emitted; @@ -1115,7 +1117,7 @@ { // Add this dependency. this->AppendAnyGlobalDepend(depends, lib->first.c_str(), - emitted, target); + emitted, target, subtarget); } } } @@ -1129,7 +1131,7 @@ if(emitted.insert(*util).second) { // Add this dependency. - this->AppendAnyGlobalDepend(depends, util->c_str(), emitted, target); + this->AppendAnyGlobalDepend(depends, util->c_str(), emitted, target, subtarget); } } } @@ -1139,7 +1141,8 @@ void cmGlobalUnixMakefileGenerator3 ::AppendAnyGlobalDepend(std::vector& depends, const char* name, - std::set& emitted, cmTarget &target) + std::set& emitted, cmTarget &target, + const char* subtarget) { cmTarget *result; cmLocalUnixMakefileGenerator3 *lg3; @@ -1164,7 +1167,7 @@ if (result) { std::string tgtName = lg3->GetRelativeTargetDirectory(*result); - tgtName += "/all"; + tgtName += subtarget; depends.push_back(tgtName); if(result->GetType() == cmTarget::STATIC_LIBRARY) { @@ -1178,7 +1181,7 @@ { // Add this dependency. this->AppendAnyGlobalDepend(depends, lib->first.c_str(), - emitted, *result); + emitted, *result, subtarget); } } } Index: Source/cmGlobalUnixMakefileGenerator3.h =================================================================== --- Source/cmGlobalUnixMakefileGenerator3.h (revision 3012) +++ Source/cmGlobalUnixMakefileGenerator3.h (working copy) @@ -151,11 +151,11 @@ cmLocalUnixMakefileGenerator3* lg); void AppendGlobalTargetDepends(std::vector& depends, - cmTarget& target); + cmTarget& target, const char* subtarget); void AppendAnyGlobalDepend(std::vector& depends, const char* name, std::set& emitted, - cmTarget &target); + cmTarget &target, const char* subtarget); // does this generator need a requires step for any of its targets bool NeedRequiresStep(cmLocalUnixMakefileGenerator3 *lg, const char *);