1 function compileMex(varargin)
3 roboRoot = varargin{1};
5 roboRoot = getpref(
'robochameleon',
'roboRootFolder',
'NULL');
6 if strcmp(roboRoot,
'NULL')
7 error('A folder must be specified or "
robochameleon" must be run before');
10 fileList = getAllFiles(roboRoot);
11 for i=1:length(fileList)
12 [~,~,ext] = fileparts(fileList{i});
13 if strcmp(ext,
'.c') || strcmp(ext,
'.cpp')
14 %Strip the root path from the current file
for log purposes
15 tokens = regexp(fileList{i}, [roboRoot
'(.*)'],
'tokens');
17 robolog(
'Compiling %s', cfile{:});
18 %Perform the compilation. May fail
if a compiler is missing, or external libraries are missing
22 robolog(
'Failed compiling %s\nError is:\n%s',
'WRN', cfile{:}, ME.message);
function robolog(in msg, in varargin)
This function allows the user to print log messages in a standard way.
function robochameleon(in varargin)
Add robochameleon related directories to the MATLAB path.
function end(in obj, in k, in n)
Overload of indexing end statement.