aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mhmake/src/functions.cpp')
-rw-r--r--tools/mhmake/src/functions.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/mhmake/src/functions.cpp b/tools/mhmake/src/functions.cpp
index 1071d2604..7393035cf 100644
--- a/tools/mhmake/src/functions.cpp
+++ b/tools/mhmake/src/functions.cpp
@@ -41,6 +41,7 @@ funcdef mhmakefileparser::m_FunctionsDef[]= {
,{"dir", &mhmakefileparser::f_dir}
,{"shell", &mhmakefileparser::f_shell}
,{"relpath", &mhmakefileparser::f_relpath}
+ ,{"realpath", &mhmakefileparser::f_realpath}
,{"toupper", &mhmakefileparser::f_toupper}
,{"tolower", &mhmakefileparser::f_tolower}
,{"exist", &mhmakefileparser::f_exist}
@@ -829,6 +830,24 @@ string mhmakefileparser::f_relpath(const string & FileNames) const
}
///////////////////////////////////////////////////////////////////////////////
+static string realpath(const string &FileName,void *pvDir)
+{
+ const fileinfo *pDir=*(const fileinfo **)pvDir;
+ const fileinfo *pPath=GetFileInfo(FileName,pDir);
+ if (pPath->Exists())
+ return pPath->GetQuotedFullFileName();
+ else
+ return "";
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Make a path name relative to the current directory
+string mhmakefileparser::f_realpath(const string & FileNames) const
+{
+ return IterList(ExpandExpression(FileNames),realpath,(void*)&m_MakeDir);
+}
+
+///////////////////////////////////////////////////////////////////////////////
static string makeupper(const string &FileName,void *)
{
string Ret=FileName;