currentPath = pwd();
targetPath = currentPath(1:end-length('/rpp'));
- % Add target system folders to Matlab path
- addpath(fullfile(targetPath, 'rpp'));
- addpath(fullfile(targetPath, 'demos'));
- addpath(fullfile(targetPath, 'blocks'));
- %addpath(fullfile(targetPath, 'help'));
- savepath();
-
if nargin == 0,
% Ask user setup variables
if ispref('rpp', 'CompilerRoot')
return;
end
- % Save preferences
+ % Remove old paths and preferences (if any)
if ispref('rpp')
+ oldTargetPath = getpref('rpp', 'TargetRoot');
+ rmpath(fullfile(oldTargetPath, '..', 'rpp'));
+ rmpath(fullfile(oldTargetPath, '..', 'demos'));
+ rmpath(fullfile(oldTargetPath, '..', 'blocks'));
rmpref('rpp');
end
+
+ % Add target system folders to Matlab path
+ addpath(fullfile(targetPath, 'rpp'));
+ addpath(fullfile(targetPath, 'demos'));
+ addpath(fullfile(targetPath, 'blocks'));
+ savepath();
+
+ % Save preferences
addpref('rpp', 'CompilerRoot', CompilerRoot);
addpref('rpp', 'CCSRoot' , CCSRoot);
addpref('rpp', 'TargetRoot' , TargetRoot);
addpref('rpp', 'RppLibRoot' , RppLibRoot);
- % Generate blocks
+ % Generate blocks and library
cd('../blocks');
compile_blocks();
rpp_generate_lib();