]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/pa-lld.git/blobdiff - config.bld
NOTICE OF RELOCATION
[keystone-rtos/pa-lld.git] / config.bld
index b18f30f98161758b9b60846a69333b2b8606d423..0dfe27866bd3fab926f9e76d1c4ce8b9f4a090be 100644 (file)
@@ -8,12 +8,20 @@
  *  and is responsible for configuration of the paths for the various 
  *  tools required to build the driver.
  *
- * Copyright (C) 2009-2013, Texas Instruments, Inc.
+ * Copyright (C) 2009-2015, Texas Instruments, Inc.
  *****************************************************************************/
 
 /* Get the Tools Base directory from the Environment Variable. */
 var xdcTargetType = java.lang.System.getenv("XDCTARGET");
-var toolsBaseDir = java.lang.System.getenv("XDCCGROOT");
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
+
+/* Get the extended debug flags for C66x, 
+ * did not change the name for backwards compatibilty */
+var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");
+
+/* Get the extended debug flags for A15 */
+var extDbgFlags_a15 = java.lang.System.getenv("EXTDBGFLAGS_A15");
 
 /* Check if we need to create the Makefiles? */
 var miniBuild = java.lang.System.getenv("MINI_PACKAGE");
@@ -33,7 +41,7 @@ if(palldPartNumber == null)
 }
 
 /* Include Path */
-var palldIncPath = " -i" + palldPath;
+var palldIncPath = " -I" + palldPath;
 
 /* Configure the PA LLD Version Information */
 /* 3 steps: remove SPACE and TAB, convert to string and split to make array */
@@ -43,36 +51,19 @@ var palldReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
  * Analysis has to be done on the driver Code base or not? */
 var paCoverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");
 
-if(xdcTargetType ==  "ARM11") 
-{ 
-    /* Set path to the ARM11 tools directory */
-    var TIArmv6le            = xdc.useModule('ti.targets.arm.Arm11');
-    TIArmv6le.rootDir        = toolsBaseDir; 
-    TIArmv6le.ccOpts.prefix  = "-O2 -DDEVICE_K2L"  
-
-    /* Set path to the ARM11 tools directory */
-    var TIArmv6be            = xdc.useModule('ti.targets.arm.Arm11_big_endian');
-    TIArmv6be.rootDir        = toolsBaseDir; 
-    TIArmv6be.ccOpts.prefix  = "-O2 -DDEVICE_K2L -DBIGENDIAN"  
-}
-else
-{
-    
     /* C66 ELF compiler configuration for Little Endian Mode. */
-    var C66LE          = xdc.useModule('ti.targets.elf.C66');
-    C66LE.rootDir       = toolsBaseDir;
-    C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o"; 
+    var C66LE                = xdc.useModule('ti.targets.elf.C66');
+    C66LE.rootDir            = c66ToolsBaseDir;
+    C66LE.ccOpts.prefix      = "-mo -o3 -q -k -eo.o"; 
     if(extDbgFlags)     
-        C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags; 
+        C66LE.ccOpts.prefix  = C66LE.ccOpts.prefix + " " + extDbgFlags; 
 
-    /* C66 ELF compiler configuration for Big Endian Mode. */
-    var C66BE          = xdc.useModule('ti.targets.elf.C66_big_endian');
-    C66BE.rootDir       = toolsBaseDir;
-    C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN";
-    if(extDbgFlags)     
-        C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags;
-    
-}
+/* ARMv7 A15 compiler configuration */
+    var A15LE                = xdc.useModule('gnu.targets.arm.A15F');
+    A15LE.rootDir            = a15ToolsBaseDir; 
+    A15LE.ccOpts.prefix      = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";  
+    if(extDbgFlags_a15)     
+        A15LE.ccOpts.prefix  = A15LE.ccOpts.prefix + " " + extDbgFlags_a15; 
 
 /* Check if we need to run the STATIC Analysis or not? */
 var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");
@@ -111,25 +102,123 @@ if (miniBuild == "ON") {
 
     C66LE.profiles["release"].filters[C66LE.profiles["release"].filters.length++] = makeC66LEFilter;
 
+}
 
-    var makeC66BEFilter = {
-        moduleName: "build.filter.Make",
-        params: {
-          makefileName: "simpleC66BE.mak",
-        }
-    }; 
-
-    C66BE.profiles["release"].filters[C66BE.profiles["release"].filters.length++] = makeC66BEFilter;
 
+for ( i=0; i < arguments.length; i++)
+{
+  print ("ARG[" + i + "] = " + arguments[i]);
+}
 
+/* Create the SoC List  */
+var socs = { 
+    /* device independent libraries */
+    all :
+    {
+        /* Build this library */
+        build: "true",
+        /* target lists, kept blank now, would be updated based on argument lists */
+        targets: []
+    },
+    k2h :
+    {
+        /* Build this library */
+        build: "false",
+        /* target list */
+        targets: [ C66LE, A15LE ]
+    },
+    k2k :
+    {
+        /* Build this library */
+        build: "false",
+        /* target list */
+        targets: [ C66LE, A15LE ]
+    },
+    k2e:
+    {
+        /* Build this library */
+        build: "false",
+        /* target list */
+        targets: [ C66LE, A15LE ]
+    },
+    k2l :
+    {
+        /* Build this library */
+        build: "false",
+        /* target list */
+        targets: [ C66LE, A15LE ]
+    },
+    c6678 :
+    {
+        /* Build this library */
+        build: "false",
+        /* target list */
+        targets: [ C66LE ]
+    }
+};
+
+/**************************************************************************
+ * FUNCTION NAME : merge
+ **************************************************************************
+ * DESCRIPTION   :
+ *  The function is used to merge two arrarys
+ **************************************************************************/
+function merge() {
+    var args = arguments;
+    var hash = {};
+    var arr = [];
+    for (var i = 0; i < args.length; i++) {
+       for (var j = 0; j < args[i].length; j++) {
+         if (hash[args[i][j]] !== true) {
+           arr[arr.length] = args[i][j];
+           hash[args[i][j]] = true;
+         }
+       }
+     }
+    return arr;
 }
-/* List all the build targets here. */
-if(xdcTargetType == "ARM11")
+
+/* Grab input from XDCARGS */
+var buildArguments  = [];
+
+/* Construct the build arguments */
+for (var tmp=0; arguments[tmp] != undefined; tmp++)
 {
-    Build.targets = [ TIArmv6le, TIArmv6be ];
+
+    /* If no arguments are provided, override for building all */
+    if ( ( arguments.length == 1) && (arguments[tmp].equals("./config.bld")) )
+        buildArguments[buildArguments.length++] = "all";
+    else
+        buildArguments[buildArguments.length++] = arguments[tmp];
+}
+
+/* Build targets on this build */
+var build_targets = [];
+var soc_names = Object.keys(socs);
+
+for (var i=0; i < buildArguments.length; i++ ) {
+    /* Build it for all targets */
+    if (buildArguments[i] == "all") {
+        for (var j = 0; j < soc_names.length; j++)  {
+            build_targets = merge (build_targets.slice(0), socs[soc_names[j]].targets.slice(0));
+            /* Set build to "true" for that SoC */
+            socs[soc_names[j]].build = "true";
+        }
+    }
+    else {
+        /* Skip the first argument, which is ./config.bld to get to next SoCs */
+        if (i == 0) continue;          
+        /* Set that build to true if it is found in supported build socs */
+        for (j = 0; j < soc_names.length; j++) {
+            if (buildArguments[i] == soc_names[j]) {
+                socs[buildArguments[i]].build = "true";
+                build_targets = merge (build_targets.slice(0), socs[buildArguments[i]].targets.slice(0));
+                break;
+            }
+        }
+    }   
 }
-else
-{
-    Build.targets = [ C66LE, C66BE ];
-}    
 
+/* Update the Build target generated list */
+socs["all"].targets = build_targets; 
+Build.targets   = build_targets;