diff options
author | marha <marha@users.sourceforge.net> | 2011-04-29 09:58:14 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-29 09:58:14 +0000 |
commit | 88a78ebea08af461224f815a8380ea5c54186f43 (patch) | |
tree | 54360a8cf75f48f1604d16d6cacbe72c9d0fec33 /tools/mhmake/src/util.cpp | |
parent | 534bc3bc51bbb79d45bcfa1254ca3f6c5d282cbe (diff) | |
download | vcxsrv-88a78ebea08af461224f815a8380ea5c54186f43.tar.gz vcxsrv-88a78ebea08af461224f815a8380ea5c54186f43.tar.bz2 vcxsrv-88a78ebea08af461224f815a8380ea5c54186f43.zip |
Solved problem if last character not echoed in echo command.
Solved linux warning
Added option to disable checking of start directory.
Diffstat (limited to 'tools/mhmake/src/util.cpp')
-rw-r--r-- | tools/mhmake/src/util.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp index 2ff5a03f3..20f85adbe 100644 --- a/tools/mhmake/src/util.cpp +++ b/tools/mhmake/src/util.cpp @@ -44,7 +44,7 @@ typedef struct { static char s_UsageString[]=
"\
Usage: mhmake [-f <Makefile>] [-[c|C] <RunDir>] [<Var>=<Value>]\n\
- [-a] [-q] [-s] [-v] [-P <Nr Parallel Builds>] [targets]+\n"
+ [-a] [-q] [-s] [-S] [-v] [-P <Nr Parallel Builds>] [targets]+\n"
#ifdef _DEBUG
"\
[-p] [-n] [-e] [-l] [-w] [-d] [-CD] [-m] [-b]\n"
@@ -57,6 +57,8 @@ Usage: mhmake [-f <Makefile>] [-[c|C] <RunDir>] [<Var>=<Value>]\n\ <Value> : 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 <Nr Parallel Builds> :\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<string> &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<string> &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 : "<<RootDir<<", make dir : "<<m_MakeDir->GetFullFileName()<<endl;
- exit(1);
+ 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()))
+ {
+ cerr<<"mhmake needs to run in a directory that is a subdirectory of the directory specified with %MHMAKECONF : "<<RootDir<<", make dir : "<<m_MakeDir->GetFullFileName()<<endl;
+ exit(1);
+ }
}
}
}
@@ -758,7 +767,7 @@ bool MakeDirs(fileinfo *pDir) { /* Create directory */
if (-1==mkdir(pDir->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
|