This hides possible error message. We move exception handling to
Makefile (and buildbot) and they are responsible displaying the error
message.
BUILD_DIRS=$(MODELS:%.slx=%_rpp)
all: lib
- matlab -nojvm -r "exit(rpp_build_demos())"
+ matlab -nojvm -r "try; rpp_build_demos(); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"
%_rpp: %.slx lib
- matlab -nojvm -r "exit(rpp_build_demos('$<'))"
+ matlab -nojvm -r "try; rpp_build_demos($<); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"
lib:
$(MAKE) -C ../lib rpp-lib.lib
-function err = rpp_build_demos(varargin)\r
+function rpp_build_demos(varargin)\r
d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos');\r
cd(d)\r
\r
- try\r
- if nargin > 0,\r
- build_demo(varargin{1});\r
- else\r
- for i=dir('*.slx')',\r
- build_demo(i.name);\r
- end\r
+ if nargin > 0,\r
+ build_demo(varargin{1});\r
+ else\r
+ for i=dir('*.slx')',\r
+ build_demo(i.name);\r
end\r
- catch ME\r
- err = 1;\r
- return\r
end\r
- err = 0;\r
\r
function build_demo(file)\r
[p, n, e] = fileparts(file);\r