]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/commitdiff
Add a function to build all demos from command line
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 13 Aug 2013 16:22:06 +0000 (18:22 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 13 Aug 2013 16:27:37 +0000 (18:27 +0200)
Also add a Makefile to invoke the build from shell by typing make.

rpp/demos/.gitignore
rpp/demos/Makefile [new file with mode: 0644]
rpp/demos/rpp_build_demos.m [new file with mode: 0644]

index 046f1b9a9f80a4cd342bd1d731536c603772085c..cffc0a336a1cadaa85a456d99016dfd47b8cddc4 100644 (file)
@@ -1 +1,2 @@
 *.autosave
+*_rpp/
diff --git a/rpp/demos/Makefile b/rpp/demos/Makefile
new file mode 100644 (file)
index 0000000..e9005d8
--- /dev/null
@@ -0,0 +1,2 @@
+all:
+       matlab -nojvm -r "exit(rpp_build_demos())"
diff --git a/rpp/demos/rpp_build_demos.m b/rpp/demos/rpp_build_demos.m
new file mode 100644 (file)
index 0000000..d9e8265
--- /dev/null
@@ -0,0 +1,15 @@
+function err = rpp_build_demos\r
+    d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos');\r
+    cd(d)\r
+\r
+    for i=dir('*.slx')',\r
+        [p, n, e] = fileparts(i.name);\r
+        disp(['Building ', i.name]);\r
+        try\r
+            slbuild(n, 'StandaloneRTWTarget', 'ForceTopModelBuild', true);\r
+        catch ME\r
+            err = 1;\r
+            return\r
+        end\r
+    end\r
+    err = 0;\r