diff --git a/uppsrc/ide/Builders/MakeFile.cpp b/uppsrc/ide/Builders/MakeFile.cpp index abe8599cd..1a4f6040f 100644 --- a/uppsrc/ide/Builders/MakeFile.cpp +++ b/uppsrc/ide/Builders/MakeFile.cpp @@ -305,7 +305,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) inclist << " -I" << includes[i]; inclist << " -I./"; - inclist << " -I" << uppout; // build_info.h is created there + inclist << " -I$(UPPOUT)"; // build_info.h is created there makefile << "\n" "UPPOUT = " << (exporting ? "_out/" : GetMakePath(AdjustMakePath(host->GetHostPath(AppendFileName(uppout, ""))), win32)) << "\n" @@ -346,7 +346,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) output = "./" + wspc[0]; StringStream ss; String svn_info; - String build_info = '\"' + uppout + "/build_info.h\""; + String build_info = "\"$(UPPOUT)/build_info.h\""; if(makefile_svn_revision) { Vector bi = SvnInfo(wspc[i]); for(int i = 0; i < bi.GetCount(); i++) @@ -391,8 +391,8 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) << rules << ".PHONY: clean\n" << "clean:\n" - << "\tif [ -d \"$(UPPOUT)\" ]; then rm -rf \"$(UPPOUT)\" ; fi\n" - << "\tif [ -f build_info.h ]; then rm -f build_info.h ; fi\n"; + << "\tif [ \"$(UPPOUT)\" != \"\" -a \"$(UPPOUT)\" != \"/\" -a -d \"$(UPPOUT)\" ] ; then rm -fr \"$(UPPOUT)\" ; fi\n" + ; bool sv = ::SaveFile(fn, makefile); if(!exporting) {