From 88a78ebea08af461224f815a8380ea5c54186f43 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 29 Apr 2011 09:58:14 +0000 Subject: Solved problem if last character not echoed in echo command. Solved linux warning Added option to disable checking of start directory. --- tools/mhmake/src/build.cpp | 4 +++- tools/mhmake/src/commandqueue.cpp | 2 +- tools/mhmake/src/util.cpp | 25 +++++++++++++++++-------- tools/mhmake/src/util.h | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp index 5976a8632..f8f341753 100644 --- a/tools/mhmake/src/build.cpp +++ b/tools/mhmake/src/build.cpp @@ -393,6 +393,8 @@ mh_pid_t mhmakefileparser::MakeDirsCommand(const string &Params) const for (size_t i=0; iGetName()=="-p") + continue; if (!MakeDirs(pDir)) return (mh_pid_t)-1; } @@ -451,7 +453,7 @@ mh_pid_t mhmakefileparser::EchoCommand(const string &ParamsIn) const cerr << "Error opening file "<] [targets]+\n" #ifdef _DEBUG "\ [-p] [-n] [-e] [-l] [-w] [-d] [-CD] [-m] [-b]\n" @@ -57,6 +57,8 @@ Usage: mhmake [-f ] [-[c|C] ] [=]\n\ : Value of the variable\n\ -a : Rebuild all targets\n\ -s : Rescan automatic dependencies\n\ + -S : SKip checking if mhmake is started in a subdirectory of the\n\ + %MHMAKECONF dir \n\ -v : Print version information\n\ -q : Quiet. Disable all output \n\ -P :\n\ @@ -104,6 +106,7 @@ bool g_PrintMultipleDefinedRules=false; bool g_Quiet=false; bool g_RebuildAll=false; bool g_ForceAutoDepRescan=false; +bool g_SkipMhMakeConfDirCheck=false; const string g_EmptyString; const string g_SpaceString(" "); @@ -494,6 +497,9 @@ loadedmakefile::loadedmakefile(const fileinfo *pDir, vector &Args,const case 's': g_ForceAutoDepRescan=true; break; + case 'S': + g_SkipMhMakeConfDirCheck=true; + break; case 'v': PrintVersionInfo(); break; @@ -572,14 +578,17 @@ loadedmakefile::loadedmakefile(const fileinfo *pDir, vector &Args,const m_MakeDir=curdir::GetCurDir(); /* This means that this is the main makefile given on the command line, so we take the current directory */ } - if (loadedmakefile::sm_Statics.m_MhMakeConf) + if (!g_SkipMhMakeConfDirCheck) { - const string &RootDir=loadedmakefile::sm_Statics.m_MhMakeConf->GetFullFileName(); - string MakeDir=m_MakeDir->GetFullFileName(); - if (RootDir.length()>MakeDir.length() || _strnicmp(RootDir.c_str(),MakeDir.c_str(),RootDir.length())) + if (loadedmakefile::sm_Statics.m_MhMakeConf) { - cerr<<"mhmake needs to run in a directory that is a subdirectory of the directory specified with %MHMAKECONF : "<GetFullFileName()<GetFullFileName(); + string MakeDir=m_MakeDir->GetFullFileName(); + if (RootDir.length()>MakeDir.length() || _strnicmp(RootDir.c_str(),MakeDir.c_str(),RootDir.length())) + { + cerr<<"mhmake needs to run in a directory that is a subdirectory of the directory specified with %MHMAKECONF : "<GetFullFileName()<GetFullFileName().c_str(),S_IRWXU)) { - cerr << "mkdir function failed for directory " << QuoteFileName(pDir->GetFullFileName()) << endl; + cerr << "mkdir function failed for directory " << QuoteFileName(pDir->GetFullFileName()) << endl; return false; } pDir->InvalidateDate(); // Directory created successfully, so invalidate the date diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h index 044ac0143..694012cea 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.1" +#define MHMAKEVER "3.0.4" class makecommand { -- cgit v1.2.3