aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mhmake/src')
-rw-r--r--tools/mhmake/src/build.cpp4
-rw-r--r--tools/mhmake/src/commandqueue.cpp2
-rw-r--r--tools/mhmake/src/util.cpp25
-rw-r--r--tools/mhmake/src/util.h2
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; i<NrDirs; i++)
{
fileinfo* pDir=Dirs[i];
+ if (pDir->GetName()=="-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 "<<Filename<<endl;
return (mh_pid_t)-1;
}
- string EchoStr=RemoveQuotes(Params.substr(0,Pos-1))+"\n";
+ string EchoStr=RemoveQuotes(Params.substr(0,Pos))+"\n";
if (EchoStr.length()!=fwrite(EchoStr.c_str(),1,EchoStr.length(),pfFile))
{
cerr << "Error writing file "<<Filename<<endl;
diff --git a/tools/mhmake/src/commandqueue.cpp b/tools/mhmake/src/commandqueue.cpp
index 8ca842362..d2d462df6 100644
--- a/tools/mhmake/src/commandqueue.cpp
+++ b/tools/mhmake/src/commandqueue.cpp
@@ -163,7 +163,7 @@ void commandqueue::RemoveActiveEntry(unsigned Entry)
}
}
m_pActiveEntries[Entry]=NULL;
- m_pActiveProcesses[Entry]=NULL;
+ m_pActiveProcesses[Entry]=0;
m_NrActiveEntries--;
}
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
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
{