PRSDK-3513 Modified xs file to build.
[keystone-rtos/mcbsp-lld.git] / build / buildlib.xs
old mode 100644 (file)
new mode 100755 (executable)
index 08c6ed7..779aa9f
@@ -7,7 +7,7 @@
  *  This file contains common routines that are used by the various McBSP 
  *  driver components.
  *
  *  This file contains common routines that are used by the various McBSP 
  *  driver components.
  *
- * Copyright (C) 2012, Texas Instruments, Inc.
+ * Copyright (C) 2011-2016, Texas Instruments, Inc.
  *****************************************************************************/
 
 /**************************************************************************
  *****************************************************************************/
 
 /**************************************************************************
@@ -224,47 +224,44 @@ function createLibMake(device, makelibname,targetname, objectPath)
     case String(C66LE):
       tooldir="C6X_GEN_INSTALL_PATH";
       cmdprefix="";
     case String(C66LE):
       tooldir="C6X_GEN_INSTALL_PATH";
       cmdprefix="";
-      targetDir="c66";
+      targetDir="c66/release";
       targetname=C66LE;
       break;
     case String(C66BE):
       tooldir="C6X_GEN_INSTALL_PATH";
       cmdprefix="";
       targetname=C66LE;
       break;
     case String(C66BE):
       tooldir="C6X_GEN_INSTALL_PATH";
       cmdprefix="";
-      targetDir="c66";
+      targetDir="c66/release";
       targetname=C66BE;
       break;
     case String(A15LE):
       tooldir="TOOLCHAIN_PATH_A15"; 
       cmdprefix="CROSS_TOOL_PRFX";
       targetname=C66BE;
       break;
     case String(A15LE):
       tooldir="TOOLCHAIN_PATH_A15"; 
       cmdprefix="CROSS_TOOL_PRFX";
-      targetDir="armv7";
+      targetDir="a15/release";
       targetname=A15LE;
       break;
     case String(A9LE):
       tooldir="TOOLCHAIN_PATH_A9";
       cmdprefix="CROSS_TOOL_PRFX";
       targetname=A15LE;
       break;
     case String(A9LE):
       tooldir="TOOLCHAIN_PATH_A9";
       cmdprefix="CROSS_TOOL_PRFX";
-      targetDir="armv7";
+      targetDir="a9/release";
       targetname=A9LE;
       break;
     case String(A8LE):
       tooldir="TOOLCHAIN_PATH_A8";
       cmdprefix="CROSS_TOOL_PRFX";
       targetname=A9LE;
       break;
     case String(A8LE):
       tooldir="TOOLCHAIN_PATH_A8";
       cmdprefix="CROSS_TOOL_PRFX";
-      targetDir="armv7";
+      targetDir="a8/release";
       targetname=A8LE;
       break;
     case String(M4LE):
       tooldir="TOOLCHAIN_PATH_M4";
       cmdprefix="";
       targetname=A8LE;
       break;
     case String(M4LE):
       tooldir="TOOLCHAIN_PATH_M4";
       cmdprefix="";
-      targetDir="m4";
+      targetDir="m4/release";
       targetname=M4LE;
       break;
       targetname=M4LE;
       break;
-    case String(ARM11):
-      tooldir="TI_ARM11_GEN_INSTALL_PATH"; 
-      break;
-    case String(C67LE):
+    case String(C674LE):
       tooldir="C6X_GEN_INSTALL_PATH";
       cmdprefix="";
       tooldir="C6X_GEN_INSTALL_PATH";
       cmdprefix="";
-      targetDir="c66";
-      targetname=C67LE;
+      targetDir="c674/release";
+      targetname=C674LE;
       break;
 
    }
       break;
 
    }
@@ -322,7 +319,7 @@ function createLibMake(device, makelibname,targetname, objectPath)
         libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
         libmakefile.writeLine("INTERNALDEFS = -MD -MF $@.dep");
         libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");  /* TBD */
         libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
         libmakefile.writeLine("INTERNALDEFS = -MD -MF $@.dep");
         libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");  /* TBD */
-        libmakefile.writeLine("OBJDIR =  $(LIBDIR)/" + device.toString() + "/" + targetDir +"/obj"); 
+        libmakefile.writeLine("OBJDIR =  ./obj/obj_" +targetname.suffix +"/" + device.toString() + "/" + targetDir +"/obj" + "/" + objExtDir); 
     
     }
     else
     
     }
     else
@@ -363,8 +360,8 @@ function createLibMake(device, makelibname,targetname, objectPath)
         /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/
         libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+"  -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");
         libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");
         /* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/
         libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+"  -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");
         libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");
-        libmakefile.writeLine("OBJDIR =  $(LIBDIR)/" + device.toString() + "/" + targetDir +"/obj"); 
-    }   
+        libmakefile.writeLine("OBJDIR =  ./obj/obj_" +targetname.suffix +"/" + device.toString() + "/" + targetDir +"/obj" + "/" + objExtDir); 
+    }
    
  return libmakefile;
 
    
  return libmakefile;
 
@@ -470,19 +467,23 @@ function buildLibrary (socName, isSoc, libOptions, libName, target, libFiles)
     
     if (target.name == "A15F")
     {
     
     if (target.name == "A15F")
     {
-        targetDir = "armv7";
+        targetDir = "a15/release";
     }
     else if (target.name == "A9F")
     {
     }
     else if (target.name == "A9F")
     {
-        targetDir = "armv7";
+        targetDir = "a9/release";
     }
     else if (target.name == "A8F")
     {
     }
     else if (target.name == "A8F")
     {
-        targetDir = "armv7";
+        targetDir = "a8/release";
     }
     else if (target.name == "M4")
     {
     }
     else if (target.name == "M4")
     {
-        targetDir = "m4";
+        targetDir = "m4/release";
+    }
+       else if (target.name == "C674")
+    {
+        targetDir = "c674";
     }
     else
     {
     }
     else
     {