diff options
author | marha <marha@users.sourceforge.net> | 2011-03-04 11:26:33 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-04 11:26:33 +0000 |
commit | dbe1b719f8037dda23279b8bc7d8200578415e15 (patch) | |
tree | 258cd8fc316da25de3df00dc36e00a1f54f0e125 /tools/mhmake/src/util.cpp | |
parent | d2bdfe9f8d895ac64619f7bc2f7443ce886146e9 (diff) | |
download | vcxsrv-dbe1b719f8037dda23279b8bc7d8200578415e15.tar.gz vcxsrv-dbe1b719f8037dda23279b8bc7d8200578415e15.tar.bz2 vcxsrv-dbe1b719f8037dda23279b8bc7d8200578415e15.zip |
Implement eval sort warning functions (see gnu make manual for description)
Solved errors in if and foreach implementations
Removed message and reparse function (use info and eval instead)
$n can be used to add new line
define can be used to specify multi-line macros
Solved error in argument expansion in call function
Diffstat (limited to 'tools/mhmake/src/util.cpp')
-rw-r--r-- | tools/mhmake/src/util.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp index 1f531e493..8b7d2b164 100644 --- a/tools/mhmake/src/util.cpp +++ b/tools/mhmake/src/util.cpp @@ -593,7 +593,7 @@ void loadedmakefile::LoadMakefile() cout << "Loading makefile "<<m_Makefile->GetQuotedFullFileName()<<endl;
#endif
- m_pParser=refptr<mhmakefileparser>(new yy::mhmakeparser(m_CommandLineVars));
+ m_pMakefileParser=refptr<mhmakefileparser>(new mhmakefileparser(m_CommandLineVars));
// Add the MAKECMDGOALS environment variable
string MakeCmdGoals;
@@ -608,7 +608,7 @@ void loadedmakefile::LoadMakefile() MakeCmdGoals+=*TarIt;
TarIt++;
}
- m_pParser->SetVariable("MAKECMDGOALS",MakeCmdGoals);
+ m_pMakefileParser->SetVariable("MAKECMDGOALS",MakeCmdGoals);
string BaseAutoMak;
@@ -616,29 +616,29 @@ void loadedmakefile::LoadMakefile() fileinfo *pDepFile;
if (sm_Statics.m_MhMakeConf)
{
- BaseAutoMak=m_pParser->ExpandVar(BASEAUTOMAK);
+ BaseAutoMak=m_pMakefileParser->ExpandVar(BASEAUTOMAK);
if (BaseAutoMak.empty())
{
BaseAutoMak="makefile";
- m_pParser->SetVariable(BASEAUTOMAK,BaseAutoMak);
+ m_pMakefileParser->SetVariable(BASEAUTOMAK,BaseAutoMak);
}
const fileinfo *pBeforeMakefile=GetFileInfo(BaseAutoMak+".before",sm_Statics.m_MhMakeConf);
- int result=m_pParser->ParseFile(pBeforeMakefile,m_MakeDir);
+ int result=m_pMakefileParser->ParseFile(pBeforeMakefile,m_MakeDir);
if (result)
{
throw string("Error parsing ")+pBeforeMakefile->GetQuotedFullFileName();
}
- m_pParser->UpdateDate(pBeforeMakefile->GetDate());
+ m_pMakefileParser->UpdateDate(pBeforeMakefile->GetDate());
// Now parse the automaticly generated dependency file, which needs to be in the objdir directory
- string ObjDirName=m_pParser->ExpandExpression("$(OBJDIR)");
+ string ObjDirName=m_pMakefileParser->ExpandExpression("$(OBJDIR)");
if (!ObjDirName.size())
{
throw string("When making use of MHMAKECONF, you have to define OBJDIR in makefile.before");
}
pDepFile=GetFileInfo(ObjDirName+OSPATHSEPSTR "." + m_Makefile->GetName()+ ".dep",m_MakeDir);
- m_pParser->SetVariable(AUTODEPFILE,pDepFile->GetQuotedFullFileName());
+ m_pMakefileParser->SetVariable(AUTODEPFILE,pDepFile->GetQuotedFullFileName());
}
else
{
@@ -663,14 +663,14 @@ void loadedmakefile::LoadMakefile() sprintf(ID,"_%lx",md5_finish32( &ctx));
pDepFile=GetFileInfo(string(".") + m_Makefile->GetName()+ ".dep"+ID,m_MakeDir);
- m_pParser->SetVariable(AUTODEPFILE,pDepFile->GetQuotedFullFileName());
+ m_pMakefileParser->SetVariable(AUTODEPFILE,pDepFile->GetQuotedFullFileName());
}
if (pDepFile->Exists())
- m_pParser->LoadAutoDepsFile(pDepFile); /* Already load this autodep file before parsing of the makefile to avoid needless rebuilds. */
+ m_pMakefileParser->LoadAutoDepsFile(pDepFile); /* Already load this autodep file before parsing of the makefile to avoid needless rebuilds. */
- //m_pParser->yydebug=1;
- int result=m_pParser->ParseFile(m_Makefile,m_MakeDir);
+ //m_pMakefileParser->yydebug=1;
+ int result=m_pMakefileParser->ParseFile(m_Makefile,m_MakeDir);
if (result)
{
throw string("Error parsing ")+m_Makefile->GetQuotedFullFileName();
@@ -678,40 +678,40 @@ void loadedmakefile::LoadMakefile() #ifdef _DEBUG
/* Check if the makefile has changed the AUTODEPFILE variable, if so generate a warning that a
* rebuild could happen for the rules defined for making included makefiles */
- if (m_pParser->ExpandVar(AUTODEPFILE)!=pDepFile->GetQuotedFullFileName())
+ if (m_pMakefileParser->ExpandVar(AUTODEPFILE)!=pDepFile->GetQuotedFullFileName())
{
cout << "\n\nWARNING:\n makefile '"<< m_Makefile->GetQuotedFullFileName() <<"' re-defines AUTODEPFILE\n from '"<< pDepFile->GetQuotedFullFileName() <<"'\n to '"<<
- m_pParser->ExpandVar(AUTODEPFILE) << "'\n (may cause needless rebuilds when having rules for included makefiles!!!!!)\n\n\n";
+ m_pMakefileParser->ExpandVar(AUTODEPFILE) << "'\n (may cause needless rebuilds when having rules for included makefiles!!!!!)\n\n\n";
}
if (g_PrintAdditionalInfo)
{
- if (m_pParser->GetFirstTarget())
- cout<<"First target of "<<m_Makefile->GetQuotedFullFileName()<<" is "<<m_pParser->GetFirstTarget()->GetQuotedFullFileName()<<endl;
+ if (m_pMakefileParser->GetFirstTarget())
+ cout<<"First target of "<<m_Makefile->GetQuotedFullFileName()<<" is "<<m_pMakefileParser->GetFirstTarget()->GetQuotedFullFileName()<<endl;
else
cout<<"No First target for "<<m_Makefile->GetQuotedFullFileName()<<endl;
}
#endif
- m_pParser->UpdateDate(m_Makefile->GetDate());
+ m_pMakefileParser->UpdateDate(m_Makefile->GetDate());
if (sm_Statics.m_MhMakeConf)
{
fileinfo *pAfterMakefile=GetFileInfo(BaseAutoMak+".after",sm_Statics.m_MhMakeConf);
- int result=m_pParser->ParseFile(pAfterMakefile);
+ int result=m_pMakefileParser->ParseFile(pAfterMakefile);
if (result) {
throw string("Error parsing ")+pAfterMakefile->GetQuotedFullFileName();
}
- m_pParser->UpdateDate(pAfterMakefile->GetDate());
+ m_pMakefileParser->UpdateDate(pAfterMakefile->GetDate());
}
bool ForceAutoDepRescan=g_ForceAutoDepRescan;
if (pDepFile->Exists())
- m_pParser->LoadAutoDepsFile(pDepFile);
+ m_pMakefileParser->LoadAutoDepsFile(pDepFile);
else
ForceAutoDepRescan=true;
if (ForceAutoDepRescan)
- m_pParser->EnableAutoDepRescan();
+ m_pMakefileParser->EnableAutoDepRescan();
- vector<string> &MakefilesToLoad=m_pParser->GetMakefilesToLoad();
+ vector<string> &MakefilesToLoad=m_pMakefileParser->GetMakefilesToLoad();
vector<string>::iterator It=MakefilesToLoad.begin();
while (It!=MakefilesToLoad.end())
{
@@ -739,7 +739,7 @@ void loadedmakefile::LoadMakefile() g_LoadedMakefiles.push_back(pLoadedMakefile);
/* If there is a rule to build the makefile, first check if it needs to be rebuild */
- m_pParser->BuildTarget(pLoadedMakefile->m_Makefile);
+ m_pMakefileParser->BuildTarget(pLoadedMakefile->m_Makefile);
pLoadedMakefile->LoadMakefile();
}
It++;
@@ -780,7 +780,7 @@ void DumpVarsAndRules() cout << "Variables of makefile " << (*LoadMakIt)->m_Makefile->GetQuotedFullFileName() << endl;
for (i=0; i<80; i++) cout << "_";
cout << endl;
- (*LoadMakIt)->m_pParser->PrintVariables(true);
+ (*LoadMakIt)->m_pMakefileParser->PrintVariables(true);
cout << endl;
LoadMakIt++;
}
|