Test: Build script refactoring
authorChris Ring <cring@ti.com>
Tue, 7 May 2013 22:56:16 +0000 (15:56 -0700)
committerChris Ring <cring@ti.com>
Tue, 7 May 2013 22:56:16 +0000 (15:56 -0700)
Consolidate some of the test package.bld script.  No functional
change.

packages/ti/ipc/tests/package.bld

index cee7f99bb9d1b536b5a6cd7eaf6a42f6e400e36b..7598b72f92abb6d1161041a295a49c31aa2fca0e 100644 (file)
@@ -243,29 +243,21 @@ for (var i = 0; i < Build.targets.length; i++) {
                 // replace all ':' and '.' with '_' in platform name
                 platform.replace(/\:/g, "_").replace(/\./g, "_");
 
-        if (targ.isa.match(/^v7M(|4)$/)) {
-            Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
-                cfgScript: "ping_rpmsg",
-                defs: " -DRPMSG_NS_2_0"
-            }).addObjects(["ping_rpmsg.c"]);
-        } else if (targ.isa == "64T") {
-            Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
-                cfgScript: "ping_rpmsg",
-                defs: " -DRPMSG_NS_2_0"
-            }).addObjects(["ping_rpmsg.c"]);
-        } else if (targ.isa == "66" &&
-                   platform.match(/^ti\.platform\.vayu/)) {
-            Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
-                cfgScript: "ping_rpmsg",
-                defs: " -DRPMSG_NS_2_0"
-            }).addObjects(["ping_rpmsg.c"]);
-        } else {
-            Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
-                cfgScript: "ping_rpmsg"
-            }).addObjects(["ping_rpmsg.c"]);
+        var extraDefs = "";
+
+        /* Vayu and OMAP5 require MmRpc and therefore use RPMSG_NS_2_0 */
+        if (platform.match(/^ti\.platform\.vayu/) ||
+                platform.match(/^ti\.platform\.sdp5430$/)) {
+            extraDefs = " -DRPMSG_NS_2_0";
         }
 
-        /* Only build this for our multicore platforms: */
+        /* ping_rpmsg */
+        Pkg.addExecutable(name + "/ping_rpmsg", targ, platform, {
+            cfgScript: "ping_rpmsg",
+            defs: extraDefs
+        }).addObjects(["ping_rpmsg.c"]);
+
+        /* messageq_multicore - only for our homogeneous multicore platforms */
         if (platform.match(/^ti\.platforms\.simKepler/) ||
                 (platform.match(/^ti.platforms.evmTCI6638K2K/)) ||
                 (platform.match(/^ti\.platforms\.evm6614\:DSP/))) {
@@ -281,65 +273,34 @@ for (var i = 0; i < Build.targets.length; i++) {
             }).addObjects(["dual_transports.c"]);
         }
 
-        if (targ.isa.match(/^v7M(|4)$/)) {
-            Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK -DRPMSG_NS_2_0"
-            }).addObjects(["messageq_multi.c"]);
-        } else if (targ.isa == "64T") {
-            Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK -DRPMSG_NS_2_0"
-            }).addObjects(["messageq_multi.c"]);
-        } else if (targ.isa == "66" &&
-                   platform.match(/^ti\.platform\.vayu/)) {
-            Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK -DRPMSG_NS_2_0"
-            }).addObjects(["messageq_multi.c"]);
-        } else {
-            Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK"
-            }).addObjects(["messageq_multi.c"]);
-        }
+        /* messageq_multi */
+        Pkg.addExecutable(name + "/messageq_multi", targ, platform, {
+            cfgScript: "rpmsg_transport",
+            defs: "-D BENCHMARK" + extraDefs
+        }).addObjects(["messageq_multi.c"]);
 
-        if (targ.isa.match(/^v7M(|4)$/)) {
-            Pkg.addExecutable(name + "/messageq_single", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK -DRPMSG_NS_2_0"
-            }).addObjects(["messageq_single.c"]);
-        } else if (targ.isa == "64T") {
-            Pkg.addExecutable(name + "/messageq_single", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK -DRPMSG_NS_2_0"
-            }).addObjects(["messageq_single.c"]);
-        } else if (targ.isa == "66" &&
-                   platform.match(/^ti\.platform\.vayu/)) {
-            Pkg.addExecutable(name + "/messageq_single", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK -DRPMSG_NS_2_0"
-            }).addObjects(["messageq_single.c"]);
-        } else {
-            Pkg.addExecutable(name + "/messageq_single", targ, platform, {
-                cfgScript: "rpmsg_transport",
-                defs: "-D BENCHMARK "
-            }).addObjects(["messageq_single.c"]);
-        }
+        /* messageq_single */
+        Pkg.addExecutable(name + "/messageq_single", targ, platform, {
+            cfgScript: "rpmsg_transport",
+            defs: "-D BENCHMARK " + extraDefs
+        }).addObjects(["messageq_single.c"]);
 
+        /* nano_test - demonstrates passing ptrs using CMEM */
         if (platform.match(/^ti\.platforms\.evmOMAPL138\:DSP/)) {
-                Pkg.addExecutable(name + "/nano_test", targ, platform, {
-                    cfgScript: "rpmsg_transport"
-                }).addObjects(["nano_test.c"]);
+            Pkg.addExecutable(name + "/nano_test", targ, platform, {
+                cfgScript: "rpmsg_transport"
+            }).addObjects(["nano_test.c"]);
         }
 
+        var test_omx_SRCS = ["test_omx.c","ping_tasks.c","rpc_task.c",
+                "MxServer.c"];
+
         if (platform.match(/^ti\.platforms\.sdp5430/) &&
                 (targ.isa == "v7M4")) {
             Pkg.addExecutable(name + "/test_omx_ipu_omap5", targ, platform, {
                 cfgScript: "test_omx_ipu_omap5",
                 defs: "-D IPU -D OMAP5xxx -DRPMSG_NS_2_0"
-            }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
-                    "MxServer.c"]);
+            }).addObjects(test_omx_SRCS);
         }
 
         if (platform.match(/^ti\.platforms\.sdp5430/) &&
@@ -347,24 +308,21 @@ for (var i = 0; i < Build.targets.length; i++) {
             Pkg.addExecutable(name + "/test_omx_dsp_omap5", targ, platform, {
                 cfgScript: "test_omx_dsp_omap5",
                 defs: "-D DSP -D OMAP5xxx -DRPMSG_NS_2_0"
-            }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
-                    "MxServer.c"]);
+            }).addObjects(test_omx_SRCS);
         }
 
         if (platform.match(/^ti\.platform\.vayu\.ipu2/)) {
             Pkg.addExecutable(name + "/test_omx_ipu2_vayu", targ, platform, {
                 cfgScript: "test_omx_ipu_vayu",
                 defs: "-D IPU -D VAYU -DRPMSG_NS_2_0"
-            }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
-                    "MxServer.c"]);
+            }).addObjects(test_omx_SRCS);
         }
 
         if (platform.match(/^ti\.platform\.vayu\.dsp1/)) {
             Pkg.addExecutable(name + "/test_omx_dsp1_vayu", targ, platform, {
                 cfgScript: "test_omx_dsp_vayu",
                 defs: "-D DSP -D VAYU -DRPMSG_NS_2_0"
-            }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
-                    "MxServer.c"]);
+            }).addObjects(test_omx_SRCS);
         }
     }
 }