]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blobdiff - rpp/blocks/compile_blocks.m
Change license to MIT
[jenkicar/rpp-simulink.git] / rpp / blocks / compile_blocks.m
index 4d38b1503220d934cfdd708574fefe59d2a9d8ca..c90a0f42d410d00872414b27f2b1096b94bfb00a 100644 (file)
@@ -3,10 +3,26 @@
 % Authors:
 %     - Carlos Jenkins <carlos@jenkins.co.cr>
 %
-% This document contains proprietary information belonging to Czech
-% Technical University in Prague. Passing on and copying of this
-% document, and communication of its contents is not permitted
-% without prior written authorization.
+% Permission is hereby granted, free of charge, to any person
+% obtaining a copy of this software and associated documentation
+% files (the "Software"), to deal in the Software without
+% restriction, including without limitation the rights to use,
+% copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the
+% Software is furnished to do so, subject to the following
+% conditions:
+
+% The above copyright notice and this permission notice shall be
+% included in all copies or substantial portions of the Software.
+
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+% OTHER DEALINGS IN THE SOFTWARE.
 %
 % File : compile_blocks.m
 % Abstract:
@@ -30,19 +46,20 @@ function compile_blocks()
     %           link step fully evaluated.
     % options = '-v -g';
     options = '';
-    mex = fullfile(matlabroot(), 'bin', 'mex');
+    matlabRootPath=strcat('"',matlabroot(),'"');
+    mex = fullfile(matlabRootPath, 'bin', 'mex');
+
     sources = dir('sfunction_*.c');
 
     for i = sources'
         local_opts = options;
         if strcmp(i.name, 'sfunction_canreceive.c') || ...
-           strcmp(i.name, 'sfunction_cantransmit.c') || ...
-           strcmp(i.name, 'sfunction_cansetup.c'),
+           strcmp(i.name, 'sfunction_cantransmit.c'),
             local_opts = [local_opts ' ' ...
-                '-I' matlabroot  '/toolbox/shared/can/src/scanutil ' ...
-               '-I' matlabroot  '/toolbox/rtw/targets/common/can/datatypes ' ...
-                matlabroot '/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c '...
-                matlabroot '/toolbox/rtw/targets/common/can/datatypes/can_msg.c'];
+                '-I' matlabRootPath '/toolbox/shared/can/src/scanutil ' ...
+               '-I' matlabRootPath '/toolbox/rtw/targets/common/can/datatypes ' ...
+                matlabRootPath '/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c '...
+                matlabRootPath '/toolbox/rtw/targets/common/can/datatypes/can_msg.c'];
         end
         command = [mex ' ' i.name ' ' local_opts];
         disp(command);