]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Signal error when rpp-lib is not configured during rpp_setup.m
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Apr 2015 16:17:05 +0000 (18:17 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Apr 2015 16:26:04 +0000 (18:26 +0200)
rpp/rpp/rpp_get_target.m

index 4a5a9aa034650a765c09a21bc39d6440821fe544..e56cce2653f14aa4a800e3b94d98decd79c6e6fc 100644 (file)
@@ -2,7 +2,13 @@ function target = rpp_get_target()
 % RPP_GET_TARGET Returns name of platform the RPP code generation
 % is configured for.
        RppLibRoot = getpref('rpp', 'RppLibRoot');
-    f = fopen(fullfile(RppLibRoot, 'Makefile.config'), 'r');
+    makefile_config = fullfile(RppLibRoot, 'Makefile.config');
+    if ~exist(makefile_config, 'file'),
+        error('rpp:noLibConfig', ...
+              ['RPP runtime library is not configured, "%s" does not exist! Please, recompile the library.'], ...
+              makefile_config);
+    end
+    f = fopen(makefile_config, 'r');
     while ~feof(f),
         l = fgetl(f);
         [val, count] = sscanf(l, ' TARGET = %s');