diff options
author | marha <marha@users.sourceforge.net> | 2009-10-02 09:28:00 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-10-02 09:28:00 +0000 |
commit | 516cdec4894096305f5002b922ba02d49cb3e816 (patch) | |
tree | e34bc97b00f6acf17b33877efb7f5ffa543d2881 /tools/mhmake/src/rule.cpp | |
parent | 945c71554aa1866a5286dd4b8f5b199dd7af9be9 (diff) | |
download | vcxsrv-516cdec4894096305f5002b922ba02d49cb3e816.tar.gz vcxsrv-516cdec4894096305f5002b922ba02d49cb3e816.tar.bz2 vcxsrv-516cdec4894096305f5002b922ba02d49cb3e816.zip |
Optimised auto dependency generation
Added control c handler in windows
Now throw string exceptions instead of integer exceptions.
Diffstat (limited to 'tools/mhmake/src/rule.cpp')
-rw-r--r-- | tools/mhmake/src/rule.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tools/mhmake/src/rule.cpp b/tools/mhmake/src/rule.cpp index 7e71ba95f..90fee8a91 100644 --- a/tools/mhmake/src/rule.cpp +++ b/tools/mhmake/src/rule.cpp @@ -49,11 +49,12 @@ static bool FindDep(const string &DepName,vector<pair<string,refptr<rule> > >&Im bool bCommandsDifferent=OldCommands.size()!=NewCommands.size();
if (g_PrintMultipleDefinedRules || bCommandsDifferent)
{
+ string ErrorMessage;
if (bCommandsDifferent)
- cerr << "Implicit Rule '"<< DepName << "' defined twice with different commands\n";
+ ErrorMessage += "Implicit Rule '"+ DepName + "' defined twice with different commands\n";
else
- cerr << "Implicit Rule '"<< DepName << "' defined twice with same commands\n";
- cerr << "Command 1: makedir = " << SecIt->second->GetMakefile()->GetMakeDir()->GetQuotedFullFileName()<< endl;
+ ErrorMessage += "Implicit Rule '"+ DepName + "' defined twice with same commands\n";
+ ErrorMessage += "Command 1: makedir = " + SecIt->second->GetMakefile()->GetMakeDir()->GetQuotedFullFileName()+ "\n";
vector<string>::const_iterator It;
if (bCommandsDifferent)
@@ -61,19 +62,21 @@ static bool FindDep(const string &DepName,vector<pair<string,refptr<rule> > >&Im It=OldCommands.begin();
while (It!=OldCommands.end())
{
- cerr << " " << *It << endl;
+ ErrorMessage += " " + *It + "\n";
}
}
- cerr << "Command 2: makedir = "<< Rule->GetMakefile()->GetMakeDir()->GetQuotedFullFileName()<< endl;
+ cerr << "Command 2: makedir = "+ Rule->GetMakefile()->GetMakeDir()->GetQuotedFullFileName()+ "\n";
if (bCommandsDifferent)
{
It=NewCommands.begin();
while (It!=NewCommands.end())
{
- cerr << " " << *It << endl;
+ ErrorMessage += " " + *It + "\n";
}
- throw(1);
+ throw ErrorMessage;
}
+ else
+ cerr << ErrorMessage << endl;
}
mhmakeparser *pOldMakefile=SecIt->second->GetMakefile();
mhmakeparser *pNewMakefile=Rule->GetMakefile();
@@ -83,12 +86,12 @@ static bool FindDep(const string &DepName,vector<pair<string,refptr<rule> > >&Im {
if (pOldMakefile->ExpandExpression(*OldIt)!=pNewMakefile->ExpandExpression(*NewIt))
{
- cerr << "Implicit Rule '"<< DepName << "' defined twice with different commands\n";
- cerr << "Command 1: makedir = " << pOldMakefile->GetMakeDir()->GetQuotedFullFileName()<< endl;
- cerr << " " << pOldMakefile->ExpandExpression(*OldIt) << endl;
- cerr << "Command 2: makedir = "<< pNewMakefile->GetMakeDir()->GetQuotedFullFileName()<< endl;
- cerr << " " << pNewMakefile->ExpandExpression(*NewIt) << endl;
- throw(1);
+ string ErrorMessage = string("Implicit Rule '") + DepName + "' defined twice with different commands\n";
+ ErrorMessage += "Command 1: makedir = " + pOldMakefile->GetMakeDir()->GetQuotedFullFileName()+ "\n";
+ ErrorMessage += " " + pOldMakefile->ExpandExpression(*OldIt) + "\n";
+ ErrorMessage += "Command 2: makedir = " + pNewMakefile->GetMakeDir()->GetQuotedFullFileName()+ "\n";
+ ErrorMessage += " " + pNewMakefile->ExpandExpression(*NewIt);
+ throw ErrorMessage;
}
OldIt++;
NewIt++;
@@ -141,8 +144,7 @@ void IMPLICITRULE::SearchImplicitRule(const refptr<fileinfo> &Target,vector< pai #ifdef _DEBUG
if (!ResIt->second)
{
- cerr << "No rhs for implicit rule : "<< ImpRegExIt->first << endl;
- throw(1);
+ throw string("No rhs for implicit rule : ") + ImpRegExIt->first;
}
#endif
ResIt->second->SetStem(Res.m_Stem);
|