Thursday, November 03, 2011

Matlab relative path issue in prj and MWArray.dll nightmare on Windows 7 64 bit

Whenever you want to create a deployment project, you obviously would like to add it to source control repository for others to use..... But you will face a major issue...
The main problem is that the .prj file which deploytool creates contains absolute paths which will not work on other computers!. This is really bad to see that this is still the case in MatLab R2011a.... Really! So I decided to use Visual Studio 2005 vcproj file to maintain my deployment project because Visual Studio 2005 project support relative path pretty damn well! Thank you Microsoft Visual Studio Team!. I decided to create a WIN32 utility using MFC to convert the relative path to absolute path using the vcproj file and generate a Matlab PRJ file. In my case I am targetting C# .Net Assembly. Here is the source code!


#define _CRT_SECURE_NO_DEPRECATE
#include "stdafx.h"
#include "vcproj2matlabprj.h"
#include
#include
#include
#include
#include
#include "xmlParser.h"
#include "win32utility.h"

CString RelativePathToAbsolutePath(LPCTSTR contentRelativePath,LPCTSTR rootPath, BOOL &bRelativePathToParentFolders);

void PrintFileName(XMLNode xNode,LPCTSTR pszRootFolder);

FILE *_pOutMakeFile = NULL;


#if !defined (WIN32)
#define _strdup strdup
#endif

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
CString strRootFolder;
CString strVCProjShortFilename;
CString csPath;
CString csFilenameNoExt;
CString csExtension;
CString strVCProj;
CString strMathlabProj;
CString strMathLabRootPath;
CString strClassName;
CString strNamespace;

if ( argc < 4 )
{
printf("Usage: %s [MathLab 2011a RootPath EG: \"C:\\MATLAB\\R2011a\"]\n",argv[0]);
return 1;
}

XMLNode xMainNode=XMLNode::openFileHelper(argv[1],"VisualStudioProject");

strRootFolder = CString(argv[1]);
strMathlabProj = CString(argv[2]);
GetPathFromFileName(strRootFolder);

strVCProj = CString(argv[1]);
strVCProjShortFilename = CString(argv[1]);
strMathLabRootPath = CString(argv[3]);

GetFileNameComponents(strMathlabProj, // in
csPath, csFilenameNoExt, csExtension); // out


if ( xMainNode.isEmpty() )
{
printf("Not valid input file [%s]\n", argv[1]);
return 2;
}

XMLNode xNode;

xNode = xMainNode.getChildNode("Configurations");

// Try to open output file
_pOutMakeFile = fopen(argv[2],"w");
if ( _pOutMakeFile == NULL )
{
printf("Can not open output file [%s]\n", argv[2]);
return 3;
}

// Generate Header
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n",csFilenameNoExt.GetBuffer(0),csPath.GetBuffer(0),strMathlabProj.GetBuffer(0));
fprintf(_pOutMakeFile,"%s\n",strMathlabProj.GetBuffer(0));
fprintf(_pOutMakeFile,".NET Assembly\n");
fprintf(_pOutMakeFile,"%s\n",csFilenameNoExt.GetBuffer(0));
fprintf(_pOutMakeFile,"${PROJECT_ROOT}\\%s\\src\n",csFilenameNoExt.GetBuffer(0));
fprintf(_pOutMakeFile,"${PROJECT_ROOT}\\%s\\distrib\n",csFilenameNoExt.GetBuffer(0));
fprintf(_pOutMakeFile,"true\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"all\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"on\n");
fprintf(_pOutMakeFile,"on\n");
fprintf(_pOutMakeFile,"on\n");
fprintf(_pOutMakeFile,"on\n");
fprintf(_pOutMakeFile,"on\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"option.net.framework.default\n");
fprintf(_pOutMakeFile,"option.assembly.type.private\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
strNamespace = csFilenameNoExt;
strNamespace.MakeUpper();
fprintf(_pOutMakeFile,"%s\n",strNamespace.GetBuffer(0));
strClassName = csFilenameNoExt;
fprintf(_pOutMakeFile,"C%s\n",strClassName.GetBuffer(0));
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n",strClassName.GetBuffer(0));

// Print list of files
xNode = xMainNode.getChildNode("Files");
PrintFileName(xNode,strRootFolder);

fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"%sdistrib\\%sNative.dll\n",csFilenameNoExt.GetBuffer(0),csFilenameNoExt.GetBuffer(0),strRootFolder.GetBuffer(0),csFilenameNoExt.GetBuffer(0));
fprintf(_pOutMakeFile,"%sdistrib\\%s.dll\n",csFilenameNoExt.GetBuffer(0),csFilenameNoExt.GetBuffer(0),strRootFolder.GetBuffer(0),csFilenameNoExt.GetBuffer(0));
fprintf(_pOutMakeFile,"%sdistrib\\readme.txt\n",csFilenameNoExt.GetBuffer(0),strRootFolder.GetBuffer(0));
fprintf(_pOutMakeFile,"%sdistrib\\%s_overview.html\n",csFilenameNoExt.GetBuffer(0),csFilenameNoExt.GetBuffer(0),strRootFolder.GetBuffer(0),csFilenameNoExt.GetBuffer(0));
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"%s\n",strMathLabRootPath.GetBuffer(0));
fprintf(_pOutMakeFile,"\n");
//fprintf(_pOutMakeFile,"C:\\My Documents\\MATLAB\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\general\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\ops\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\lang\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\elmat\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\randfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\elfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\specfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\matfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\datafun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\polyfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\funfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\sparfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\scribe\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\graph2d\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\graph3d\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\specgraph\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\graphics\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\uitools\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\strfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\imagesci\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\iofun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\audiovideo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\timefun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\datatypes\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\verctrl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\codetools\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\helptools\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\winfun\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\winfun\\NET\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\demos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\timeseries\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\hds\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\guide\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\plottools\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\local\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\matlab\\datamanager\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\simulink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\instrument\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\coder\\matlabcoder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simulink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simulink\\slresolve\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\blocks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\components\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\fixedandfloat\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\fixedandfloat\\obsolete\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simdemos\\aerospace\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simdemos\\automotive\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simdemos\\industrial\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simdemos\\simfeatures\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simdemos\\simgeneral\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\dee\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\glue\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\glue\\studio\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\dastudio\\depviewer\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\stateflow\\stateflow\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simulink\\MPlayIO\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simulink\\dataobjectwizard\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\hdlshared\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\asap2\\asap2\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\asap2\\asap2\\user\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\common\\can\\blocks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\common\\tgtcommon\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\connectivity\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\pil\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\shared\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtw\\datadiff\\GUI\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtw\\datadiff\\GUI\\Icons\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtw\\datadiff\\API\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtw\\cgv\\API\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtw\\misra\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulinkcoder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\accel\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\blocks\\library\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\blocks\\obsolete\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\fixedandfloat\\fxpdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simulink\\modeladvisor\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\simulink\\modeladvisor\\fixpt\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\stateflow\\sfdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\stateflow\\coder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\adivdsp\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\adivdsp\\vdspdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\adivdsp\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\adivdsp\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\adivdsp\\vdspblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\adivdsp\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\aero\\aero\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\mapgeodesy\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\aero\\astdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\asynciolib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\AUTOSAR\\AUTOSAR\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\blackfin\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\blackfin\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\blackfin\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\blackfin\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\blackfin\\blackfindemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\c166\\c166\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\c166\\blocks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\c166\\c166demos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\foundation\\utils\\resource_config\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\can\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\can\\canblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\can\\canmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\can\\canmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\cgir_fe\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\coder\\codegendemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\coder\\emlcodermex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\coder_foundation\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\simtargets\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\coder\\coder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\comm\\comm\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\comm\\commutilities\\comminit\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\comm\\commutilities\\commmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\comm\\commutilities\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\comm\\commdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\comm\\commdeprecated\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\help\\toolbox\\comm\\examples\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\testconsole\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\comparisons\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\compiler\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\compiler\\compilerdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\control\\control\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\control\\ctrlguis\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\control\\ctrlobsolete\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\control\\ctrlutil\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\control\\ctrldemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\help\\toolbox\\control\\examples\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\controllib\\engine\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\controllib\\engine\\options\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\controllib\\engine\\optim\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\controllib\\general\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\controllib\\graphics\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\controllib\\requirements\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\curvefit\\curvefit\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\curvefit\\splines\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\curvefit\\cftoolgui\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\curvefit\\sftoolgui\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\curvefit\\curvefitdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\optimlib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\daq\\daq\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\daq\\daqguis\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\daq\\daqdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\daq\\daqblks\\daqblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\daq\\daqblks\\daqmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\daq\\daqblks\\daqmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\dastudio\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\des\\desblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\des\\desmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\des\\desmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\des\\desdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\distcomp\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\user\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\mpi\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\pctdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\parallel\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\parallel\\util\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\lang\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\cluster\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\distcomp\\gpu\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dotnetbuilder\\dotnetbuilder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dotnetbuilder\\dotnetbuilderdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dsp\\dsp\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dsp\\dsputilities\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dsp\\dsputilities\\dspinit\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dsp\\dsputilities\\dspmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dsp\\dspdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\filterdesignlib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\system\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\dspblks\\dspblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\dspblks\\dspmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\fixedpoint\\fixedpoint\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\help\\toolbox\\dsp\\examples\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\dsp\\filterdesign\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\eclipseide\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\eclipseide\\eclipseidedemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\eclipseide\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\eclipseide\\registry\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\eclipseide\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\edalink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\foundation\\hdllink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\modelsim\\modelsim\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\modelsim\\modelsimdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\incisive\\incisive\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\incisive\\incisivedemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\discovery\\discovery\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\discovery\\discoverydemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\tlmgenerator\\foundation\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\tlmgenerator\\foundation\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\tlmgenerator\\foundation\\tlmgeneratordemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\eda\\edagraph\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\eda\\fil\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\eda\\fil\\fildemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\eda\\fpgaautomation\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\eda\\hdlparser\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\ecoder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\ecoder\\ecoderdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpt\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpt\\mpt\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpt\\user_specific\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\embeddedcoder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\eml\\eml\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\exlink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\fixedpoint\\fidemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\fixedpoint\\fixedpointtool\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\spcuilib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\siglib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\fixpoint\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\fixpoint\\fpca\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\edalink\\extensions\\fpgaautomation\\fpgademos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ghsmulti\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ghsmulti\\multidemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ghsmulti\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ghsmulti\\multiblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ghsmulti\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ghsmulti\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\hdlcoder\\hdlcoder\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\hdlcoder\\hdlcoder\\hdlwa\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\hdlcoder\\hdlcoderdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\hdlfilter\\hdlfilter\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\hdlfilter\\hdlfiltdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\iarew\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\iarew\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\iarew\\iarewdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\iarew\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\iarew\\templates\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\hookpoints\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\tgtpref2\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\profiler\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\blks\\tlc_c\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\pjtgenerator\\blks\\utils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\autointerface\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\autointerface\\ideregisterplugins\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\util\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\errorhandler\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\lfsocket\\lfsocket\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\foundation\\xmakefile\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\idelinkdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\ident\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\nlident\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\idobsolete\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\idguis\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\idutils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\iddemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\iddemos\\examples\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\ident\\idhelp\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\images\\colorspaces\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\images\\images\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\images\\imdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\images\\imuitools\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\images\\iptformats\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\images\\iptutils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\imageslib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\imaq\\imaq\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\imaqlib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\imaq\\imaqdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\imaq\\imaqblks\\imaqblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\imaq\\imaqblks\\imaqmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\imaq\\imaqblks\\imaqmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\instrument\\instrument\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\instrument\\instrumentdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\instrument\\instrumentblks\\instrumentblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\instrument\\instrumentblks\\instrumentmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\instrument\\instrumentblks\\instrumentmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\sam\\m3i\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slvnv\\simcoverage\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\\common\\configuration\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\\mpc555demos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\\mpc555dk\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\\pil\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\\rt\\blockset\\mfiles\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\mpc555dk\\rt\\blockset\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\optim\\optim\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\optim\\optimdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\data_manager\\data_manager\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\equation_language\\equation_language\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\foundation\\foundation\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\gl\\core\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\gl\\sli\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\logging\\base\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\logging\\mli\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\network_engine\\ne_support\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\network_engine\\network_engine\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\ne_sli\\ne_sli\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\pmir\\pmir\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\pm_sli\\pm_sli\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\powersys\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\DR\\DR\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\drives\\drives\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\facts\\facts\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\DR\\DRdemo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\drives\\drivesdemo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\facts\\factsdemo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\powersys\\powerdemo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\compiler\\core\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\compiler\\sli\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\simscapedemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\engine\\core\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\engine\\mli\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\engine\\sli\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\foundation\\simscape\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape_language\\simscape_language\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\library\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simscape\\simscape\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\simulation\\base\\m\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\physmod\\unit_manager\\unit_manager\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slvnv\\reqmgt\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slvnv\\slvnv\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slvnv\\rmidemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rf\\rf\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rf\\rfdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rf\\rftool\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rfblks\\rfblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rfblks\\rfblksmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rfblks\\rfblksmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rfblks\\rfblksdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgen\\rptgen\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgen\\rptgenv1\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgen\\rptgendemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgenext\\rptgenext\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgenext\\rptgenextv1\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgenext\\rptgenextdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\rptgen\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\rtwin\\rtwin\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\rtwin\\rtwindemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtwdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\rtwdemos\\rsimdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simulink\\blocks\\sb2sl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\eml\\eml\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\sigbldr\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\slcontrollib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\signal\\signal\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\signal\\sigtools\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\signal\\sptoolgui\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\signal\\sigdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simrf\\simrf\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simrf\\simrfmasks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\simrf\\simrfdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\help\\toolbox\\simrf\\examples\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\sl3d\\sl3d\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\sl3d\\sl3ddemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slcontrol\\slcontrol\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slcontrol\\slctrlguis\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slcontrol\\slctrlutil\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slcontrol\\slctrldemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\slcontrol\\slctrlobsolete\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\sldv\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\slvnv\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgenext\\slxmlcomp\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\stats\\stats\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\stats\\statsdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\stats\\classreg\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\statslib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\symbolic\\symbolic\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\symbolic\\symbolicdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\targetdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\foundation\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\foundation\\utils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\foundation\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\foundation\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\foundation\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\\utils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic2000\\tic2000demos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\utils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\blks\\sysobj_mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic6000\\tic6000demos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\linux\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\linux\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\linux\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\linux\\src\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\vxworks\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\vxworks\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\vxworks\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\vxworks\\src\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\windows\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\windows\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\operatingsystem\\windows\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\intelhost\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\\ti\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\\ti\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\\ti\\utils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\\ti\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\\ti\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\shared\\ti\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\etargets\\etargets\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\etargets\\etargets\\demoutils\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\testmeaslib\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\tasking\\tasking\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\tasking\\taskingdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rtw\\targets\\tasking\\tasking\\taskingblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\testmeaslib\\general\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\testmeaslib\\graphics\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\shared\\testmeaslib\\simulink\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic5000\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic5000\\blks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic5000\\blks\\mex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic5000\\blks\\masks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\target\\extensions\\processor\\tic5000\\tic5000demos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\ccsblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\ccsdemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\ccsdemos\\util\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\ccslinkblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\ccslinkblks\\rtdxsimblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\lic\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\tfl\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\util\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\rtw\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\ticcs\\envChecker\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\vision\\vision\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\vision\\visionutilities\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\vision\\visionutilities\\visioninit\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\vision\\visionutilities\\visionmex\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\vision\\visiondemos\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\help\\toolbox\\vision\\examples\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\wavelet\\wavelet\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\wavelet\\wmultisig1d\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\wavelet\\wavedemo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\wavelet\\compression\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\wrworkbench\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\wrworkbench\\mdlinfo\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\wrworkbench\\registry\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\idelink\\extensions\\wrworkbench\\wrworkbenchblks\n");
fprintf(_pOutMakeFile,"${MATLAB_ROOT}\\toolbox\\rptgen\\xmlcomp\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"true\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"true\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"5.1\n");
fprintf(_pOutMakeFile,"true\n");
fprintf(_pOutMakeFile,"false\n");
fprintf(_pOutMakeFile,"win32\n");
fprintf(_pOutMakeFile,"true\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"
\n");
fprintf(_pOutMakeFile,"
\n\n");
}

return nRetCode;
}

void PrintFileName(XMLNode xParentNode, LPCTSTR pszRootFolder)
{
CString strRootFolder = pszRootFolder;

int n=xParentNode.nChildNode();
for( int i = 0; i < n; i ++ )
{
XMLNode xNode = xParentNode.getChildNode(i);
if ( !strcmp(xNode.getName(), "File" ) )
{
const char *pcFileName = xNode.getAttribute("RelativePath");
char *pcNewStr = _strdup(pcFileName );

// Find the file extension
char *ext = strrchr(pcNewStr, '.');
if ( NULL != ext && !strcmp(ext, ".m"))
{
CString strFullFilename;
BOOL bRelativePathToParentFolders;
CString strRelativePath = pcNewStr;

if (IsCurrentDirPath(&strRelativePath))
{
CString strSubPath;
// remove .\ and append path
int pos = strRelativePath.Find("\\");
int len = strRelativePath.GetLength();
if ( pos > 0 ) {
strSubPath = strRelativePath.Right(len-pos-1);
}
// append
strFullFilename = strRootFolder + strSubPath;
}
else
{
strFullFilename = RelativePathToAbsolutePath(strRelativePath,strRootFolder, bRelativePathToParentFolders);
}

fprintf(_pOutMakeFile,"%s\n", strFullFilename.GetBuffer(0) );
}

free( pcNewStr );
}
else
{
PrintFileName(xNode,strRootFolder);
}
}
}


CString RelativePathToAbsolutePath(LPCTSTR contentRelativePath,LPCTSTR rootPath, BOOL &bRelativePathToParentFolders)
{
CString strContentPath;
CString strFullPath;
CString tempPath = _T("");

strContentPath.Format(_T("%s"),contentRelativePath);
tempPath.Format(_T("%s"),contentRelativePath);

// First let's convert to the right kind of path seps:
strContentPath.Replace('/', PATH_SEPARATOR);
CString fullPath = rootPath;
int sepIndex = fullPath.ReverseFind(PATH_SEPARATOR);

// put those together, and we've got our full path
if (sepIndex >= 0)
{
BOOL gotPath = FALSE;
CString strAbsoluteFullPath;
bool bRelativeUp = false;

CString beginStr = strContentPath.Left(3);
bRelativeUp = ( beginStr.CompareNoCase(REL_PATH_STR_WIN) == 0 || beginStr.CompareNoCase(REL_PATH_STR_MAC) == 0 || beginStr.CompareNoCase(REL_PATH_STR_UNIX) == 0 );
bRelativePathToParentFolders = bRelativeUp;

strFullPath = fullPath.Left(sepIndex + 1);

if (!strContentPath.IsEmpty() && strFullPath != contentRelativePath && bRelativeUp) {
CString extension;
int period = strContentPath.ReverseFind('.');
if ( period >= 0 )
extension = strContentPath.Right(strContentPath.GetLength()-period-1);

if ( (extension.GetLength() == 3) || (extension.GetLength() == 1)) {
//strContentPath.Replace(_T("..\\"), _T(".\\"));
CreateFullPath(&strAbsoluteFullPath, strFullPath, strContentPath);
strFullPath = strAbsoluteFullPath;
strFullPath.Replace('/', PATH_SEPARATOR);

gotPath = FileExist(strFullPath);
if (gotPath)
return strFullPath;
else
return CString(_T(""));

}
else
return CString(_T(""));
}
else
{
int sepIndex = strContentPath.ReverseFind(PATH_SEPARATOR);
if (sepIndex >= 0) {
// We have a full path already
gotPath = FileExist(strContentPath);
if (gotPath)
return strContentPath;
}

// We have a relative path (subfolder)
CString extension = _T("");
int period = strContentPath.ReverseFind('.');
if ( period >= 0 )
extension = strContentPath.Right(strContentPath.GetLength()-period-1);

if (extension.GetLength() == 3) {
// single file name no sub folder
strFullPath = strFullPath + strContentPath;
gotPath = FileExist(strFullPath);
if (gotPath)
return strFullPath;
else
return CString(_T(""));
}
}
}
else
{
strFullPath = fullPath;
}

strFullPath += tempPath;

return strFullPath;
}

This will solve the following issue :)

http://stackoverflow.com/questions/1790417/matlab-deployment-add-files-to-source-control

Now let's look at a sample Matlab script which can be converted to an assembly.

Follow the following link

http://www.mathworks.com/matlabcentral/fileexchange/12987-integrating-matlab-with-c

There is a big problem when targeting .NET 4.0 for a client referencing a generated assembly targeting .NET 4.0 as far as I am concerned which should be fixed ASAP by Mathworks. This problem still remains with Matlab R2011a.
A C# client targeting .NET 4.0 will not run on Windows 7 64 bit. When the C# client will try to instantiate the class wrapper for the generated Matlab assembly using new, an exception will be thrown. Only 32 bit OS such as the old Windows XP will support both the .NET Framework 2.0 and 4.0. But not Windows 7 64 bit running as 32 bit. There is a dependency with .NET 2.0 for MWArray.dll at least I can't find the v4 version anywhere under C:\MATLAB\R2011a. Because .NET Framework 2.0 won't install on Windows 7 64 bit, I highly request the Mathworks folks to release MWArray.dll for .NET 4.0 and create a dependency with the 4.0 version when building the assembly. I always check target 4.0 but the dependency is still the 2.0. Maybe this is a fallback and I am missing the 4.0 version or maybe it is not supported.

Deployment Runtime

http://www.mathworks.com/help/toolbox/compiler/f12-999353.html


Thanks!

No comments: