Home > FMAToolbox > compilefma.m

compilefma

PURPOSE ^

compilefma - Compile C/C++ functions in FMAToolbox

SYNOPSIS ^

function compilefma

DESCRIPTION ^

 compilefma - Compile C/C++ functions in FMAToolbox

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function compilefma
0002 
0003 % compilefma - Compile C/C++ functions in FMAToolbox
0004 
0005 % Move to the 'FMAToolbox' directory, compile, and move back
0006 path = fileparts(which('FMAToolbox'));
0007 currentDir = pwd;
0008 cd(path);
0009 processDir;
0010 cd(currentDir);
0011 
0012 function processDir
0013 
0014 files = dir;
0015 for i = 1:length(files),
0016     if strcmp(files(i).name,'.') || strcmp(files(i).name,'..'), continue; end
0017     if files(i).isdir,
0018         % Recursively process subdirectories
0019         cd(files(i).name);
0020         processDir;
0021         cd('..');
0022     end
0023     % Compile C/C++ files
0024     [~,name,ext] = fileparts(files(i).name);
0025     if strcmp(lower(ext),'.c') || strcmp(lower(ext),'.cpp'),
0026         mex(files(i).name);
0027     end
0028 end

Generated on Fri 16-Mar-2018 13:00:20 by m2html © 2005