]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - packages/ti/ipc/transports/package.bld
package.bld: Remove --gcc option
[ipc/ipcdev.git] / packages / ti / ipc / transports / package.bld
index 19b1593b0ff9411e8349cd2ea497f38df5d146b1..a531a2511bcfe4ba1410210df437e3cbb124dab2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2019 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.bld ========
  */
-
 var Build = xdc.useModule('xdc.bld.BuildEnvironment');
 var Pkg = xdc.useModule('xdc.bld.PackageContents');
 
-/*
- * This package distributes its sources in the default release.  This is to
- * enable better understanding by the customer/field, as well as enable
- * modification and profiling techniques in the field.
- */
-Pkg.attrs.exportSrc = true;
-
-Pkg.otherFiles = ["package.bld", "_TransportVirtio.h"];
-
-var SRCS = ["TransportVirtioSetup.c", "TransportVirtio.c"];
-
-/* remove this output directory during a clean */
-Pkg.generatedFiles.$add("lib/");
+var objList = [ "TransportRpmsgSetup.c", "TransportRpmsg.c" ];
 
 var myCopts = "";
 
+/*  Always build package libraries during the product build. This is
+ *  needed because Rpmsg.h requires the --gcc option and because we
+ *  need some libraries built with custom defines.
+ *
+ *  However, this package does participate in the custom build flow.
+ */
 for (var i = 0; i < Build.targets.length; i++) {
     var targ = Build.targets[i];
+    var name = Pkg.name;
 
-    if (targ.$name.match(/^ti\.targets\.*/)) {
-        myCopts = "--gcc";  /* Rpmsg.h requires gcc-isms */
-    } else {
-        myCopts = "";
+    /*
+     *  Only devices with an rpmsg-enabled HLOS and a slave would need this
+     *  library.  Skip targets that will never need this.
+     */
+    if (!targ.isa.match(/^(64T|66|674|v7M4?|v7R)$/)) {
+        continue;
     }
 
-    /* Build for all profiles */
     for (var profile in targ.profiles) {
 
-        Pkg.addLibrary("lib/" + profile + "/" + Pkg.name, targ, {
+        /* For all targets, build a rpmsg-upstream-compatible lib */
+        Pkg.addLibrary("lib/" + profile + "/" + name, targ, {
             profile: profile,
             copts: myCopts
-        }).addObjects(SRCS);
+        }).addObjects(objList);
+
+        if (targ.isa.match(/^(64T|66|674|v7M4?|v7R)$/)) {
+            /* And for select targets, build a rpmsg2-compatible lib */
+            Pkg.addLibrary("lib/" + profile + "/" + name + "_rpmsg2", targ, {
+                profile: profile,
+                copts: myCopts + " -DRPMSG_NS_2_0"
+            }).addObjects(objList);
+        }
     }
 }
+
+Pkg.otherFiles = [
+    "package.bld",
+    "_TransportRpmsg.h"
+];
+
+/* include source files in the release package */
+Pkg.attrs.exportSrc = true;
+
+Pkg.generatedFiles.$add("lib/");