-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.m
50 lines (43 loc) · 1.23 KB
/
make.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%
% make.m
%
% Created by Léa Strobino.
% Copyright 2015 hepia. All rights reserved.
%
function make(varargin)
MEX = {};
switch computer('arch')
case 'maci64'
MEX = [MEX {'-I/Library/Frameworks/Phidget21.framework/Headers'}];
MEX = [MEX {'LDFLAGS="$LDFLAGS -F/Library/Frameworks -framework Phidget21"'}];
MEX = [MEX {'-largeArrayDims'}];
case 'win32'
MEX = [MEX {['-I"' cd '\SDK"']}];
MEX = [MEX {['-L"' cd '\SDK\x86"']}];
MEX = [MEX {'-lphidget21'}];
case 'win64'
MEX = [MEX {['-I"' cd '\SDK"']}];
MEX = [MEX {['-L"' cd '\SDK\x64"']}];
MEX = [MEX {'-lphidget21'}];
MEX = [MEX {'-largeArrayDims'}];
end
MEX = [MEX {'-outdir','private'}];
if nargin == 0
varargin = {'clean','all'};
end
warning('off','MATLAB:DELETE:FileNotFound');
if any(strcmpi(varargin,'clean'))
m = mexext('all');
for i = 1:length(m)
delete(['*.' m(i).ext]);
delete(['private/*.' m(i).ext]);
end
delete *.p
delete private/*.p
end
if any(strcmpi(varargin,'all')) || any(strcmpi(varargin,'phidget21encoder'))
mex('phidget21encoder.c',MEX{:});
end
if any(strcmpi(varargin,'all')) || any(strcmpi(varargin,'phidget21interface'))
mex('phidget21interface.c',MEX{:});
end