summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd986e9)
raw | patch | inline | side by side (parent: bd986e9)
author | Justin Sobota <jsobota@ti.com> | |
Tue, 17 Nov 2015 21:00:11 +0000 (16:00 -0500) | ||
committer | Justin Sobota <jsobota@ti.com> | |
Tue, 17 Nov 2015 21:00:11 +0000 (16:00 -0500) |
Signed-off-by: Justin Sobota <jsobota@ti.com>
Settings.xdc.xdt | patch | blob | history | |
build/buildlib.xs | patch | blob | history | |
config.bld | patch | blob | history | |
package.bld | patch | blob | history | |
package.xdc | patch | blob | history | |
package.xs | patch | blob | history | |
src/Module.xs | patch | blob | history |
diff --git a/Settings.xdc.xdt b/Settings.xdc.xdt
index 87370b07f415078cfeade70899ebb2ca473ea021..d4341f230ac636c262777f1f16de1fd4fe715d31 100644 (file)
--- a/Settings.xdc.xdt
+++ b/Settings.xdc.xdt
module Settings
{
- /*! This is the Fault Management Version */
config string fault_mgmtlibVersionString = `packageVersion`;
/*! This variable is to control the device type selection.
diff --git a/build/buildlib.xs b/build/buildlib.xs
index d6d3811864ea4c0f8926c127b7a2fb67fde2412c..f16e174e30e3af94cad0606300474bbf2aac659f 100644 (file)
--- a/build/buildlib.xs
+++ b/build/buildlib.xs
return null;
}
+
function createMake(makefile)
{
/* Create the main make 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(".libraries:");
makefile.writeLine("\n# Clean Rule");
- makefile.writeLine("clean:: clean_package");
- makefile.writeLine("# Clean Top Level Object Directory ");
- makefile.writeLine("clean_package:")
- for each (var libdir in devices)
- {
- makefile.writeLine("\t$(RMDIR) $(LIBDIR)/"+libdir.toString()+"/*/");
- }
+ makefile.writeLine("clean:: clean_package");
+ makefile.writeLine("# Clean Top Level Object Directory ");
+ makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/");
makefile.writeLine("\t$(RMDIR) package/cfg");
}
else
function createLibMake(device, makelibname,targetname, objectPath)
{
var tooldir;
+ var cmdprefix;
+ var targetDir;
var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");
- if(stringname.match("ARM11"))
- {
- tooldir="TI_ARM11_GEN_INSTALL_PATH";
- }
- else
- {
- tooldir="C6X_GEN_INSTALL_PATH";
- }
+
switch(stringname)
{
case String(C66LE):
+ tooldir="C6X_GEN_INSTALL_PATH";
+ cmdprefix="";
+ targetDir="c66";
targetname=C66LE;
break;
case String(C66BE):
+ tooldir="C6X_GEN_INSTALL_PATH";
+ cmdprefix="";
+ targetDir="c66";
targetname=C66BE;
break;
-
+ case String(A15LE):
+ tooldir="TOOLCHAIN_PATH_A15";
+ cmdprefix="CROSS_TOOL_PRFX";
+ targetDir="armv7";
+ targetname=A15LE;
+ break;
+ case String(A9LE):
+ tooldir="TOOLCHAIN_PATH_A9";
+ cmdprefix="CROSS_TOOL_PRFX";
+ targetDir="armv7";
+ targetname=A9LE;
+ break;
+ case String(A8LE):
+ tooldir="TOOLCHAIN_PATH_A8";
+ cmdprefix="CROSS_TOOL_PRFX";
+ targetDir="armv7";
+ targetname=A8LE;
+ break;
+ case String(M4LE):
+ tooldir="TOOLCHAIN_PATH_M4";
+ cmdprefix="";
+ targetDir="m4";
+ targetname=M4LE;
+ break;
}
+
var fileModule = xdc.module('xdc.services.io.File');
try{
var dstFile = new java.io.File(makelibname);
libmakefile.writeLine("empty =");
libmakefile.writeLine("space =$(empty) $(empty)");
- if(stringname.match("ti.targets"))
+ if ((targetname.name == "A15F") || (targetname.name == "A9F") || (targetname.name == "A8F"))
{
+
+ if(stringname.match("gnu.targets"))
+ {
+ libmakefile.writeLine("CC = $("+tooldir+")/bin/$("+cmdprefix+")gcc");
+ libmakefile.writeLine("AC = $("+tooldir+")/bin/$("+cmdprefix+")as");
+ libmakefile.writeLine("ARIN = $("+tooldir+")/bin/$("+cmdprefix+")ar");
+ libmakefile.writeLine("LD = $("+tooldir+")/bin/$("+cmdprefix+")gcc");
+ }
+ else
+ {
+ print("Error: Non-GNU targets are not currently supported ");
+ java.lang.System.exit(1);
- var rtslibtemp = targetname.lnkOpts.suffix.toString().split("/");
- var rtslib;
- for(n=0;n<rtslibtemp.length;n++)
- {
- if(rtslibtemp[n].match(".lib"))
- {
- rtslib=rtslibtemp[n];
- }
- }
-
- libmakefile.writeLine("CC = $("+tooldir+")/bin/"+targetname.cc.cmd +" "+targetname.ccOpts.prefix+" "+targetname.cc.opts);
- libmakefile.writeLine("AC = $("+tooldir+")/bin/"+targetname.asm.cmd +" "+targetname.asmOpts.prefix+" "+targetname.asm.opts);
- libmakefile.writeLine("ARIN = $("+tooldir+")/bin/"+targetname.ar.cmd +" "+targetname.ar.opts);
- libmakefile.writeLine("LD = $("+tooldir+")/bin/"+targetname.lnk.cmd +" "+targetname.lnk.opts);
- libmakefile.writeLine("RTSLIB = -l $("+tooldir+")/lib/"+rtslib);
+ }
+
+ 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("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts);
+ libmakefile.writeLine("ASFLAGS_INTERNAL = " +targetname.asmOpts.prefix+" "+targetname.asm.opts);
+ libmakefile.writeLine("ARFLAGS_INTERNAL = " +targetname.ar.opts);
+ 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");
+
}
else
{
- print("Error: Non-TI targets are not currently supported ");
- java.lang.System.exit(1);
+
+ if(stringname.match("ti.targets"))
+ {
- }
+ var rtslibtemp = targetname.lnkOpts.suffix.toString().split("/");
+ var rtslib;
+ for(n=0;n<rtslibtemp.length;n++)
+ {
+ if(rtslibtemp[n].match(".lib"))
+ {
+ rtslib=rtslibtemp[n];
+ }
+ }
+
+ libmakefile.writeLine("CC = $("+tooldir+")/bin/"+targetname.cc.cmd);
+ libmakefile.writeLine("AC = $("+tooldir+")/bin/"+targetname.asm.cmd);
+ libmakefile.writeLine("ARIN = $("+tooldir+")/bin/"+targetname.ar.cmd);
+ libmakefile.writeLine("LD = $("+tooldir+")/bin/"+targetname.lnk.cmd);
+ libmakefile.writeLine("RTSLIB = -l $("+tooldir+")/lib/"+rtslib);
+ }
+ else
+ {
+ print("Error: Non-TI targets are not currently supported ");
+ java.lang.System.exit(1);
+
+ }
- libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR))))");
- 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("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() + "/obj");
+ 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("CFLAGS_INTERNAL = " +targetname.ccOpts.prefix+" "+targetname.cc.opts);
+ libmakefile.writeLine("ASFLAGS_INTERNAL = " +targetname.asmOpts.prefix+" "+targetname.asm.opts);
+ libmakefile.writeLine("ARFLAGS_INTERNAL = " +targetname.ar.opts);
+ libmakefile.writeLine("LNKFLAGS_INTERNAL = " +targetname.lnk.opts);
+ /* 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");
+ }
- return libmakefile;
+ return libmakefile;
}
-function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName)
+function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName, objDir)
{
var sourcestring = (srcString + fileExt).toString().toUpperCase();
var compileflagstring = sourcestring + "FLAGS";
@@ -340,8 +397,8 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
makefilename.writeLine(compileflagstring+" = "+compileflags +" \n");
makefilename.writeLine("# Make Rule for the "+srcString+" Files");
- makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", $(OBJDIR)/%.$(OBJEXT), $(" + sourcestring + "))");
- makefilename.writeLine("\n$("+objectliststring+"): $(OBJDIR)/%.$(OBJEXT): %."+fileExt);
+ makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", "+objDir+"/%.$(OBJEXT), $(" + sourcestring + "))");
+ makefilename.writeLine("\n$("+objectliststring+"): "+objDir+"/%.$(OBJEXT): %."+fileExt);
if(fileExt == "c")
{
makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ...");
@@ -354,21 +411,33 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
if(fileExt == "c")
{
- makefilename.writeLine("\t$(RM) $@.dep");
- makefilename.writeLine("\t$(CC) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fc $< ");
- makefilename.writeLine("\t-@$(CP) $@.dep $@.pp; \\");
- makefilename.writeLine(" $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\$$//' \\");
- makefilename.writeLine(" -e '/^$$/ d' -e 's/$$/ :/' < $@.pp >> $@.dep; \\");
- makefilename.writeLine(" $(RM) $@.pp ");
+ if ((targetName.name == "A15F") || (targetName.name == "A9F") || (targetName.name == "A8F"))
+ {
+ makefilename.writeLine("\t$(RM) $@.dep");
+ makefilename.writeLine("\t$(CC) $(CFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< -o $@");
+ /*
+ TBD
+ */
+ }
+ else
+ {
+ makefilename.writeLine("\t$(RM) $@.dep");
+ makefilename.writeLine("\t$(CC) $(CFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fc $< ");
+ makefilename.writeLine("\t-@$(CP) $@.dep $@.pp; \\");
+ makefilename.writeLine(" $(SED) -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\$$//' \\");
+ makefilename.writeLine(" -e '/^$$/ d' -e 's/$$/ :/' < $@.pp >> $@.dep; \\");
+ makefilename.writeLine(" $(RM) $@.pp ");
+ }
}
else if(fileExt == "asm")
{
- makefilename.writeLine("\t$(AC) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fa $< ");
+ makefilename.writeLine("\t$(AC) $(ASFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) -fa $< ");
}
else if(fileExt == "sa")
{
- makefilename.writeLine("\t$(AC) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< ");
+ makefilename.writeLine("\t$(AC) $(ASFLAGS_INTERNAL) $("+compileflagstring+") $(INTERNALDEFS) $(INCS) $< ");
}
+
makefilename.writeLine("\n#Create Empty rule for dependency");
makefilename.writeLine("$("+objectliststring+"):"+makefilename.$private.fd);
makefilename.writeLine(makefilename.$private.fd+":");
@@ -386,11 +455,50 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
* Utility function which will build a specific library
**************************************************************************/
var makefilelocal;
-function buildLibrary (device, libOptions, libName, target, libFiles)
+
+function buildLibrary (socName, isSoc, libOptions, libName, target, libFiles)
{
- var lldFullLibraryPath = "./lib/" + device.toString() + "/" + libName;
- var lldFullBuildPath = "./build/" + device.toString() + "/" + libName;
- var lldFullLibraryPathMake = "$(LIBDIR)/" + device.toString() + "/" + libName;
+ var targetDir;
+ var objExtDir;
+
+
+ if (target.name == "A15F")
+ {
+ targetDir = "armv7";
+ }
+ else if (target.name == "A9F")
+ {
+ targetDir = "armv7";
+ }
+ else if (target.name == "A8F")
+
+ {
+ targetDir = "armv7";
+ }
+ else if (target.name == "M4")
+ {
+ targetDir = "m4";
+ }
+ else
+ {
+ targetDir = "c66";
+ }
+
+ /* Derive the operating system and soc names */
+ if (isSoc == "true") {
+ var libNameExp = libName+"."+socName;
+ targetDir = socName+"/"+targetDir;
+ objExtDir = "soc";
+ }
+ else {
+ var libNameExp = libName;
+ objExtDir = "all";
+ }
+
+
+ var lldFullLibraryPath = "./lib/" + targetDir +"/" + libNameExp;
+ var lldFullBuildPath = "./build/" + targetDir +"/" + libNameExp;
+ var lldFullLibraryPathMake = "$(LIBDIR)/" + targetDir +"/" + libNameExp;
/* Create Main make file in the root of package folder */
makefilelocal = createMake(makefilelocal);
makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@");
/* Create Library make file in the lib folder */
- var makefilelib= createLibMake(device, lib+".mk",target,objectPath);
+ var makefilelib= createLibMake(socName, lib+".mk",target,objectPath);
/* Rule to clean library in main makefile */
makefilelocal.writeLine("# Rule to clean "+libMake+" library");
}
if(cfiles.length > 0)
{
- makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target);
+ makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target, "$(OBJDIR)");
librule += " $(COMMONSRCCOBJS)";
}
if(afiles.length > 0)
{
- makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target);
+ makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target, "$(OBJDIR)");
librule += " $(COMMONSRCASMOBJS)";
}
if(safiles.length > 0)
{
- makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target);
+ makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target, "$(OBJDIR)");
librule += " $(COMMONSRCSAOBJS)";
}
makefilelib.writeLine(librule);
makefilelib.writeLine("\t@echo archiving $? into $@ ...");
- makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/" + device.toString() + " ]; then $(MKDIR) $(LIBDIR)/" + device.toString() + " ; fi;");
- makefilelib.writeLine("\t$(ARIN) $@ $?");
- makefilelib.close();
+ makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/" + targetDir + " ]; then $(MKDIR) $(LIBDIR)/" + targetDir + " ; fi;");
+ makefilelib.writeLine("\t$(ARIN) $(ARFLAGS_INTERNAL) $@ $?");
+ makefilelib.close();
-
/* 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. */
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++] = lldFullBuildPath + ".a" + target.suffix + ".mk";
+ Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix;
/* We need to clean after ourselves; extend the 'clean' target to take care of this. */
- Pkg.makeEpilogue += "clean::\n\t";
- Pkg.makeEpilogue += "$(RM) " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt\n\n";
+ Pkg.makeEpilogue += "\nclean::\n";
+ Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n";
+ Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + targetDir + "/ \n\n";
return lib;
}
-/**************************************************************************
- * FUNCTION NAME : createMiniPkg
- **************************************************************************
- * DESCRIPTION :
- * The function is responsible for creating the mini tar package
- * The MINI package has the following files:-
- * - Driver Source Files.
- * - Header files (exported and internal driver files)
- * - Simple Makefiles.
- **************************************************************************/
-function createMiniPkg(pkgName)
-{
- /* Get the package Name. */
- var packageRepository = xdc.getPackageRepository(Pkg.name);
- var packageBase = xdc.getPackageBase(Pkg.name);
- var packageName = packageBase.substring(packageRepository.length + 1);
-
- /* Convert the Package name by replacing back slashes with forward slashes. This is required because
- * otherwise with long names the tar is unable to change directory. */
- var newPkgName = new java.lang.String(packageRepository);
- var newPkgRep = newPkgName.replace('\\', '/');
-
- /* Step1: Create the MINI Package and add the simple Big and Little Endian Makefiles to the package */
- Pkg.makeEpilogue += "release: mini_pkg\n";
- Pkg.makeEpilogue += "mini_pkg:\n";
- Pkg.makeEpilogue += "\t tar -C " + '"' + newPkgRep + '"' + " -cf packages/" + pkgName + "_mini.tar " +
- packageName + "simpleC66LE.mak " +
- packageName + "simpleC66BE.mak\n";
-
- /* Step2: Add the exported header files to the package */
- var includeFiles = listAllFiles (".h", ".", false);
- for (var k = 0 ; k < includeFiles.length; k++)
- Pkg.makeEpilogue += "\t tar -C " + '"' + newPkgRep + '"' + " -rf packages/" + pkgName + "_mini.tar " +
- packageName + includeFiles[k] + "\n";
-
- /* Step3: Add the driver source files to the package; the filter should have generated a source listing */
- Pkg.makeEpilogue += "\t tar -C " + '"' + newPkgRep + '"' + " -T src.lst -rf packages/" + pkgName + "_mini.tar " + "\n";
-
- /* Ensure that we clean up the mini package */
- Pkg.makeEpilogue += "clean::\n";
- Pkg.makeEpilogue += "\t $(RM) packages/" + pkgName + "_mini.tar\n";
-}
+
diff --git a/config.bld b/config.bld
index 40ca95f93927ade9cdc394b3c198deec79aa36ef..fb2ca6af04225bc57003b8281d0edbcfea9c2514 100644 (file)
--- a/config.bld
+++ b/config.bld
*****************************************************************************/
/* Get the Tools Base directory from the Environment Variable. */
-var toolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
+var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
-/* Get the base directory for the RM LLD Package */
-var fault_mgmtlibPath = new java.io.File(".//").getPath();
+/* Get the extended debug flags for C66x,
+ * did not change the name for backwards compatibilty */
+var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");
-var fault_mgmtlibInstallType;
+/* Get the base directory for the FM Package */
+var lldPath = new java.io.File(".//").getPath();
-/* Read the part number from the environment variable. */
-var fault_mgmtlibPartNumber = java.lang.System.getenv("PARTNO");
+var lldInstallType;
-/* Read the SOC family from the environment variable. */
-var fault_mgmtlibSocFamily = java.lang.System.getenv("SOC_FAMILY");
-if (fault_mgmtlibSocFamily == null) {
- fault_mgmtlibSocFamily = "";
-}
+/* Read the part number from the environment variable. */
+var lldPartNumber = java.lang.System.getenv("PARTNO");
/* Include Path */
-var fault_mgmtlibIncludePath = " -i" + fault_mgmtlibPath + "/src" + " -i" + fault_mgmtlibPath + " -i" + fault_mgmtlibPath + "/test";
+var lldIncludePath = " -I" + lldPath + "/src" + " -I" + lldPath + " -I" + lldPath + "/test";
/* Configure the Fault Management Release Version Information */
/* 3 steps: remove SPACE and TAB, convert to string and split to make array */
-var fault_mgmtlibReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
+var lldReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
/* Fault Management Coverity Analysis: Check the environment variable to determine if Static
* Analysis has to be done on the Fault Management Code base or not? */
-var fault_mgmtlibCoverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");
+var lldCoverityAnalysis = java.lang.System.getenv("LLDCOV");
/* 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";
+C66LE.rootDir = c66ToolsBaseDir;
+C66LE.ccOpts.prefix = "-mo -o3 --gcc -q -k -eo.o";
+if(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";
+C66BE.rootDir = c66ToolsBaseDir;
+C66BE.ccOpts.prefix = "-mo -o3 --gcc -q -k -eo.o -DBIGENDIAN";
+if(extDbgFlags)
+ C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags;
/* Check if we need to run the STATIC Analysis or not? */
var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE");
}
-/* List all the build targets here. */
-Build.targets = [ C66LE, C66BE ];
+/* Create the SoC List */
+var socs = {
+ /* device independent libraries */
+ all :
+ {
+ /* Build this library */
+ build: "true",
+ /* SoC lib enabled */
+ socDevLib: "false",
+ /* dma lib enabled */
+ dmaDevLib: "false",
+ /* Library options */
+ copts: "",
+ /* target lists, kept blank now, would be updated based on argument lists */
+ targets: []
+ },
+ tci6614 :
+ {
+ /* this variable would be reinitialized to true, if XDCARGS contains tci6614 */
+ build: "false",
+ /* SoC lib enabled */
+ socDevLib: "false",
+ /* dma lib enabled */
+ dmaDevLib: "false",
+ /* Library options */
+ copts: "",
+ /* target list */
+ targets: [ C66LE, C66BE]
+ },
+ k2h :
+ {
+ /* this variable would be reinitialized to true, if XDCARGS contains k2h */
+ build: "false",
+ /* SoC lib enabled */
+ socDevLib: "false",
+ /* dma lib enabled */
+ dmaDevLib: "false",
+ /* Library options */
+ copts: " -DDEVICE_K2H",
+ /* target list */
+ targets: [ C66LE, C66BE]
+ },
+ k2k :
+ {
+ /* this variable would be reinitialized to true, if XDCARGS contains k2k */
+ build: "false",
+ /* SoC lib enabled */
+ socDevLib: "false",
+ /* dma lib enabled */
+ dmaDevLib: "false",
+ /* Library options */
+ copts: " -DDEVICE_K2K",
+ /* target list */
+ targets: [ C66LE, C66BE]
+ },
+ k2e :
+ {
+ /* this variable would be reinitialized to true, if XDCARGS contains k2e */
+ build: "false",
+ /* SoC lib enabled */
+ socDevLib: "false",
+ /* dma lib enabled */
+ dmaDevLib: "false",
+ /* Library options */
+ copts: " -DDEVICE_K2E",
+ /* target list */
+ targets: [ C66LE, C66BE]
+ },
+ k2l :
+ {
+ /* this variable would be reinitialized to true, if XDCARGS contains k2l */
+ build: "false",
+ /* SoC lib enabled */
+ socDevLib: "false",
+ /* dma lib enabled */
+ dmaDevLib: "false",
+ /* Library options */
+ copts: " -DDEVICE_K2L",
+ /* target list */
+ targets: [ C66LE, C66BE]
+ }
+};
+
+/**************************************************************************
+ * 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;
+}
+
+/* Grab input from XDCARGS */
+var buildArguments = [];
+
+/* Construct the build arguments */
+for (var tmp=0; arguments[tmp] != undefined; tmp++)
+{
-/* List of all devices that combine to make the fault_mgmt library. */
-var devices = [ "tci6614/c66", "k2h/c66", "k2k/c66", "k2e/c66", "k2l/c66" ];
+ /* 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;
+ }
+ }
+ }
+}
-/* Order must exactly match list in "var devices" */
-var devicesCCOpt = [ "", " -DDEVICE_K2H", " -DDEVICE_K2K", " -DDEVICE_K2E", " -DDEVICE_K2L"];
+/* Update the Build target generated list */
+socs["all"].targets = build_targets;
+Build.targets = build_targets;
-/* Order must exactly match list in "var devices" */
-var devicesSocFamily = [ "", "KeyStone2", "KeyStone2", "KeyStone2", "KeyStone2"];
diff --git a/package.bld b/package.bld
index b6da10f482ae64696d7cfa5b354646a90ec96430..96c2e8c56d184b5e2f601f5bdf6fe626eabaf374 100644 (file)
--- a/package.bld
+++ b/package.bld
*
* DESCRIPTION:
* This file contains the build specification and description for the
- * Packet Library
+ * FM Library
*
* The file takes the following parameters from the command line through the
* XDCARGS variable.
- * XDCARGS[0] = Consumer Library Install Type
+ * XDCARGS[0] = FM Install Type
* Valid Values are "TAR" or "SETUP"
* DEFAULT is "SETUP"
*
* Example for a valid command:
* xdc XDCARGS="SETUP" release
*
- * Copyright (C) 2012-2014 Texas Instruments, Inc.
+ * Copyright (C) 2012-2015, Texas Instruments, Inc.
*****************************************************************************/
/* List of all subdirectories that combine to make the Fault Management Package. */
-var subDirectories = [ "src", "docs", "device", "test", "include", "util"];
+var subDirectories = ["src", "docs", "device", "include", "test", "util"];
+
+/* Generate fault_mgmtlibver.h */
+var tplt = xdc.loadTemplate("./fault_mgmtlibver.h.xdt");
+tplt.genFile("./fault_mgmtlibver.h",lldReleaseVersion);
/* Determine if we need to create the InstallJammer Application or not?
* Fault Management Deliverables be either of the following formats:
* DEFAULT is a TAR Executable. */
if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
- fault_mgmtlibInstallType = "TAR";
+ lldInstallType = "TAR";
else
- fault_mgmtlibInstallType = arguments[0];
+ lldInstallType = arguments[0];
/* Irrespective of the InstallType we always create a TAR Ball Package as a part
* of the RTSC Build. Here we determine the name of the TAR Ball Package
* Format is as follows:
- * fault_mgmtlib_<version> */
-var fault_mgmtlibRTSCFileName = "fault_mgmtlib" + "_" + fault_mgmtlibPartNumber + "_" +
- fault_mgmtlibReleaseVersion[0] + "_" + fault_mgmtlibReleaseVersion[1] + "_" +
- fault_mgmtlibReleaseVersion[2] + "_" + fault_mgmtlibReleaseVersion[3];
+ * lld_<version> */
+var lldRTSCFileName = "fault_mgmtlib" + "_" + lldPartNumber + "_" +
+ lldReleaseVersion[0] + "_" + lldReleaseVersion[1] + "_" +
+ lldReleaseVersion[2] + "_" + lldReleaseVersion[3];
-/*****************************************************************
- ************************ Release Banner *************************
- *****************************************************************/
+/******************************************************************
+ ************************ Release Banner **************************
+ ******************************************************************/
print ("************* Fault Management Library Build Information *************");
-print ("Fault Management Lib Install : " + fault_mgmtlibInstallType);
-print ("Fault Management Lib Version : " + fault_mgmtlibReleaseVersion);
-print ("Tools Directory : " + toolsBaseDir);
-print ("RTSC File Name : " + fault_mgmtlibRTSCFileName);
-print ("Fault Management Lib Path : " + fault_mgmtlibPath);
+print ("Fault Management Lib Install : " + lldInstallType);
+print ("Fault Management Lib Version : " + lldReleaseVersion);
+print ("C66 Tools Directory : " + c66ToolsBaseDir);
+print ("RTSC File Name : " + lldRTSCFileName);
+print ("Fault Management Lib Path : " + lldPath);
print ("Coverity Analysis : " + (coverityAnalysis == "ON" ? "ON" : "OFF"));
-print ("C66 LE opts : " + C66LE.ccOpts.prefix);
-print ("C66 BE opts : " + C66BE.ccOpts.prefix);
+print ("CC LE opts : " + C66LE.ccOpts.prefix);
+print ("CC BE opts : " + C66BE.ccOpts.prefix);
print ("***********************************************************");
/* Create the release package for the Fault Management Library */
-Pkg.defaultRelease = Pkg.addRelease (fault_mgmtlibRTSCFileName, {prefix: "./packages/"});
+Pkg.defaultRelease = Pkg.addRelease (lldRTSCFileName, {prefix: "./packages/"});
/* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
* not supported in the XDC tools being used. Currenly builds need to be done with the
/* Generate Users Manual Doxyfile */
var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
-tplt.genFile("./docs/Doxyfile",fault_mgmtlibReleaseVersion);
+tplt.genFile("./docs/Doxyfile",lldReleaseVersion);
/* Generate Settings.xdc */
var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
-tplt.genFile("./Settings.xdc",fault_mgmtlibReleaseVersion);
-
-/* Generate fault_mgmtlibver.h */
-var tplt = xdc.loadTemplate("./fault_mgmtlibver.h.xdt");
-tplt.genFile("./fault_mgmtlibver.h",fault_mgmtlibReleaseVersion);
+tplt.genFile("./Settings.xdc",lldReleaseVersion);
/* Check if we need to create the mini package? */
var miniBuild = java.lang.System.getenv("MINI_PACKAGE");
***************************************************************************/
/* Create the MINI RTSC Package */
var libUtility = xdc.loadCapsule ("build/buildlib.xs");
- libUtility.createMiniPkg(fault_mgmtlibRTSCFileName);
+ libUtility.createMiniPkg(lldRTSCFileName);
}
/*********************************************************************
* This can be done only after the 'release' package has been created.
* Thus all of this work is being done in the EPILOGUE.
*********************************************************************/
-if (fault_mgmtlibInstallType == "SETUP")
+if (lldInstallType == "SETUP")
{
/* Create the Install Jammer Version Variable. This is used inside the
* MPI File to create the Final executable.
* - setupwin32_fault_mgmtlib-<part_number>-<version>.exe
* This is for Fault Management Libraries and Header files
*/
- var InstallJammerVersion = "-DVersion " + fault_mgmtlibPartNumber + "_" +
- fault_mgmtlibReleaseVersion[0] + "_" + fault_mgmtlibReleaseVersion[1] + "_" +
- fault_mgmtlibReleaseVersion[2] + "_" + fault_mgmtlibReleaseVersion[3];
+ var InstallJammerVersion = "-DVersion " + lldPartNumber + "_" + lldReleaseVersion[0] + "_" +
+ lldReleaseVersion[1] + "_" + lldReleaseVersion[2] + "_" + lldReleaseVersion[3];
/* This is the location where the tmp directory is located; this is used as
* the input directory for the Install Jammer. */
- var PackageBaseDir = " -DPackageBaseDir " + fault_mgmtlibPath + "./tmp";
+ var PackageBaseDir = " -DPackageBaseDir " + lldPath + "./tmp";
/* This is the location where the Fault Management will be installed by default. */
- var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/fault_mgmtlib" + "_" +
- fault_mgmtlibPartNumber + "_" +
- fault_mgmtlibReleaseVersion[0] + "_" + fault_mgmtlibReleaseVersion[1] + "_" +
- fault_mgmtlibReleaseVersion[2] + "_" + fault_mgmtlibReleaseVersion[3];
+ var WinInstallDir = " -DWinInstallDir C:/ti/fault_mgmtlib" + "_" +
+ lldPartNumber + "_" +
+ lldReleaseVersion[0] + "_" + lldReleaseVersion[1] + "_" +
+ lldReleaseVersion[2] + "_" + lldReleaseVersion[3];
/* Create the actual EPILOGUE Section for the INSTALLER */
Pkg.makeEpilogue += "release: install_application\n";
Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n";
Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n";
Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";
- Pkg.makeEpilogue += "\t tar -xf ./packages/" + fault_mgmtlibRTSCFileName + ".tar" + " -Ctmp/packages \n";
+ Pkg.makeEpilogue += "\t tar -xf ./packages/" + lldRTSCFileName + ".tar" + " -Ctmp/packages \n";
Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir +
" --output-dir packages/ --build install/fault_mgmtlib.mpi\n";
Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";
+}
/* We need to clean after ourselves; extend the 'clean' target to take care of this. */
Pkg.makeEpilogue += "clean::\n";
+Pkg.makeEpilogue += "\t -$(RM) docs/Doxyfile Settings.xdc fault_mgmtlibver.h\n";
+Pkg.makeEpilogue += "\t -$(RM) makefile\n";
+Pkg.makeEpilogue += "\t -$(RMDIR) docs/doxygen\n";
+if (lldInstallType == "SETUP")
+{
Pkg.makeEpilogue += "\t -$(RM) packages/*.exe\n";
Pkg.makeEpilogue += "\t -$(RM) packages/*.bin\n";
+ Pkg.makeEpilogue += "\t -$(RMDIR) eclipse\n\n";
+}
+if (miniBuild == "ON")
+{
+ Pkg.makeEpilogue += "\t -$(RM) simpleC66LE.mak\n";
+ Pkg.makeEpilogue += "\t -$(RM) simpleC66BE.mak\n";
}
diff --git a/package.xdc b/package.xdc
index 0f465da6207826274143b18d2b278a16b7698fd2..5276151f4b647aaa4ae1565e9ea924601d47e2f0 100644 (file)
--- a/package.xdc
+++ b/package.xdc
* Copyright (C) 2012-2015 Texas Instruments, Inc.
*****************************************************************************/
-package ti.instrumentation.fault_mgmt[1, 0, 1, 2] {
+package ti.instrumentation.fault_mgmt[1, 0, 1, 3] {
module Settings;
}
-
diff --git a/package.xs b/package.xs
index 1e36ef29237e3a375584ebc87bf86cd8648c2524..6768b8a5399821a91242a6dc3788b683b3d4482a 100644 (file)
--- a/package.xs
+++ b/package.xs
function getLibs(prog)
{
-
var suffix = prog.build.target.suffix;
-
- /* Default FM library */
var name = this.$name + ".a" + suffix;
+ var socType = this.Settings.deviceType;
+
+ socType = socType.toLowerCase();
+
/* Read LIBDIR variable */
var lib = java.lang.System.getenv("LIBDIR");
print ("\tSystem environment LIBDIR variable defined : " + lib);
}
- /* Device types supported */
- var deviceTypes = [
+ /* SoC types supported */
+ var socTypes = [
'tci6614',
'k2k',
'k2h',
'k2l',
'k2e',
];
-
- /* Search for the supported devices (defined in config.bld) */
- for each(var device in deviceTypes)
+
+ /* Get the SOC */
+ for each (var soc in socTypes)
{
- if (this.Settings.deviceType.equals(device))
+ if (socType.equals(soc))
{
- lib = lib + "/" + device;
+ lib = lib + "/" + soc;
+ name = this.$name + "." + soc + ".a" + suffix;
break;
}
}
/* Get target folder, if applicable */
if ( java.lang.String(suffix).contains('66') )
lib = lib + "/c66";
+ else if ( java.lang.String(suffix).contains('m4') )
+ lib = lib + "/m4";
+ else
+ lib = lib + "/armv7";
/* Get library name with path */
lib = lib + "/" + name;
}
/* Could not find any library, throw exception */
- throw new Error("\tLibrary not found : " + name);
+ throw new Error("\tLibrary not found: " + this.packageBase + lib);
}
/*
diff --git a/src/Module.xs b/src/Module.xs
index 4bc6c8d102de18518e585316f15a9505c378106a..f6fa5492567d62aaedc965b8109ff829d27015f0 100644 (file)
--- a/src/Module.xs
+++ b/src/Module.xs
* DESCRIPTION:
* This file contains the module specification for the Fault Management source directory.
*
- * Copyright (C) 2012-2014 Texas Instruments, Inc.
+ * Copyright (C) 2012-2015, Texas Instruments, Inc.
*****************************************************************************/
/* Load the library utility. */
**************************************************************************/
function modBuild()
{
- /* Build the libraries for all the targets specified. */
- for (var device=0; device < devices.length; device++)
+ /* Build the device independent libraries for all the targets specified. */
+ for (var targets=0; targets < socs["all"].targets.length; targets++)
{
- /* Only build libraries within the specified SOC Family */
- if (devicesSocFamily[device] == fault_mgmtlibSocFamily)
- {
+ var targetFiles = rmlldFile.slice(); /* make copy */
+ var libOptions = {
+ copts: socs["all"].copts,
+ incs: lldIncludePath,
+ };
+ libUtility.buildLibrary ("", "false", libOptions, Pkg.name, socs["all"].targets[targets], targetFiles);
+ }
+
+ /* Build library targets for device dependent SoCs */
+ for (var soc=0; soc < soc_names.length; soc++)
+ {
+ var dev = socs[soc_names[soc]];
+
+ /* do not proceed if this SoC is not configured to be built */
+ if (dev.build == "false")
+ continue;
+
+ if (dev.socDevLib == "true")
+ {
+ var targetFiles_soc = rmlldFile.slice(); /* make copy */
/* Build the libraries for all the targets specified. */
- for (var targets=0; targets < Build.targets.length; targets++)
+ for (var targets=0; targets < dev.targets.length; targets++)
{
var libOptions = {
- copts: devicesCCOpt[device],
- incs: fault_mgmtlibIncludePath,
+ copts: dev.copts,
+ incs: lldIncludePath,
};
-
- libUtility.buildLibrary (devices[device], libOptions, "ti.instrumentation.fault_mgmt", Build.targets[targets], fault_mgmtLibFiles);
+ libUtility.buildLibrary (soc_names[soc], "true", libOptions, Pkg.name, dev.targets[targets], targetFiles_soc);
}
- }
+ }
}
/* Add all the .c files to the release package. */