Skip to content

Commit

Permalink
Fixed: when the flag 'use asterisk for clean' is disabled, the genera…
Browse files Browse the repository at this point in the history
…ted Makefile does not really clean...
  • Loading branch information
eranif committed Jun 4, 2014
1 parent fddb320 commit a73e54a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Plugin/builder_gnumake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,7 @@ void BuilderGnuMake::CreateCleanTargets(ProjectPtr proj, const wxString &confToB
EditorConfigST::Get()->GetLongValue(wxT("CleanTragetWithAsterisk"), asterisk);

wxString imd = bldConf->GetIntermediateDirectory();
imd.Trim().Trim(false);
bool useAsterisk = ((imd.IsEmpty() == false) && asterisk);
bool useAsterisk = (!imd.IsEmpty() && asterisk && imd != "/");

// support for full path
abs_files.reserve( m_projectFilesMetadata.size() );
Expand Down Expand Up @@ -919,9 +918,9 @@ void BuilderGnuMake::CreateCleanTargets(ProjectPtr proj, const wxString &confToB
if (ft.kind == Compiler::CmpFileKindSource) {

wxString objectName, dependFile, preprocessFile;
objectName << objPrefix << abs_files[i].GetName() << wxT("$(ObjectSuffix)");
dependFile << objPrefix << abs_files[i].GetName() << wxT("$(DependSuffix)");
preprocessFile << objPrefix << abs_files[i].GetName() << wxT("$(PreprocessSuffix)");
objectName << objPrefix << abs_files[i].GetFullName() << wxT("$(ObjectSuffix)");
dependFile << objPrefix << abs_files[i].GetFullName() << wxT("$(DependSuffix)");
preprocessFile << objPrefix << abs_files[i].GetFullName() << wxT("$(PreprocessSuffix)");

text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/") << objectName << wxT("\n");
text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/") << dependFile << wxT("\n");
Expand All @@ -936,7 +935,7 @@ void BuilderGnuMake::CreateCleanTargets(ProjectPtr proj, const wxString &confToB
}
} else {
// We can use asterisk (intermediat directory is not empty)
text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/*.*") << wxT("\n");
text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/*$(ObjectSuffix)") << wxT("\n");
}

//delete the output file as well
Expand Down Expand Up @@ -975,9 +974,9 @@ void BuilderGnuMake::CreateCleanTargets(ProjectPtr proj, const wxString &confToB

wxString objectName, dependFile, preprocessFile;

objectName << objPrefix << abs_files[i].GetName() << wxT("$(ObjectSuffix)");
dependFile << objPrefix << abs_files[i].GetName() << wxT("$(DependSuffix)");
preprocessFile << objPrefix << abs_files[i].GetName() << wxT("$(PreprocessSuffix)");
objectName << objPrefix << abs_files[i].GetFullName() << wxT("$(ObjectSuffix)");
dependFile << objPrefix << abs_files[i].GetFullName() << wxT("$(DependSuffix)");
preprocessFile << objPrefix << abs_files[i].GetFullName() << wxT("$(PreprocessSuffix)");

text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/") << objectName << wxT("\n");
text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/") << dependFile << wxT("\n");
Expand All @@ -986,7 +985,7 @@ void BuilderGnuMake::CreateCleanTargets(ProjectPtr proj, const wxString &confToB
}

} else {
text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/*.*") << wxT("\n");
text << wxT("\t") << wxT("$(RM) ") << wxT("$(IntermediateDirectory)/*$(ObjectSuffix)") << wxT("\n");
}

//delete the output file as well
Expand Down
2 changes: 2 additions & 0 deletions Plugin/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@ void StripSemiColons(wxString &str)
wxString NormalizePath(const wxString &path)
{
wxString normalized_path(path);
normalized_path.Trim().Trim(false);
normalized_path.Replace(wxT("\\"), wxT("/"));
while ( normalized_path.Replace("//", "/") ) {}
return normalized_path;
}

Expand Down

0 comments on commit a73e54a

Please sign in to comment.