]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/mcbsp-lld.git/blobdiff - build/buildlib.xs
mcbsp-lld:
[keystone-rtos/mcbsp-lld.git] / build / buildlib.xs
index 01ef0d4e2b73d88ed41821d909b4b906710b9c91..ecebe3e1af474b1cda27982aba8d1ba9202b7ce6 100644 (file)
@@ -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-2015, Texas Instruments, Inc.
  *****************************************************************************/
 
 /**************************************************************************
  *****************************************************************************/
 
 /**************************************************************************
@@ -162,11 +162,11 @@ function createMake(makefile)
 
       var file = xdc.module('xdc.services.io.File');
     
 
       var file = xdc.module('xdc.services.io.File');
     
-      var xdcTargetType = java.lang.System.getenv("XDCTARGET");
-      var toolsBaseDir = java.lang.System.getenv("XDCCGROOT");   
       
       makefile.writeLine("\n# Output for prebuilt generated libraries");
       makefile.writeLine("export LIBDIR ?= ./lib");
       
       makefile.writeLine("\n# Output for prebuilt generated libraries");
       makefile.writeLine("export LIBDIR ?= ./lib");
+      /* use sectti.exe from path */
+      makefile.writeLine("export SECTTI ?= sectti");
 
       /* Create INCDIR from XDCPATH */
     
 
       /* Create INCDIR from XDCPATH */
     
@@ -343,7 +343,7 @@ function createLibMake(makelibname,targetname, objectPath)
 
     }
        
 
     }
        
-    libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR))))");
+        libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR)))) -I$("+tooldir+")/include");
     libmakefile.writeLine("OBJEXT = o"+targetname.suffix); 
     libmakefile.writeLine("AOBJEXT = s"+targetname.suffix);     
     /* 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("OBJEXT = o"+targetname.suffix); 
     libmakefile.writeLine("AOBJEXT = s"+targetname.suffix);     
     /* 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");*/
@@ -517,11 +517,29 @@ function buildLibrary (libOptions, libName, target, libFiles)
     /* Create the Epilogue; which executes after all the builds are completed. 
      * This is used to generate the benchmark information for the built library. 
      * Also add the benchmarking information file to the package. */
     /* Create the Epilogue; which executes after all the builds are completed. 
      * This is used to generate the benchmark information for the built library. 
      * Also add the benchmarking information file to the package. */
-    Pkg.makeEpilogue += ".libraries: benchmarking_" + target.suffix + "\n";
-    Pkg.makeEpilogue += "benchmarking_" + target.suffix + ":";
-    Pkg.makeEpilogue += "\n\t ofd6x.exe -x " + lldFullLibraryPath + ".a" + target.suffix + " > tmp.xml";
-    Pkg.makeEpilogue += "\n\t sectti.exe tmp.xml > " + lldFullLibraryPath + ".a" + target.suffix +  "_size.txt";
-    Pkg.makeEpilogue += "\n\t $(RM) tmp.xml\n\n";
+
+    /* Put the temp file in object directory since javascript doesn't have a built in tmpname, 
+     * and don't want --jobs=# with # > 1 to result in collisions */
+    var libFullName = lldFullLibraryPath + ".a" + target.suffix;
+    var tempFile = libFullName + ".xml";
+    Pkg.makeEpilogue += ".libraries: " + libFullName +  "_size.txt\n";
+    Pkg.makeEpilogue += libFullName +  "_size.txt: " + libFullName + "\n";
+    if ( java.lang.String(target.name).contains('66') )
+    {    
+        Pkg.makeEpilogue += "\n\t $(C6X_GEN_INSTALL_PATH)/bin/ofd6x -x " + libFullName + " > " + tempFile;
+        Pkg.makeEpilogue += "\n\t $(SECTTI) " + tempFile + " > " + libFullName +  "_size.txt";
+        Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
+    }   
+    else if (target.name == "M4")
+    {
+        Pkg.makeEpilogue += "\n\t $(TOOLCHAIN_PATH_M4)/bin/armofd -x " + libFullName + " > " + tempFile;
+        Pkg.makeEpilogue += "\n\t $(SECTTI) " + tempFile + " > " + libFullName +  "_size.txt";
+        Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";
+    }
+    else
+    {
+        Pkg.makeEpilogue += "\n\t $(TOOLCHAIN_PATH_A15)/bin/$(CROSS_TOOL_PRFX)size " + libFullName + " > " + libFullName + "_size.txt";
+    }                
     Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";
     Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + ".mk";
 
     Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";
     Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + ".mk";