From b1565e868d5549753fd710529b88bd4c183889ab Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 25 Jun 2012 09:09:14 +0200 Subject: zlib is now compiled as a dll --- tools/mhmake/genkdev4.sh | 6 +-- tools/mhmake/mhmake.vcxproj | 25 +++++++------ tools/mhmake/mhmake.vcxproj.filters | 13 ++++--- tools/mhmake/src/build.cpp | 7 ++-- tools/mhmake/src/commandqueue.cpp | 6 +-- tools/mhmake/src/commandqueue.h | 10 ++--- tools/mhmake/src/fileinfo.cpp | 2 +- tools/mhmake/src/functions.cpp | 18 ++++----- tools/mhmake/src/mhmakefileparser.cpp | 70 +++++++++++++++-------------------- tools/mhmake/src/mhmakefileparser.h | 10 +++-- tools/mhmake/src/mhmakelexer.l | 27 ++++++++++++-- tools/mhmake/src/mhmakeparser.y | 23 +++++++++++- tools/mhmake/src/rule.h | 2 +- tools/mhmake/src/util.cpp | 35 +++++++----------- tools/mhmake/src/util.h | 2 +- 15 files changed, 142 insertions(+), 114 deletions(-) (limited to 'tools') diff --git a/tools/mhmake/genkdev4.sh b/tools/mhmake/genkdev4.sh index 1acfe13b4..c3b1cbaa5 100755 --- a/tools/mhmake/genkdev4.sh +++ b/tools/mhmake/genkdev4.sh @@ -1,12 +1,12 @@ -mkdir build +[ ! -d build ] && mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. cd .. -mkdir build.dbg +[ ! -d build.dbg ] && mkdir build.dbg cd build.dbg cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug .. cd .. -mkdir .kdev4 +[ ! -d .kdev4 ] && mkdir .kdev4 echo [CMake] > .kdev4/mhmake.kdev4 echo BuildDirs[\$e]=$PWD/build,$PWD/build.dbg >> .kdev4/mhmake.kdev4 diff --git a/tools/mhmake/mhmake.vcxproj b/tools/mhmake/mhmake.vcxproj index 913b03d63..2b395f11f 100644 --- a/tools/mhmake/mhmake.vcxproj +++ b/tools/mhmake/mhmake.vcxproj @@ -413,6 +413,7 @@ + @@ -425,24 +426,24 @@ cmd.exe /c makelex.bat Debug - .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;%(Outputs) + %(RelativeDir)flex.skl + $(IntDir)%(Filename).cpp cmd.exe /c makelex.bat Debug64 .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;%(Outputs) cmd.exe /c makelex.bat Profile - .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;%(Outputs) + %(RelativeDir)flex.skl + $(IntDir)%(Filename).cpp cmd.exe /c makelex.bat Profile64 .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;%(Outputs) cmd.exe /c makelex.bat Release - .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;%(Outputs) + %(RelativeDir)flex.skl + $(IntDir)%(Filename).cpp cmd.exe /c makelex.bat Release64 .\src\flexint.h;.\src\flex.skl;.\src\flexlexer.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;%(Outputs) @@ -450,23 +451,23 @@ cmd.exe /c makebison.bat Debug - .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) + %(RelativeDir)bisondata/bison.m4;%(RelativeDir)bisondata/lalr1.cc;%(RelativeDir)bisondata/c++.m4;%(RelativeDir)bisondata/c.m4;%(RelativeDir)bisondata/location.cc + $(IntDir)%(Filename).cpp;$(IntDir)%(Filename).hpp;$(IntDir)location.hh;$(IntDir)position.hh;$(IntDir)stack.hh cmd.exe /c makebison.bat Debug64 .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) cmd.exe /c makebison.bat Profile - .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) + %(RelativeDir)bisondata/bison.m4;%(RelativeDir)bisondata/lalr1.cc;%(RelativeDir)bisondata/c++.m4;%(RelativeDir)bisondata/c.m4;%(RelativeDir)bisondata/location.cc + $(IntDir)%(Filename).cpp;$(IntDir)%(Filename).hpp;$(IntDir)location.hh;$(IntDir)position.hh;$(IntDir)stack.hh cmd.exe /c makebison.bat Profile64 .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) cmd.exe /c makebison.bat Release - .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) - $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) + %(RelativeDir)bisondata/bison.m4;%(RelativeDir)bisondata/lalr1.cc;%(RelativeDir)bisondata/c++.m4;%(RelativeDir)bisondata/c.m4;%(RelativeDir)bisondata/location.cc + $(IntDir)%(Filename).cpp;$(IntDir)%(Filename).hpp;$(IntDir)location.hh;$(IntDir)position.hh;$(IntDir)stack.hh cmd.exe /c makebison.bat Release64 .\src\bison.cc;.\src\bison.h;%(AdditionalInputs) $(OutDir)%(Filename).cpp;$(OutDir)%(Filename).h;%(Outputs) diff --git a/tools/mhmake/mhmake.vcxproj.filters b/tools/mhmake/mhmake.vcxproj.filters index 77d66e01c..0ec28f785 100644 --- a/tools/mhmake/mhmake.vcxproj.filters +++ b/tools/mhmake/mhmake.vcxproj.filters @@ -2,23 +2,23 @@ - {e9db2f40-4c63-488d-bb89-1eee3e458055} + {bafa54b0-cf70-4114-a02b-5950c0d4d6e3} cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - {bf259917-974f-4378-94e5-126d6d1889e9} + {a92d61c8-68ae-49f8-b843-a793ac9bb6c6} h;hpp;hxx;hm;inl - {5c6c4864-cd40-427e-825a-4a3028933fe0} + {a793606c-0dbc-4f42-9ad8-a61cf7773455} l;y;cpp;h - {06532204-d72c-459e-be81-db8b0725c996} + {e31daf7b-6a21-4a06-ac86-07625e21fd87} cpp;h - {c4505c11-9108-48e9-8d61-6247b696335e} + {bd4cf27c-0b86-4d5c-8dae-963cc3953cbb} ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe @@ -94,6 +94,9 @@ Header Files + + Header Files + diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp index ba6a6e4da..ed9647d17 100644 --- a/tools/mhmake/src/build.cpp +++ b/tools/mhmake/src/build.cpp @@ -497,7 +497,7 @@ mh_pid_t mhmakefileparser::CopyFiles(const string &Params) const if (pSrc->IsDir()) { - SrcFileName+=OSPATHSEPSTR"*"; + SrcFileName+=OSPATHSEPSTR "*"; pSrc=GetFileInfo(SrcFileName,m_MakeDir); } @@ -797,7 +797,7 @@ static void CommandSep(const string &Command, unsigned &EndPos, unsigned &NextBe { continue; } - while (strchr(" \t|<>",Command[NextBegin])) NextBegin++; + while (strchr(" \t|<>",Command[NextBegin])) NextBegin++; } while (strchr(" \t|<>",Command[EndPos])) EndPos--; break; @@ -838,6 +838,7 @@ mh_pid_t mhmakefileparser::OsExeCommand(const string &Command, const string &Par unsigned NextBegin=0; unsigned EndPos=0; CommandSep(ComspecCommandLine,EndPos,NextBegin); + // We have multiple commands so create an temporary batch file FILE *pFile; while (1) @@ -1507,7 +1508,7 @@ mh_time_t mhmakefileparser::StartBuildTarget(fileinfo* pTarget,bool bCheckTarget } ImplicitRuleDepsIt++; } - + IMPLICITRULE::PopRule(ResultIt->second); #ifdef _DEBUG m_ImplicitSearch--; diff --git a/tools/mhmake/src/commandqueue.cpp b/tools/mhmake/src/commandqueue.cpp index 45a1d1043..c8f823b39 100644 --- a/tools/mhmake/src/commandqueue.cpp +++ b/tools/mhmake/src/commandqueue.cpp @@ -80,9 +80,9 @@ commandqueue::commandqueue() : { if (!szProc[cur+1]) { - NrProcs++; + NrProcs++; + } } - } cur++; } } @@ -120,7 +120,7 @@ void commandqueue::SetNrParallelBuilds(unsigned NrParallelBuilds) void commandqueue::ThrowCommandExecutionError(refptr pActiveEntry) { fileinfo* pTarget=pActiveEntry->pTarget; - const string &Command=pActiveEntry->Command; + const string &Command=pActiveEntry->Command; mhmakefileparser *pMakefile=pTarget->GetRule()->GetMakefile(); string ErrorMessage = string("Error running command: ")+ Command +"\n"; diff --git a/tools/mhmake/src/commandqueue.h b/tools/mhmake/src/commandqueue.h index 8b327be8c..815dba643 100644 --- a/tools/mhmake/src/commandqueue.h +++ b/tools/mhmake/src/commandqueue.h @@ -41,11 +41,11 @@ class commandqueue }; private: queue m_Queue; - unsigned m_MaxNrCommandsInParallel; - mh_pid_t *m_pActiveProcesses; - refptr *m_pActiveEntries; - unsigned m_NrActiveEntries; - mh_pid_t m_DummyWaitHandle; + unsigned m_MaxNrCommandsInParallel; + mh_pid_t *m_pActiveProcesses; + refptr *m_pActiveEntries; + unsigned m_NrActiveEntries; + mh_pid_t m_DummyWaitHandle; private: void ThrowCommandExecutionError(refptr pActiveEntry); diff --git a/tools/mhmake/src/fileinfo.cpp b/tools/mhmake/src/fileinfo.cpp index 9f4ae1ca1..884d645b5 100644 --- a/tools/mhmake/src/fileinfo.cpp +++ b/tools/mhmake/src/fileinfo.cpp @@ -257,7 +257,7 @@ string &NormalizePathName(string &Name) if (pLastSlash mhmakefileparser::sm_ParserStack; // Keeps track of the currently active parser string mhmakefileparser::GetFileNameLineNo(void) @@ -93,11 +93,7 @@ bool mhmakefileparser::IsDefined(const string &Var) const bool Ret = m_Variables.find(Var)!=m_Variables.end(); if (!Ret) { - string Env=GetFromEnv(Var); - if (!Env.empty()) - { - Ret=true; - } + GetFromEnv(Var, &Ret); } return Ret; } @@ -185,21 +181,21 @@ inline string mhmakefileparser::ExpandExpression(const string &ExprIn) const char Char=Expr[i++]; if (Char=='$') { - size_t inew=SkipMakeExpr(Expr,i); - i++; - if (inew>i) - { - ToAdd=ExpandMacro(Expr.substr(i,inew-i-1)); - i=inew; - } - else - { - // This is a single character expression - ToAdd=ExpandMacro(string(1,Expr[i-1])); - } - if (ToAdd.find('$')!=string::npos && ToAdd.length()!=1) - { - Recurse=true; + size_t inew=SkipMakeExpr(Expr,i); + i++; + if (inew>i) + { + ToAdd=ExpandMacro(Expr.substr(i,inew-i-1)); + i=inew; + } + else + { + // This is a single character expression + ToAdd=ExpandMacro(string(1,Expr[i-1])); + } + if (ToAdd.find('$')!=string::npos && ToAdd.length()!=1) + { + Recurse=true; } Ret+=ToAdd; } @@ -298,7 +294,7 @@ string mhmakefileparser::ExpandMacro(const string &Expr) const return ExpandExpression(Ret); else return Ret; -} + } } /////////////////////////////////////////////////////////////////////////////// @@ -682,7 +678,7 @@ const refptr mhmakefileparser::GetIncludeDirs() const ((mhmakefileparser*)this)->m_IncludeDirs=Includes; ((mhmakefileparser*)this)->m_pIncludeDirs=refptr(new fileinfoarray); if (Includes.empty()) // If not defined try a default path - Includes="include inc .."OSPATHSEPSTR"include .."OSPATHSEPSTR"inc"; + Includes="include inc .." OSPATHSEPSTR "include .." OSPATHSEPSTR "inc"; const char *pTmp=Includes.c_str(); while (*pTmp) { @@ -774,7 +770,7 @@ void mhmakefileparser::LoadAutoDepsFile(fileinfo *pDepFile) if (!pTarget->CompareMd5_32(0) && !pTarget->CompareMd5_32(Md5_32)) { - MakeNotDirty=false; /* BuildTarget had set the dirty flag, but since the md5 did not change it was a false dirty. This is for BuildTargets called before this routine */ + MakeNotDirty=false; /* BuildTarget had set the dirty flag, but since the md5 did not change it was a false dirty. This is for BuildTargets called before this routine */ #ifdef _DEBUG cout << "Warning: trying to set to different md5's for Target "<GetQuotedFullFileName()<<" Old: "<GetCommandsMd5_32()<<" New: "<::const_iterator pLineFind=m_CommandLineVars.find(Var); if (pLineFind!=m_CommandLineVars.end()) { ((mhmakefileparser*)this)->m_UsedEnvVars.insert(Var); - if (Cache) - ((mhmakefileparser*)this)->m_Variables[Var]=pLineFind->second; + ((mhmakefileparser*)this)->m_Variables[Var]=pLineFind->second; + if (pDefined) *pDefined=true; return pLineFind->second; } const char *pEnv=getenv(Var.c_str()); if (!pEnv) { + if (pDefined) *pDefined=false; return g_EmptyString; } ((mhmakefileparser*)this)->m_UsedEnvVars.insert(Var); - if (Cache) - ((mhmakefileparser*)this)->m_Variables[Var]=pEnv; + ((mhmakefileparser*)this)->m_Variables[Var]=pEnv; + if (pDefined) *pDefined=true; return pEnv; } /////////////////////////////////////////////////////////////////////////////// -// Creates the variable USER_ENVVARS to be saved in the autodeps file +// Creates the variable USED_ENVVARS to be saved in the autodeps file // void mhmakefileparser::CreateUSED_ENVVARS() diff --git a/tools/mhmake/src/mhmakefileparser.h b/tools/mhmake/src/mhmakefileparser.h index 9ad13446c..848329226 100644 --- a/tools/mhmake/src/mhmakefileparser.h +++ b/tools/mhmake/src/mhmakefileparser.h @@ -57,7 +57,7 @@ class mhmakefileparser : public refbase friend class yy::mhmakeparser; private: - static commandqueue sm_CommandQueue; + static commandqueue sm_CommandQueue; static stack sm_ParserStack; // Keeps track of the currently active parser private: fileinfo *m_RuleThatIsBuild; @@ -93,6 +93,7 @@ protected: bool m_RebuildAll; /* true when to rebuild all targets of this makefile */ set m_UsedEnvVars; // Array containing a list of variables that are taken from the environment (This is used for rebuild checking) + set m_EnvVarsToIgnore; // List of env vars that do not have to be taken into account for rebuild checking set m_Exports; // Array containing a list of exported variables in the makefile (This is used for rebuild checking) vector< pair< string, refptr > > m_vPath; #ifdef WIN32 @@ -135,6 +136,9 @@ public: SetVariable("MAKE_VERSION",MHMAKEVER); SetVariable(OBJEXTVAR,OBJEXT); SetVariable(EXEEXTVAR,EXEEXT); + m_EnvVarsToIgnore.insert(WC_REVISION); + m_EnvVarsToIgnore.insert(WC_URL); + m_EnvVarsToIgnore.insert(MAKE); } /* Needed if you only want to use the searchcommand and execommand functions */ @@ -151,7 +155,7 @@ public: bool CompareEnv() const; uint32 CreateEnvMd5_32() const; - string GetFromEnv(const string &Var,bool Cache=true) const; + string GetFromEnv(const string &Var, bool *pDefined=NULL) const; void CreateUSED_ENVVARS(); void SetExport(const string & Var, const string & Val); @@ -350,7 +354,7 @@ public: mh_time_t TargetDate=StartBuildTarget(pTarget,bCheckTargetDir); if (!TargetDate.IsDateValid()) TargetDate=WaitBuildTarget(pTarget); - return TargetDate; + return TargetDate; } void BuildDependencies(const refptr &pRule, fileinfo* pTarget, mh_time_t TargetDate, mh_time_t &YoungestDate, bool &MakeTarget); diff --git a/tools/mhmake/src/mhmakelexer.l b/tools/mhmake/src/mhmakelexer.l index 9dc1a23a0..9b933c305 100644 --- a/tools/mhmake/src/mhmakelexer.l +++ b/tools/mhmake/src/mhmakelexer.l @@ -35,7 +35,7 @@ static uint32 LoadMakMd5(fileinfo *pTarget) return Md5_32; if (1!=fread(&Md5_32,sizeof(Md5_32),1,pFile)) { - fclose(pFile); + fclose(pFile); return Md5_32; } pTarget->SetCommandsMd5_32(Md5_32); @@ -71,7 +71,7 @@ static void ReplaceCurlyBraces(string &String) Pos=0; while ((Pos=String.find_first_of('}',Pos))!=(int)string::npos) String.replace(Pos,1,1,')'); - } + } } #include "mhmakeparser.hpp" @@ -247,6 +247,13 @@ load_makefile { return yy::mhmakeparser::token::SPACE; } + /*---------------------------------------------------------------------------*/ +[ \t]*override[ \t]* { + // override is not supported by mhmake, it is the default behavior + PRINTF(("%s %d: SPACE (ignoring override):\n",m_InputFileName.c_str(),lineno())); + return yy::mhmakeparser::token::SPACE; +} + /*---------------------------------------------------------------------------*/ [ \t]*=[ \t]*\\[ \t\r]*\n[ \t]* { PRINTF(("%s %d: EQUAL: %s\n",m_InputFileName.c_str(),lineno(),yytext)); @@ -297,6 +304,12 @@ load_makefile { return yy::mhmakeparser::token::PEQUAL; } + /*---------------------------------------------------------------------------*/ +\\; { + PRINTF(("%s %d: -Escaped SEMICOLON (STRING): %s\n",m_InputFileName.c_str(),lineno(),yytext)); + yylval->theString=(const char *)yytext+1; + return yy::mhmakeparser::token::STRING; +} /*---------------------------------------------------------------------------*/ [ \t]*;[ \t]*\\[ \t\r]*\n[ \t]* { PRINTF(("%s %d: -SEMICOLON (NEWLINE): %s\n",m_InputFileName.c_str(),lineno(),yytext)); @@ -595,7 +608,7 @@ load_makefile { } /*---------------------------------------------------------------------------*/ -[a-zA-Z]+ /* skip */ +[a-zA-Z]+ /* skip */ /*---------------------------------------------------------------------------*/ [^a-zA-Z\n]+ /* skip */ /*---------------------------------------------------------------------------*/ @@ -631,6 +644,12 @@ load_makefile { return yy::mhmakeparser::token::AUTODEPS; } + /*---------------------------------------------------------------------------*/ +\.ENVVARS_TOIGNORE { + PRINTF(("%s %d: .ENVVARS_TOIGNORE: %s\n",m_InputFileName.c_str(),lineno(),yytext)); + return yy::mhmakeparser::token::ENVVARS_TOIGNORE; +} + /*---------------------------------------------------------------------------*/ export { PRINTF(("%s %d: export: %s\n",m_InputFileName.c_str(),lineno(),yytext)); @@ -842,7 +861,7 @@ export { [^\\\'\r\n$]+ | [\\\$] | -\\\' | +\\\' | \\# { yymore(); } diff --git a/tools/mhmake/src/mhmakeparser.y b/tools/mhmake/src/mhmakeparser.y index 847cda48a..d8edb1d51 100644 --- a/tools/mhmake/src/mhmakeparser.y +++ b/tools/mhmake/src/mhmakeparser.y @@ -53,7 +53,7 @@ const char Test[]="dit is een test"; %token COMMAND %token COMMA %token STRING DOLLAREXPR EQUAL COLON DOUBLECOLON VARDEF VARVAL -%token IMEQUAL PEQUAL OPTEQUAL PHONY AUTODEPS EXPORT NEWLINE INCLUDEMAK SPACE VPATH +%token IMEQUAL PEQUAL OPTEQUAL PHONY AUTODEPS EXPORT NEWLINE INCLUDEMAK SPACE VPATH ENVVARS_TOIGNORE %type expression nonspaceexpression simpleexpression %type maybeemptyexpression @@ -92,6 +92,7 @@ statement: NEWLINE | ruledef | phonyrule | autodepsrule | + envvarstoignorerule | varassignment | imvarassignment | pvarassignment | @@ -179,6 +180,26 @@ autodepsrule: AUTODEPS COLON expression NEWLINE ; +envvarstoignorerule: ENVVARS_TOIGNORE COLON expression + { + string VarsStr=m_pMakefile->ExpandExpression($3); + PRINTF(("Defining envvarstoignore rule : %s\n",$3.c_str())); + PRINTF((" Expanded to : %s\n",m_pMakefile->ExpandExpression($3).c_str())); + const char *pTmp=VarsStr.c_str(); + while (*pTmp) + { + string Var; + pTmp=NextItem(pTmp,Var); + if (!Var.empty()) + { // Add it to the list of env vars to ignore + m_pMakefile->m_EnvVarsToIgnore.insert(Var); + } + } + } + NEWLINE +; + + exportrule: EXPORT space exportstrings NEWLINE | EXPORT space STRING EQUAL maybeemptyexpression { diff --git a/tools/mhmake/src/rule.h b/tools/mhmake/src/rule.h index 7cc287600..04827b129 100644 --- a/tools/mhmake/src/rule.h +++ b/tools/mhmake/src/rule.h @@ -82,7 +82,7 @@ class IMPLICITRULE static set m_ImplicitRuleRecurseDetStack; static vector m_ImplicitRules; // Use a vector and not a map because the order of the implicit rules is important public: - static void AddImplicitRule(fileinfo *pTarget,const vector &Deps, refptr pRule); + static void AddImplicitRule(fileinfo *pTarget,const vector &Deps,refptr pRule); static void SearchImplicitRule(const fileinfo *pTarget, implicitruledep_t &Result); static void PrintImplicitRules(); static bool PushRule(rule *pRule) diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp index 3e20706dd..9fe006e95 100644 --- a/tools/mhmake/src/util.cpp +++ b/tools/mhmake/src/util.cpp @@ -650,27 +650,7 @@ void loadedmakefile::LoadMakefile() } else { - /* Create a file that is depending on the makefile name and the arguments */ - md5_context ctx; - - md5_starts( &ctx ); - - map::const_iterator pIt=m_CommandLineVars.begin(); - while (pIt!=m_CommandLineVars.end()) - { - if (pIt->first!="MAKE") - { - md5_update(&ctx, (uint8*)pIt->first.c_str(), pIt->first.size()); - md5_update(&ctx, (uint8*)pIt->second.c_str(), pIt->second.size()); - } - pIt++; - } - md5_update(&ctx, (uint8*)m_Makefile->GetFullFileName().c_str(), m_Makefile->GetFullFileName().size()); - - char ID[10]; - sprintf(ID,"_%lx",md5_finish32( &ctx)); - - pDepFile=GetFileInfo(string(".") + m_Makefile->GetName()+ ".dep"+ID,m_MakeDir); + pDepFile=GetFileInfo(string(".") + m_Makefile->GetName()+ ".dep",m_MakeDir); m_pMakefileParser->SetVariable(AUTODEPFILE,pDepFile->GetQuotedFullFileName()); } @@ -683,10 +663,12 @@ void loadedmakefile::LoadMakefile() { throw string("Error parsing ")+m_Makefile->GetQuotedFullFileName(); } + + fileinfo *pMaybeNewDepFile=GetFileInfo(m_pMakefileParser->ExpandVar(AUTODEPFILE),m_MakeDir); #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_pMakefileParser->ExpandVar(AUTODEPFILE)!=pDepFile->GetQuotedFullFileName()) + if (pMaybeNewDepFile!=pDepFile) { cout << "\n\nWARNING:\n makefile '"<< m_Makefile->GetQuotedFullFileName() <<"' re-defines AUTODEPFILE\n from '"<< pDepFile->GetQuotedFullFileName() <<"'\n to '"<< m_pMakefileParser->ExpandVar(AUTODEPFILE) << "'\n (may cause needless rebuilds when having rules for included makefiles!!!!!)\n\n\n"; @@ -700,6 +682,15 @@ void loadedmakefile::LoadMakefile() cout<<"No First target for "<GetQuotedFullFileName()<Exists()) + m_pMakefileParser->LoadAutoDepsFile(pDepFile); /* If it already exists, load it. */ + } + m_pMakefileParser->UpdateDate(m_Makefile->GetDate()); if (sm_Statics.m_MhMakeConf) diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h index b4a17a6cf..e7f9ccf57 100644 --- a/tools/mhmake/src/util.h +++ b/tools/mhmake/src/util.h @@ -50,7 +50,7 @@ #define PLATFORM "linux" #endif -#define MHMAKEVER "3.0.15" +#define MHMAKEVER "3.0.19" class makecommand { -- cgit v1.2.3