aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-23 14:19:51 +0000
committermarha <marha@users.sourceforge.net>2009-11-23 14:19:51 +0000
commitf01ad2c4e088fea9f3b6d918d910d7fd17519ade (patch)
tree39dab8036b13e87422975f683b4c0c47517c77ee /tools/mhmake
parent98899a80f02b9616a1038c4c51993435c1074046 (diff)
downloadvcxsrv-f01ad2c4e088fea9f3b6d918d910d7fd17519ade.tar.gz
vcxsrv-f01ad2c4e088fea9f3b6d918d910d7fd17519ade.tar.bz2
vcxsrv-f01ad2c4e088fea9f3b6d918d910d7fd17519ade.zip
Implemented which function.
Diffstat (limited to 'tools/mhmake')
-rw-r--r--tools/mhmake/makefile11
-rw-r--r--tools/mhmake/src/build.cpp2
-rw-r--r--tools/mhmake/src/functions.cpp8
-rw-r--r--tools/mhmake/src/mhmakefileparser.h1
-rw-r--r--tools/mhmake/src/util.cpp1
-rw-r--r--tools/mhmake/src/util.h4
6 files changed, 23 insertions, 4 deletions
diff --git a/tools/mhmake/makefile b/tools/mhmake/makefile
index dbdceb017..504f9af76 100644
--- a/tools/mhmake/makefile
+++ b/tools/mhmake/makefile
@@ -6,7 +6,16 @@ all: debug\mhmake_dbg.exe release\mhmake.exe
DEPS=$(wildcard src\*)
-VCSTUDIO:=vcexpress # choose devenv.com if you have the commercial edition
+ifneq $(which devenv.com),
+VCSTUDIO=devenv.com
+endif
+ifneq $(which vcexpress.exe),
+VCSTUDIO=vcexpress
+endif
+
+ifndef VCSTUDIO
+$(error Environment not set correctly for building Visual Studio projects)
+endif
debug\mhmake_dbg.exe: $(DEPS)
$(VCSTUDIO) $(MHMAKESLNFILE) /build Debug
diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp
index a9437504f..67b5bfffb 100644
--- a/tools/mhmake/src/build.cpp
+++ b/tools/mhmake/src/build.cpp
@@ -295,7 +295,7 @@ found:
#endif
/*****************************************************************************/
-string SearchCommand(const string &Command, const string &Extension="")
+string SearchCommand(const string &Command, const string &Extension)
{
char FullCommand[MAX_PATH]="";
unsigned long Size=sizeof(FullCommand);
diff --git a/tools/mhmake/src/functions.cpp b/tools/mhmake/src/functions.cpp
index 6ba64c3c1..3765bc37c 100644
--- a/tools/mhmake/src/functions.cpp
+++ b/tools/mhmake/src/functions.cpp
@@ -52,6 +52,7 @@ funcdef mhmakefileparser::m_FunctionsDef[]= {
,{"word" ,&mhmakefileparser::f_word}
,{"words" ,&mhmakefileparser::f_words}
,{"strip" ,&mhmakefileparser::f_strip}
+ ,{"which" ,&mhmakefileparser::f_which}
};
map<string,function_f> mhmakefileparser::m_Functions;
@@ -617,6 +618,13 @@ string mhmakefileparser::f_words(const string & Arg) const
}
///////////////////////////////////////////////////////////////////////////////
+// Search for a command in the enivornment path
+string mhmakefileparser::f_which(const string & Arg) const
+{
+ return SearchCommand(Arg);
+}
+
+///////////////////////////////////////////////////////////////////////////////
// Removes leading and trailing space
string mhmakefileparser::f_strip(const string & Arg) const
{
diff --git a/tools/mhmake/src/mhmakefileparser.h b/tools/mhmake/src/mhmakefileparser.h
index 1f321b019..32d4ad88a 100644
--- a/tools/mhmake/src/mhmakefileparser.h
+++ b/tools/mhmake/src/mhmakefileparser.h
@@ -216,6 +216,7 @@ public:
string f_word(const string & Arg) const;
string f_words(const string & Arg) const;
string f_strip(const string & Arg) const;
+ string f_which(const string & Arg) const;
const refptr<fileinfo> GetFirstTarget() const
{
diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp
index a6f042446..0e227989a 100644
--- a/tools/mhmake/src/util.cpp
+++ b/tools/mhmake/src/util.cpp
@@ -256,7 +256,6 @@ refptr<loadedmakefile> LOADEDMAKEFILES::find(const loadedmakefile &ToSearch)
LOADEDMAKEFILES g_LoadedMakefiles;
bool OsExeCommand(const string &Command,const string &Params,bool IgnoreError,string *pOutput);
-string SearchCommand(const string &Command, const string &Extension="");
///////////////////////////////////////////////////////////////////////////////
loadedmakefile::loadedmakefile_statics::loadedmakefile_statics()
diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h
index 2665e0e0c..1634f5135 100644
--- a/tools/mhmake/src/util.h
+++ b/tools/mhmake/src/util.h
@@ -50,7 +50,9 @@
#define PLATFORM "linux"
#endif
-#define MHMAKEVER "1.4.7"
+#define MHMAKEVER "1.4.8"
+
+string SearchCommand(const string &Command, const string &Extension="");
class makecommand
{