COMPILE.M
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- clear mex
- cFileList = {...
- 'zcratemex', ...
- 'dtwmex0', ...
- 'dtwmex1', ...
- 'dtwmex1n', ...
- 'wave2mfccmex', ...
- };
- for i=1:length(cFileList),
- cFile = [cFileList{i}, '.c'];
- % if *.c file not exist, try *.cpp
- if exist(cFile) ~=2,
- cFile = [cFileList{i}, '.cpp'];
- end
- dllFile = [cFileList{i}, '.dll'];
- includedFiles = findinc(cFile);
- includedFiles = {includedFiles{:}, cFile};
- needCompile = 0;
- if exist(dllFile)==0,
- needCompile = 1;
- else % Check dependency
- fileInfo = dir(dllFile);
- dllDate = datenum(fileInfo.date);
- for j=1:length(includedFiles),
- if exist(includedFiles{j}),
- fileInfo = dir(includedFiles{j});
- incDate = datenum(fileInfo.date);
- if incDate>dllDate,
- needCompile=1;
- break;
- end
- end
- end
- end
- if needCompile,
- fprintf('Compiling %s... ===> ', cFile);
- eval(['mex ', cFile]);
- fprintf('Copying %s.dll to CBMR directory.n', cFileList{i});
- dos(['copy ', cFileList{i}, '.dll ..']);
- end
- end
- %tmex