]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Make rpp_setup Windows compatible
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 7 Nov 2014 18:01:39 +0000 (19:01 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 7 Nov 2014 18:01:39 +0000 (19:01 +0100)
rpp/rpp/rpp_setup.m

index 580f1143e9394dd5bde025cb889858ec7f82aefa..f2dc60fd6bb4ca18cc13dd7c86310ac70764953c 100644 (file)
@@ -44,7 +44,8 @@ function rpp_setup(varargin)
         if ispref('rpp', 'CompilerRoot')
             possiblePath = getpref('rpp', 'CompilerRoot');
         else
-            possiblePath = '/usr/local/ti/ccsv5/tools/compiler/arm_5.1.1';
+            if isunix, prefix='/usr/local'; else prefix='C:'; end
+            possiblePath = [prefix, '/ti/ccsv5/tools/compiler/arm_5.1.1'];
         end
 
         CompilerRoot = fix_slash(uigetdir(possiblePath, ...
@@ -57,9 +58,10 @@ function rpp_setup(varargin)
     TargetRoot   = fix_slash(currentPath);
     RppLibRoot   = fullfile(fileparts(TargetRoot), 'lib');
 
-    armcl = fullfile(CompilerRoot, 'bin', 'armcl');
-    if ~exist(armcl),
-        disp(sprintf('Error: "%s" does not exist!', armcl));
+    if ispc, ext='.exe'; else ext=''; end
+    armcl = fullfile(CompilerRoot, 'bin', ['armcl' ext]);
+    if ~exist(armcl, 'file'),
+        fprintf('Error: "%s" does not exist!\n', armcl);
         return;
     end