0001 function compilefma
0002
0003
0004
0005
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
0019 cd(files(i).name);
0020 processDir;
0021 cd('..');
0022 end
0023
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