]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
SDOCM00099002 Make LibType_Debug build profile same as custom.
authorRamsey Harris <ramsey@ti.com>
Wed, 6 Nov 2013 19:56:10 +0000 (11:56 -0800)
committerChris Ring <cring@ti.com>
Fri, 8 Nov 2013 19:50:12 +0000 (11:50 -0800)
Merged updates in ti.sysbios.Build module into ti.ipc.sdo.Build.
Turn off package library builds when building IPC for product
release. Added ti.sdo.ipc.Build.libType config param. Added source
files to Pkg.otherFiles for source only release. Added package
debug library build support. Removed package ti.sdo.utils from
ti.sdo.ipc.Build file list, it builds separately now.

59 files changed:
ipc-bios.bld
ipc-bios.mak
packages/ti/sdo/ipc/Build.xdc
packages/ti/sdo/ipc/Build.xdt
packages/ti/sdo/ipc/Build.xs
packages/ti/sdo/ipc/build/test.bld
packages/ti/sdo/ipc/debugMakefile.xdt [new file with mode: 0644]
packages/ti/sdo/ipc/family/arctic/package.bld
packages/ti/sdo/ipc/family/arctic/package.xs
packages/ti/sdo/ipc/family/c647x/package.bld
packages/ti/sdo/ipc/family/c647x/package.xs
packages/ti/sdo/ipc/family/c6a8149/package.bld
packages/ti/sdo/ipc/family/c6a8149/package.xs
packages/ti/sdo/ipc/family/da830/package.bld
packages/ti/sdo/ipc/family/da830/package.xs
packages/ti/sdo/ipc/family/dm6446/package.bld
packages/ti/sdo/ipc/family/dm6446/package.xs
packages/ti/sdo/ipc/family/f28m35x/package.bld
packages/ti/sdo/ipc/family/f28m35x/package.xs
packages/ti/sdo/ipc/family/omap3530/package.bld
packages/ti/sdo/ipc/family/omap3530/package.xs
packages/ti/sdo/ipc/family/omap4430/package.bld
packages/ti/sdo/ipc/family/omap4430/package.xs
packages/ti/sdo/ipc/family/package.bld
packages/ti/sdo/ipc/family/package.xs
packages/ti/sdo/ipc/family/tci663x/package.bld
packages/ti/sdo/ipc/family/tci663x/package.xs
packages/ti/sdo/ipc/family/ti81xx/package.bld
packages/ti/sdo/ipc/family/ti81xx/package.xs
packages/ti/sdo/ipc/family/vayu/package.bld
packages/ti/sdo/ipc/family/vayu/package.xs
packages/ti/sdo/ipc/gates/package.bld
packages/ti/sdo/ipc/gates/package.xs
packages/ti/sdo/ipc/heaps/package.bld
packages/ti/sdo/ipc/heaps/package.xs
packages/ti/sdo/ipc/instrumented.cfg.xs
packages/ti/sdo/ipc/interfaces/package.bld
packages/ti/sdo/ipc/interfaces/package.xs
packages/ti/sdo/ipc/makefile.xdt
packages/ti/sdo/ipc/makefile_gccArmLto.xdt
packages/ti/sdo/ipc/nonInstrumented.cfg.xs
packages/ti/sdo/ipc/notifyDrivers/package.bld
packages/ti/sdo/ipc/notifyDrivers/package.xs
packages/ti/sdo/ipc/nsremote/package.bld
packages/ti/sdo/ipc/nsremote/package.xs
packages/ti/sdo/ipc/package.bld
packages/ti/sdo/ipc/package.xs
packages/ti/sdo/ipc/transports/package.bld
packages/ti/sdo/ipc/transports/package.xs
packages/ti/sdo/utils/Build.xdc
packages/ti/sdo/utils/Build.xdt
packages/ti/sdo/utils/Build.xs
packages/ti/sdo/utils/debugMakefile.xdt [new file with mode: 0644]
packages/ti/sdo/utils/instrumented.cfg.xs
packages/ti/sdo/utils/makefile.xdt
packages/ti/sdo/utils/makefile_gccArmLto.xdt
packages/ti/sdo/utils/nonInstrumented.cfg.xs
packages/ti/sdo/utils/package.bld
packages/ti/sdo/utils/package.xs

index d0b3e24a2398671c0251cf15e27c7f481e6a7394..e96b008970b5a1d1253666b844d117a98ae00b56 100644 (file)
@@ -115,6 +115,7 @@ var lnkOpts = {
 
 var platform = "";
 var smpEnabled = true;
+var Bld_goal = "";
 
 /* initialize local vars with those set in xdcpaths.mak (via XDCARGS) */
 for (arg = 0; arg < arguments.length; arg++) {
@@ -133,6 +134,15 @@ for (arg = 0; arg < arguments.length; arg++) {
         smpEnabled = configParts[0].split("=")[1].match(/^1$/);
         continue;
     }
+    else if (configParts[0].split("=")[0] == "GOAL") {
+        Bld_goal = configParts[0].split("=")[1];
+        continue;
+    }
+
+    if (platform == "") {
+        platform = "NONE";
+    }
+
     /*
      * Get the compiler's installation directory.
      * For "ti.targets.elf.C674=/vendors/c6x/7.2.0", we get "/vendors/c6x/7.2.0"
@@ -193,6 +203,10 @@ for (arg = 0; arg < arguments.length; arg++) {
                 target.platforms.$add("ti.platforms.evmDRA7XX:dsp2");
                 break;
 
+            case 'NONE':
+                /* okay, no platform specified */
+                break;
+
             default:
                 print("Unknown platform, skipping " + platform);
                 break;
@@ -216,6 +230,10 @@ for (arg = 0; arg < arguments.length; arg++) {
                 target.platforms.$add("ti.platforms.evmDRA7XX:ipu1");
                 break;
 
+            case 'NONE':
+                /* okay, no platform specified */
+                break;
+
             default:
                 print("Unknown platform, skipping " + platform);
                 break;
index de0628e20244c1aa0b6860e66ac69a85cdb4a626..0946f025810a50d717e7ec1dc869b25051352173 100644 (file)
@@ -96,6 +96,10 @@ XDCARGS= \
     gnu.targets.arm.A8F=\"$(gnu.targets.arm.A8F)\" \
     gnu.targets.arm.A15F=\"$(gnu.targets.arm.A15F)\"
 
+ifeq ($(MAKECMDGOALS),release)
+    XDCARGS += GOAL=release
+endif
+
 #
 # Get list of packages to rebuild. Remove examples from the list.
 #
@@ -137,19 +141,19 @@ XDC = $(XDC_INSTALL_DIR)/xdc XDCARGS="$(XDCARGS)" XDCBUILDCFG=./ipc-bios.bld
 ######################################################
 
 all:
-       @ echo building ipc packages ...
+       @echo building ipc packages ...
 # build everything in the Bios IPC package
-       @ $(XDC) -P $(LIST)
+       @$(XDC) -P $(LIST)
 
 libs:
        @echo "#"
        @echo "# Making $@ ..."
-       $(XDC) .dlls -P $(LIST)
+       @$(XDC) .dlls -P $(LIST)
 
 release:
-       @ echo building ipc packages ...
+       @echo building ipc packages ...
 # create a XDC release for the Bios IPC package
-       @ $(XDC) release -P $(LIST)
+       @$(XDC) release -P $(LIST)
 
 clean:
        @ echo cleaning ipc packages ...
index d0cf318a38187178ff5d093ae316b804ec94f4c9..992afbeaa99be01d4677e7fbb20e11f38a518f80 100644 (file)
 @Template("./Build.xdt")
 metaonly module Build
 {
+    /*!
+     *  ======== LibType ========
+     *  IPC library selection options
+     *
+     *  This enumeration defines all the IPC library types provided
+     *  by the product. You can select the library type by setting
+     *  the {@link #libType Build.libType} configuration parameter.
+     *
+     *  @field(LibType_Instrumented) The library supplied is prebuilt
+     *  with logging and assertions enabled.
+     *
+     *  @field(LibType_NonInstrumented) The library supplied is prebuilt
+     *  with logging and assertions disabled.
+     *
+     *  @field(LibType_Custom) This option builds the IPC library from
+     *  sources using the options specified by {@link #customCCOpts}.
+     *  Only the modules and APIs that your application uses are
+     *  contained in the resulting executable. Program optimization is
+     *  performed to reduce the size of the executable and improve
+     *  performance. Enough debug information is retained to allow you
+     *  to step through the application code in CCS and locate global
+     *  variables.
+     *
+     *  @field(LibType_Debug) This option is similar to the LibType_Custom
+     *  option in that it builds the IPC library from sources and omits
+     *  modules and APIs that your code does not use. However, no program
+     *  optimization is performed. The resulting executable is fully
+     *  debuggable, and you can step into IPC code. The tradeoff is that
+     *  the executable is larger and runs slower than builds that use the
+     *  LibType_Custom option.
+     *
+     *  @field(LibType_PkgLib) This option uses the individual libraries
+     *  built by each package of the IPC product. These libraries are
+     *  not shipped. You must build the product to generate the package
+     *  libraries. See the IPC Install Guides (links in the Release
+     *  Note) for details on building the IPC product.
+     *
+     *  @see #libType
+     */
+    enum LibType {
+        LibType_Instrumented,           /*! Instrumented */
+        LibType_NonInstrumented,        /*! Non-instrumented */
+        LibType_Custom,                 /*! Custom (Optimized) */
+        LibType_Debug,                  /*! Custom (Debug) */
+        LibType_PkgLib                  /*! Use package library */
+    };
+
+    /*!
+     *  ======== libType ========
+     *  IPC library type
+     *
+     *  The IPC runtime is provided in the form of a library that is
+     *  linked with your application. Several forms of this library are
+     *  provided with the IPC product. In addition, there is an option
+     *  to build the library from source. This configuration parameter
+     *  allows you to select the form of the IPC library to use.
+     *
+     *  The default value of libType is taken from the BIOS.libType
+     *  configuration parameter. For a complete list of options and
+     *  what they offer see {@link #LibType}.
+     */
+    config LibType libType;
+
+    /*!
+     *  ======== customCCOpts ========
+     *  Compiler options used when building a custom IPC library
+     *
+     *  When {@link #libType Build.libType} is set to
+     *  {@link #LibType_Custom Build_LibType_Custom} or
+     *  {@link #LibType_Debug Build_LibType_Debug}, this string contains
+     *  the options passed to the compiler during any re-build of the
+     *  IPC sources.
+     *
+     *  In addition to the options specified by `Build.customCCOpts`,
+     *  several `-D` and `-I` options are also passed to the compiler.
+     *  The options specified by `Build.customCCOpts` preceed the `-D`
+     *  and `-I` options passed to the compiler on the command line.
+     *
+     *  To view the custom compiler options, add the following line
+     *  to your config script:
+     *
+     *  @p(code)
+     *  print(Build.customCCOpts);
+     *  @p
+     *
+     *  When {@link #libType Build.libType} is set to
+     *  {@link #LibType_Custom Build_LibType_Custom}, `Build.customCCOpts`
+     *  is initialized to create a highly optimized library.
+     *
+     *  When {@link #libType Build.libType} is set to
+     *  {@link #LibType_Debug Build_LibType_Debug}, `Build.customCCOpts`
+     *  is initialized to create a non-optimized library that can be
+     *  used to single-step through the APIs with the CCS debugger.
+     *
+     *  @a(Warning)
+     *  The default value of `Build.customCCOpts`, which is derived from
+     *  the target specified by your configuration, includes runtime
+     *  model options (such as endianess) that must be the same for all
+     *  sources built and linked into your application. You must not
+     *  change or add any options that can alter the runtime model
+     *  specified by the default value of `Build.customCCOpts`.
+     */
+    config String customCCOpts;
+
+    /*!
+     *  ======== assertsEnabled ========
+     *  IPC assert checking in custom library enable flag
+     *
+     *  When set to true, assert checking code is compiled into
+     *  the custom library created when {@link #libType Build.libType}
+     *  is set to {@link #LibType_Custom Build_LibType_Custom} or
+     *  {@link #LibType_Debug Build_LibType_Debug}.
+     *
+     *  When set to false, assert checking code is removed from the
+     *  custom library created when Build.libType is set to
+     *  Build.LibType_Custom or Build.LibType_Debug. This option can
+     *  considerably improve runtime performance as well significantly
+     *  reduce the application's code size.
+     *
+     *  see {@link #libType Build.libType}.
+     */
+    config Bool assertsEnabled = true;
+
+    /*!
+     *  ======== logsEnabled ========
+     *  IPC log support in custom library enable flag
+     *
+     *  When set to true, IPC execution log code is compiled into
+     *  the custom library created when {@link #libType Build.libType}
+     *  is set to {@link #LibType_Custom Build_LibType_Custom} or
+     *  {@link #LibType_Debug Build_LibType_Debug}.
+     *
+     *  When set to false, all log code is removed from the custom
+     *  library created when Build.libType = Build.LibType_Custom or
+     *  Build.LibType_Debug. This option can considerably improve runtime
+     *  performance as well signficantly reduce the application's code
+     *  size.
+     *
+     *  see {@link #libType Build.libType}.
+     */
+    config Bool logsEnabled = true;
 
     /*!
      *  ======== libDir ========
      */
-    metaonly config String libDir = null;
+    config String libDir = null;
+
+    /*!
+     *  ======== getDefaultCustomCCOpts ========
+     */
+    String getDefaultCustomCCOpts();
 
     /*!
      *  ======== getDefs ========
      *  Get the compiler -D options necessary to build
      */
-    metaonly String getDefs();
+    String getDefs();
 
     /*!
      *  ======== getCFiles ========
      *  Get the library C source files.
      */
-    metaonly String getCFiles(String target);
+    String getCFiles(String target);
 
     /*!
      *  ======== getAsmFiles ========
      *  Get the library Asm source files.
      */
-    metaonly Any getAsmFiles(String target);
+    Any getAsmFiles(String target);
 
     /*
      *  ======== buildLibs ========
index 002749d09d6d957a2765043aaec68b58684d5c08..257684dea309896b49c0b69e2cc82b65992bd2cd 100644 (file)
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 %%}
-%/*
-% *  ======== Build.xdt ========
-% */
-%var BIOS = xdc.module("ti.sysbios.BIOS");
-%var Build = xdc.module("ti.sdo.ipc.Build");
-%if (BIOS.libType == BIOS.LibType_Custom) {
 %%{
-    /* get the specified output directory (saved when BIOS was "used") */
+/*
+ *  ======== Build.xdt ========
+ */
+var Build = xdc.module('ti.sdo.ipc.Build');
+var tplt = "";
+
+if ((Build.libType == Build.LibType_Custom) ||
+        (Build.libType == Build.LibType_Debug)) {
+
+    /* get the specified output directory, set in module$use() */
     var outputDir = this.$private.outputDir;
 
-    /* generate makefile from makefile.xdt
-     *    $args[0] = the RTSC target, so the makefile knows how to run the
-     *               compiler and archiver
+    /* generate makefile from template
+     * $args[0] = the RTSC target, so the makefile knows how to
+     *            run the compiler and archiver
      */
-    print("generating custom ti.sdo.ipc library makefile ... ");
-%%}
+    print("generating custom ti.sdo.ipc library makefile ...");
 
-%if (Program.build.target.$name.match(/gnu/) &&
-%    (Program.build.target.name.match(/A15/) ||
-%     Program.build.target.name.match(/A9/)  ||
-%     Program.build.target.name.match(/A8/))) {
-%%{
-    var tplt = xdc.loadTemplate(this.$package.packageBase + "/makefile_gccArmLto.xdt");
-%%}
-%}
-%else {
-%%{
-    var tplt = xdc.loadTemplate(this.$package.packageBase + "/makefile.xdt");
-%%}
-%}
+    if (Program.build.target.$name.match(/gnu/) &&
+        (Program.build.target.name.match(/M3/) ||
+         Program.build.target.name.match(/M4/) ||
+         Program.build.target.name.match(/M4F/) ||
+         Program.build.target.name.match(/A15/) ||
+         Program.build.target.name.match(/A9/)  ||
+         Program.build.target.name.match(/A8/))) {
 
-%%{
+        tplt = xdc.loadTemplate(this.$package.packageBase +
+                "/makefile_gccArmLto.xdt");
+    }
+    else if (Program.build.target.$name.match(/iar/)) {
+        throw new Error("IAR not supported by IPC");
+    }
+    else {
+        tplt = xdc.loadTemplate(this.$package.packageBase + "/makefile.xdt");
+    }
+
+    /* expand the template */
     tplt.genFile(outputDir + "/makefile", this, [Program.build.target]);
+}
 %%}
-%}
index 0d6a19c7a5b8816a161fb376a5a6ba721a809d0e..026b7fb9800aa37256df400f994142db841a4e80 100644 (file)
 
 var BIOS = null;
 var Build = null;
+var Ipc = null;
+
+var custom28xOpts = " -q -mo ";
+var custom6xOpts = " -q -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 ";
+var customARP32xOpts = " -q --gen_func_subsections ";
+var customArmOpts = " -q -ms --opt_for_speed=2 ";
+var customGnuArmM3Opts = " ";
+var customGnuArmM4Opts = " ";
+var customGnuArmM4FOpts = " ";
+var customGnuArmA9Opts = " ";
+var customGnuArmA8Opts = " ";
+var customGnuArmA15Opts = " ";
+
+var ccOptsList = {
+    "ti.targets.C28_large"                      : custom28xOpts,
+    "ti.targets.C28_float"                      : custom28xOpts,
+    "ti.targets.C64P"                           : custom6xOpts,
+    "ti.targets.elf.C64P"                       : custom6xOpts,
+    "ti.targets.C64P_big_endian"                : custom6xOpts,
+    "ti.targets.elf.C64P_big_endian"            : custom6xOpts,
+    "ti.targets.C674"                           : custom6xOpts,
+    "ti.targets.elf.C674"                       : custom6xOpts,
+    "ti.targets.elf.C67P"                       : custom6xOpts,
+    "ti.targets.elf.C64T"                       : custom6xOpts,
+    "ti.targets.elf.C66"                        : custom6xOpts,
+    "ti.targets.elf.C66_big_endian"             : custom6xOpts,
+    "ti.targets.arp32.elf.ARP32"                : customARP32xOpts,
+    "ti.targets.arp32.elf.ARP32_far"            : customARP32xOpts,
+    "ti.targets.arm.elf.Arm9"                   : customArmOpts,
+    "ti.targets.arm.elf.A8F"                    : customArmOpts,
+    "ti.targets.arm.elf.A8Fnv"                  : customArmOpts,
+    "ti.targets.arm.elf.M3"                     : customArmOpts,
+    "ti.targets.arm.elf.M4"                     : customArmOpts,
+    "ti.targets.arm.elf.M4F"                    : customArmOpts,
+    "gnu.targets.arm.M3"                        : customGnuArmM3Opts,
+    "gnu.targets.arm.M4"                        : customGnuArmM4Opts,
+    "gnu.targets.arm.M4F"                       : customGnuArmM4FOpts,
+    "gnu.targets.arm.A8F"                       : customGnuArmA8Opts,
+    "gnu.targets.arm.A9F"                       : customGnuArmA9Opts,
+    "gnu.targets.arm.A15F"                      : customGnuArmA15Opts,
+};
+
+/*
+ *  ======== module$meta$init ========
+ */
+function module$meta$init()
+{
+    /* Only process during "cfg" phase */
+    if (xdc.om.$name != "cfg") {
+        return;
+    }
+
+    Build = this;
+
+    /*
+     * Set default verbose level for custom build flow
+     * User can override this in their cfg file.
+     */
+    var SourceDir = xdc.module("xdc.cfg.SourceDir");
+    SourceDir.verbose = 2;
+
+    /* register onSet hooks */
+    var GetSet = xdc.module("xdc.services.getset.GetSet");
+    GetSet.onSet(this, "libType", _setLibType);
+
+    /* Construct default customCCOpts value.
+     * User can override this in their cfg file.
+     */
+    Build.customCCOpts = Build.getDefaultCustomCCOpts();
+}
 
 /*
  *  ======== module$use ========
  */
 function module$use()
 {
+//  Build = this;
     BIOS = xdc.module("ti.sysbios.BIOS");
-    Build = this;
+    var profile;
 
     /* inform ti.sdo.utils.Build *not* to contribute libraries */
-    xdc.module("ti.sdo.utils.Build").doBuild = false;
+//  xdc.module("ti.sdo.utils.Build").doBuild = false;
+
+    /* if Build.libType is undefined, use BIOS.libType */
+    if (Build.libType == undefined) {
+        switch (BIOS.libType) {
+            case BIOS.LibType_Instrumented:
+                Build.libType = Build.LibType_Instrumented;
+                break;
+            case BIOS.LibType_NonInstrumented:
+                Build.libType = Build.LibType_NonInstrumented;
+                break;
+            case BIOS.LibType_Custom:
+                Build.libType = Build.LibType_Custom;
+                break;
+            case BIOS.LibType_Debug:
+                Build.libType = Build.LibType_Debug;
+                break;
+        }
+    }
+
+    /*  Get the profile associated with the ti.sdo.ipc package. The
+     *  profile may be specified per package with a line like this
+     *  in your .cfg script:
+     *
+     *  xdc.loadPackage('ti.sdo.ipc').profile = "release";
+     */
+    if (this.$package.profile != undefined) {
+        profile = this.$package.profile;
+    }
+    else {
+        profile = Program.build.profile;
+    }
+
+    /* gracefully handle non-supported whole_program profiles */
+    if (profile.match(/whole_program/) &&
+            (Build.libType != Build.LibType_Debug)) {
+
+        /* allow build to proceed */
+        Build.libType = Build.LibType_Debug;
+        /* but warning the user */
+        Build.$logWarning(
+            "The '" + profile + "' build profile will not be supported " +
+            "in future releases of IPC. Use 'release' or 'debug' profiles " +
+            "together with the 'Build.libType' configuration parameter to " +
+            "specify your preferred library. See the compatibility section " +
+            "of your IPC release notes for more information.",
+            "Profile Deprecation Warning", Build);
+    }
 
     /* inform getLibs() about location of library */
-    switch (BIOS.libType) {
-        case BIOS.LibType_Instrumented:
+    switch (Build.libType) {
+        case Build.LibType_Instrumented:
             this.$private.libraryName = "/ipc.a" + Program.build.target.suffix;
-            this.$private.outputDir = this.$package.packageBase + "lib/"
-                        + (BIOS.smpEnabled ? "smpipc/instrumented/" : "ipc/instrumented/");
+            this.$private.outputDir = this.$package.packageBase + "lib/" +
+                (BIOS.smpEnabled ? "smpipc/instrumented/":"ipc/instrumented/");
             break;
 
-        case BIOS.LibType_NonInstrumented:
+        case Build.LibType_NonInstrumented:
             this.$private.libraryName = "/ipc.a" + Program.build.target.suffix;
-            this.$private.outputDir = this.$package.packageBase + "lib/"
-                        + (BIOS.smpEnabled ? "smpipc/nonInstrumented/" : "ipc/nonInstrumented/");
+            this.$private.outputDir = this.$package.packageBase + "lib/" +
+                (BIOS.smpEnabled ? "smpipc/nonInstrumented/" :
+                "ipc/nonInstrumented/");
             break;
 
-        case BIOS.LibType_Custom:
+        case Build.LibType_Debug:
+        case Build.LibType_Custom:
             this.$private.libraryName = "/ipc.a" + Program.build.target.suffix;
             var SourceDir = xdc.useModule("xdc.cfg.SourceDir");
             /* if building a pre-built library */
             if (BIOS.buildingAppLib == false) {
-                var appName = Program.name.substring(0, Program.name.lastIndexOf('.'));
+                var appName = Program.name.substring(0,
+                        Program.name.lastIndexOf('.'));
                 this.$private.libDir = this.$package.packageBase + Build.libDir;
                 if (!java.io.File(this.$private.libDir).exists()) {
                     java.io.File(this.$private.libDir).mkdir();
@@ -85,10 +206,13 @@ function module$use()
             }
             else {
                 var curPath = java.io.File(".").getCanonicalPath();
-                /* If package.bld world AND building an application OR pre-built lib */
+                /* If package.bld world AND building an application OR
+                 * pre-built lib... */
                 if (java.io.File(curPath).getName() != "configPkg") {
-                    var appName = Program.name.substring(0, Program.name.lastIndexOf('.'));
-                    appName = appName + "_p" + Program.build.target.suffix + ".src";
+                    var appName = Program.name.substring(0,
+                            Program.name.lastIndexOf('.'));
+                    appName = appName + "_p" + Program.build.target.suffix +
+                            ".src";
                     SourceDir.outputDir = "package/cfg/" + appName;
                     SourceDir.toBuildDir = ".";
                     var src = SourceDir.create("ipc");
@@ -98,15 +222,17 @@ function module$use()
                 /* Here ONLY if building an application in CCS world */
                 else {
                     /* request output source directory for generated files */
-                    var appName = Program.name.substring(0, Program.name.lastIndexOf('.'));
-                    appName = appName + "_" + Program.name.substr(Program.name.lastIndexOf('.')+1);
+                    var appName = Program.name.substring(0,
+                            Program.name.lastIndexOf('.'));
+                    appName = appName + "_" + Program.name.substr(
+                            Program.name.lastIndexOf('.')+1);
                     SourceDir.toBuildDir = "..";
                     var src = SourceDir.create("ipc/");
                     src.libraryName = this.$private.libraryName.substring(1);
 
-                    /* save this directory in our private state (to be read during
-                    * generation, see Gen.xdt)
-                    */
+                    /*  save this directory in our private state (to be
+                     *  read during generation, see Gen.xdt)
+                     */
                     this.$private.outputDir = src.getGenSourceDir();
                 }
             }
@@ -115,9 +241,92 @@ function module$use()
 }
 
 /*
- * Add pre-built Instrumented and Non-Intrumented release libs
+ *  ======== module$validate ========
+ *  Some redundant tests are here to catch changes since
+ *  module$static$init() and instance$static$init().
  */
+function module$validate()
+{
+    var Defaults = xdc.module('xdc.runtime.Defaults');
+    var Diags = xdc.module("xdc.runtime.Diags");
+    var libType = getEnumString(Build.libType);
+
+    switch (Build.libType) {
+        case Build.LibType_Instrumented:
+            if (Build.assertsEnabled == false) {
+                Build.$logWarning(
+                        "Build.assertsEnabled must be set to true when " +
+                        "Build.libType == Build." + libType + ". " + "Set " +
+                        "Build.libType = Build.LibType_Custom to build a " +
+                        "custom library or update your configuration.",
+                        Build, "assertsEnabled");
+            }
+            if (Build.logsEnabled == false) {
+                Build.$logWarning(
+                        "Build.logsEnabled must be set to true when " +
+                        "Build.libType == Build." + libType + ". " + "Set " +
+                        "Build.libType = Build.LibType_Custom to build a " +
+                        "custom library or update your configuration.",
+                        Build, "logsEnabled");
+            }
+            break;
+
+        case Build.LibType_NonInstrumented:
+            if ((Build.assertsEnabled == true) &&
+                    Build.$written("assertsEnabled")){
+                Build.$logWarning(
+                        "Build.assertsEnabled must be set to false when " +
+                        "Build.libType == Build." + libType + ". " + "Set " +
+                        "Build.libType = Build.LibType_Custom to build a " +
+                        "custom library or update your configuration.",
+                        Build, "assertsEnabled");
+            }
+            if ((Build.logsEnabled == true) && Build.$written("logsEnabled")) {
+                Build.$logWarning(
+                        "Build.logsEnabled must be set to false when " +
+                        "Build.libType == Build." + libType + ". " + "Set " +
+                        "Build.libType = Build.LibType_Custom to build a " +
+                        "custom library or update your configuration.",
+                        Build, "logsEnabled");
+            }
+            break;
 
+        case Build.LibType_Custom:
+            if ((Build.assertsEnabled == true)
+                && (Defaults.common$.diags_ASSERT == Diags.ALWAYS_OFF)
+                && (Defaults.common$.diags_INTERNAL == Diags.ALWAYS_OFF)) {
+                Build.$logWarning(
+                        "Build.assertsEnabled should be set to 'false' when " +
+                        "Defaults.common$.diags_ASSERT == Diags.ALWAYS_OFF.",
+                        Build, "assertsEnabled");
+            }
+            break;
+    }
+}
+
+/*
+ *  ======== getEnumString ========
+ *  Return the enum value as a string.
+ *
+ *  Example usage:
+ *  If obj contains an enumeration type property "Enum enumProp"
+ *
+ *  view.enumString = getEnumString(obj.enumProp);
+ */
+function getEnumString(enumProperty)
+{
+    /*  Split the string into tokens in order to get rid of the
+     *  huge package path that precedes the enum string name.
+     *  Return the last two tokens concatenated with "_".
+     */
+    var enumStrArray = String(enumProperty).split(".");
+    var len = enumStrArray.length;
+    return (enumStrArray[len - 1]);
+}
+
+/*
+ * Add pre-built Instrumented and Non-Intrumented release libs
+ */
 var ipcSources  =  "ipc/GateMP.c " +
                    "ipc/ListMP.c " +
                    "ipc/SharedRegion.c " +
@@ -160,8 +369,8 @@ var commonSources = ipcSources +
                     heapsSources +
                     notifyDriverSources +
                     nsremoteSources +
-                    transportsSources +
-                    utilsSources;
+                    transportsSources;
+//                  utilsSources;
 
 var C64PSources  =
                    "ipc/gates/GateAAMonitor.c " +
@@ -305,16 +514,22 @@ var cList = {
     "ti.targets.C28_large"              : commonSources + C28Sources,
     "ti.targets.C28_float"              : commonSources + C28Sources,
 
-    "ti.targets.C64P"                   : commonSources + C647xSources + C64PSources,
-    "ti.targets.C64P_big_endian"        : commonSources + C647xSources + C64PSources,
+    "ti.targets.C64P"                   : commonSources + C647xSources +
+                                                C64PSources,
+    "ti.targets.C64P_big_endian"        : commonSources + C647xSources +
+                                                C64PSources,
     "ti.targets.C674"                   : commonSources + C674Sources,
 
-    "ti.targets.elf.C64P"               : commonSources + C647xSources + C64PSources,
-    "ti.targets.elf.C64P_big_endian"    : commonSources + C647xSources + C64PSources,
+    "ti.targets.elf.C64P"               : commonSources + C647xSources +
+                                                C64PSources,
+    "ti.targets.elf.C64P_big_endian"    : commonSources + C647xSources +
+                                                C64PSources,
     "ti.targets.elf.C674"               : commonSources + C674Sources,
     "ti.targets.elf.C64T"               : commonSources + C64TSources,
-    "ti.targets.elf.C66"                : commonSources + C647xSources + C66Sources,
-    "ti.targets.elf.C66_big_endian"     : commonSources + C647xSources + C66Sources,
+    "ti.targets.elf.C66"                : commonSources + C647xSources +
+                                                C66Sources,
+    "ti.targets.elf.C66_big_endian"     : commonSources + C647xSources +
+                                                C66Sources,
 
     "ti.targets.arp32.elf.ARP32"        : commonSources + ARP32Sources,
     "ti.targets.arp32.elf.ARP32_far"    : commonSources + ARP32Sources,
@@ -333,6 +548,8 @@ var cList = {
     "gnu.targets.arm.M4F"               : commonSources + M4Sources,
 };
 
+var cFiles = { };
+
 var ipcPackages = [
     "ti.sdo.ipc",
     "ti.sdo.ipc.family.omap4430",
@@ -395,7 +612,103 @@ var asmList = {
     "gnu.targets.arm.A15F"              : asmListNone,
 };
 
-var cFiles = {};
+function getDefaultCustomCCOpts()
+{
+    var Build = this;
+
+    /* start with target.cc.opts */
+    var customCCOpts = Program.build.target.cc.opts;
+
+    /* add target unique custom ccOpts */
+    if (!(ccOptsList[Program.build.target.$name] === undefined)) {
+        customCCOpts += ccOptsList[Program.build.target.$name];
+    }
+
+    /* gnu targets need to pick up ccOpts.prefix and suffix */
+    if (Program.build.target.$name.match(/gnu/)) {
+        customCCOpts += " -O3 ";
+        customCCOpts += " " + Program.build.target.ccOpts.prefix + " ";
+        customCCOpts += " " + Program.build.target.ccOpts.suffix + " ";
+    }
+    else if (Program.build.target.$name.match(/iar/)) {
+        throw new Error("IAR not supported by IPC");
+    }
+    else {
+        /* ti targets do program level compile */
+        customCCOpts += " --program_level_compile -o3 -g " +
+                "--optimize_with_debug ";
+    }
+
+    /* undo optimizations if this is a debug build */
+    if (Build.libType == Build.LibType_Debug) {
+        if (Program.build.target.$name.match(/gnu/)) {
+            customCCOpts = customCCOpts.replace("-O3","");
+            /* add in stack frames for stack back trace */
+            customCCOpts += " -mapcs ";
+        }
+        else {
+            customCCOpts = customCCOpts.replace(" -o3","");
+            customCCOpts = customCCOpts.replace(" --optimize_with_debug","");
+            if (Program.build.target.$name.match(/arm/)) {
+                customCCOpts = customCCOpts.replace(" --opt_for_speed=2","");
+            }
+        }
+    }
+
+    return (customCCOpts);
+}
+
+/*
+ *  ======== getDefs ========
+ */
+function getDefs()
+{
+    var Build = this;
+    var Defaults = xdc.module('xdc.runtime.Defaults');
+    var Diags = xdc.module("xdc.runtime.Diags");
+    var BIOS = xdc.module("ti.sysbios.BIOS");
+    var MessageQ = xdc.module("ti.sdo.ipc.MessageQ");
+
+    var defs = "";
+
+    if ((Build.assertsEnabled == false) ||
+        ((Defaults.common$.diags_ASSERT == Diags.ALWAYS_OFF)
+            && (Defaults.common$.diags_INTERNAL == Diags.ALWAYS_OFF))) {
+        defs += " -Dxdc_runtime_Assert_DISABLE_ALL";
+    }
+
+    if (Build.logsEnabled == false) {
+        defs += " -Dxdc_runtime_Log_DISABLE_ALL";
+    }
+
+    defs += " -Dti_sdo_ipc_MessageQ_traceFlag__D=" +
+            (MessageQ.traceFlag ? "TRUE" : "FALSE");
+
+    var InterruptDucati =
+            xdc.module("ti.sdo.ipc.family.ti81xx.InterruptDucati");
+
+    /* If we truely know which platform we're building against,
+     * add these application specific -D's
+     */
+    if (BIOS.buildingAppLib == true) {
+        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_videoProcId__D="
+                + InterruptDucati.videoProcId;
+        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_hostProcId__D="
+                + InterruptDucati.hostProcId;
+        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_vpssProcId__D="
+                + InterruptDucati.vpssProcId;
+        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_dspProcId__D="
+                + InterruptDucati.dspProcId;
+        defs +=
+            " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_ducatiCtrlBaseAddr__D="
+            + InterruptDucati.ducatiCtrlBaseAddr;
+        defs +=
+            " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_mailboxBaseAddr__D="
+            + InterruptDucati.mailboxBaseAddr;
+    }
+
+    return (defs);
+}
 
 /*
  *  ======== getCFiles ========
@@ -461,78 +774,35 @@ function getAsmFiles(target)
     return (asmList[target]);
 }
 
-/*
- *  ======== getDefs ========
- */
-function getDefs()
-{
-    var Defaults = xdc.module('xdc.runtime.Defaults');
-    var Diags = xdc.module("xdc.runtime.Diags");
-    var BIOS = xdc.module("ti.sysbios.BIOS");
-    var MessageQ = xdc.module("ti.sdo.ipc.MessageQ");
-
-    var defs = "";
-
-    if ((BIOS.assertsEnabled == false) ||
-        ((Defaults.common$.diags_ASSERT == Diags.ALWAYS_OFF)
-            && (Defaults.common$.diags_INTERNAL == Diags.ALWAYS_OFF))) {
-        defs += " -Dxdc_runtime_Assert_DISABLE_ALL";
-    }
-
-    if (BIOS.logsEnabled == false) {
-        defs += " -Dxdc_runtime_Log_DISABLE_ALL";
-    }
-
-    defs += " -Dti_sdo_ipc_MessageQ_traceFlag__D=" + (MessageQ.traceFlag ? "TRUE" : "FALSE");
-
-    var InterruptDucati = xdc.module("ti.sdo.ipc.family.ti81xx.InterruptDucati");
-
-    /*
-     * If we truely know which platform we're building against,
-     * add these application specific -D's
-     */
-    if (BIOS.buildingAppLib == true) {
-        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_videoProcId__D=" + InterruptDucati.videoProcId;
-        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_hostProcId__D=" + InterruptDucati.hostProcId;
-        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_vpssProcId__D=" + InterruptDucati.vpssProcId;
-        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_dspProcId__D=" + InterruptDucati.dspProcId;
-        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_ducatiCtrlBaseAddr__D=" + InterruptDucati.ducatiCtrlBaseAddr;
-        defs += " -Dti_sdo_ipc_family_ti81xx_InterruptDucati_mailboxBaseAddr__D=" + InterruptDucati.mailboxBaseAddr;
-    }
-
-    return (defs);
-}
-
 /*
  *  ======== getLibs ========
+ *  This function called by all IPC packages except ti.sdo.ipc package.
  */
 function getLibs(pkg)
 {
-    var BIOS = xdc.module("ti.sysbios.BIOS");
-
-    if (BIOS.libType != BIOS.LibType_Debug) {
-        return null;
-    }
-
-    var lib = "";
-    var name = pkg.$name + ".a" + prog.build.target.suffix;
-
-    if (BIOS.smpEnabled == true) {
-        lib = "lib/smpipc/debug/" + name;
-    }
-    else {
-        lib = "lib/ipc/debug/" + name;
-    }
+    var Build = this;
+    var libPath = "";
+    var name = "";
+    var suffix;
+
+    switch (Build.libType) {
+        case Build.LibType_Custom:
+        case Build.LibType_Instrumented:
+        case Build.LibType_NonInstrumented:
+        case Build.LibType_Debug:
+            return null;
+
+        case Build.LibType_PkgLib:
+            throw new Error("internal error: Build.getLibs() called with " +
+                    "incorret context (libType == PkgLib)");
+            break;
 
-    if (java.io.File(pkg.packageBase + lib).exists()) {
-        return lib;
+        default:
+            throw new Error("Build.libType not supported: " + Build.libType);
+            break;
     }
-
-    /* could not find any library, throw exception */
-    throw Error("Library not found: " + name);
 }
 
-
 /*
  *  ======== getProfiles ========
  *  Determines which profiles to build for.
@@ -563,7 +833,7 @@ function getProfiles(xdcArgs)
 /*
  *  ======== buildLibs ========
  *  This function generates the makefile goals for the libraries
- *  produced by a ti.sysbios package.
+ *  produced by a package.
  */
 function buildLibs(objList, relList, filter, xdcArgs)
 {
@@ -617,7 +887,6 @@ function buildLibs(objList, relList, filter, xdcArgs)
     }
 }
 
-
 /*
  *  ======== supportsTarget ========
  *  Returns true if target is in the filter object. If filter
@@ -678,3 +947,40 @@ function supportsTarget(target, filter)
 
     return (false);
 }
+
+/*
+ *  ======== _setLibType ========
+ *  The "real-time" setter setLibType function
+ *  This function is called whenever libType changes.
+ */
+function _setLibType(field, val)
+{
+    var Build = this;
+
+    if (val == Build.LibType_Instrumented) {
+        Build.assertsEnabled = true;
+        Build.logsEnabled = true;
+    }
+    else if (val == Build.LibType_NonInstrumented) {
+        Build.assertsEnabled = false;
+        Build.logsEnabled = false;
+    }
+    else if (val == Build.LibType_Custom) {
+        Build.assertsEnabled = true;
+        Build.logsEnabled = true;
+    }
+    else if (val == Build.LibType_Debug) {
+        Build.assertsEnabled = true;
+        Build.logsEnabled = true;
+    }
+    else if (val == Build.LibType_PkgLib) {
+        Build.assertsEnabled = true;
+        Build.logsEnabled = true;
+    }
+    else {
+        print(Build.$name + ": unknown libType setting: " + val);
+    }
+
+    /* re-construct default Build.customCCOpts */
+    Build.customCCOpts = Build.getDefaultCustomCCOpts();
+}
index f5b85082e1ec6b59729b5de36cd87a372f2a032f..85c2b2ae7670e067e840c56657d064a848cdf60d 100644 (file)
@@ -283,7 +283,7 @@ function getPlatform(xdcArgs)
         if (index != -1) {
             platform.name = xdcArgs[i].substring(index + 9, xdcArgs[i].length);
             if (platform.name == "default") {
-                return (platform)
+                return (platform);
             }
             else if (platform.name == "all") {
                 platform.useDefaultPlatform = false;
diff --git a/packages/ti/sdo/ipc/debugMakefile.xdt b/packages/ti/sdo/ipc/debugMakefile.xdt
new file mode 100644 (file)
index 0000000..4fe2c1e
--- /dev/null
@@ -0,0 +1,173 @@
+%%{
+/*
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+%%}
+%%{
+    var File = xdc.module("xdc.services.io.File");
+
+    var BIOS = xdc.module("ti.sysbios.BIOS");
+
+    var Build = xdc.module("ti.sysbios.Build");
+
+    var TARGET = $args[0];
+
+    var XOPTS = '-I "' + environment['xdc.rootDir'] + '/packages" '
+       + "-Dxdc_target_types__=" + TARGET.stdInclude
+       + " -Dxdc_target_name__=" + TARGET.name;
+
+    var CGEN = TARGET.rootDir.replace(/\\/g, "/");
+
+    function baseName(path) {
+       return path.substr(path.lastIndexOf('/') + 1).replace(/\.[^\.]+$/, "");
+    }
+
+    function packageName(path) {
+       var dirpath = path.substring(0, path.lastIndexOf('/'));
+       return dirpath.substr(dirpath.lastIndexOf('/') + 1);
+    }
+    var OBJS = [];
+%%}
+vpath % `File.getDOSPath(this.$package.packageRepository) + "ti/sysbios/"`
+vpath %.c `environment['xdc.rootDir'] + '/packages/'`
+
+CCOPTS    = `BIOS.getCCOpts(TARGET.name)`
+
+XDC_ROOT = `environment['xdc.rootDir'] + '/packages/'`
+
+BIOS_ROOT = `File.getDOSPath(this.$package.packageRepository) + "ti/sysbios/"`
+
+BIOS_DEFS = `BIOS.getDefs()`
+
+BIOS_INC  = -I"`File.getDOSPath(this.$package.packageRepository)`"
+
+%if (TARGET.$name.match(/gnu/)) {
+CC = `CGEN`/`TARGET.ccBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+ASM = `CGEN`/`TARGET.asmBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+AR = `CGEN`/`TARGET.arBin.cmd` `TARGET.ar.opts`
+%}
+%else {
+CC = `CGEN`/bin/`TARGET.cc.cmd` $(CCOPTS) -I `CGEN`/include
+ASM = `CGEN`/bin/`TARGET.asm.cmd` $(CCOPTS) -I `CGEN`/include
+AR = `CGEN`/bin/`TARGET.ar.cmd` `TARGET.ar.opts`
+%}
+
+%if (environment["os.name"].match(/Windows.*/i)) {
+DEL = cmd.exe /q /c del /f
+CP = cmd.exe /q /c copy /Y
+%}
+%else {
+DEL = rm -f
+CP = cp -f
+%}
+
+define RM
+       $(if $(wildcard $1),$(DEL) $1,:)
+endef
+
+define ASSEMBLE
+       @echo asm`TARGET.suffix` $< ...
+       @$(ASM) $(BIOS_DEFS) `XOPTS` $(BIOS_INC) $<
+endef
+
+define COMPILE
+       @echo cl`TARGET.suffix` $< ...
+       @$(CC) $(BIOS_DEFS) `XOPTS` $(BIOS_INC) $<
+endef
+
+%var LIB = "sysbios.lib";
+
+all: `LIB`
+
+%var sources = BIOS.getAsmFiles(TARGET.$name);
+%for each (var s in sources) {
+%if (TARGET.$name.match(/gnu/)) {
+%    var obj = packageName(s) + "_" + baseName(s) + ".o";
+%}
+%else {
+%    var obj = packageName(s) + "_" + baseName(s) + ".obj";
+%}
+%    OBJS.push(obj)
+`obj`: `s` makefile
+       @-$(call RM, $@)
+%if (TARGET.$name.match(/gnu/)) {
+       $(ASSEMBLE) -o `obj`
+%}
+%else {
+       $(ASSEMBLE) --output_file=`obj`
+%}
+
+%}
+
+%var sources = BIOS.getCFiles(TARGET.name).split(' ');
+%for each (var s in sources) {
+%if (TARGET.$name.match(/gnu/)) {
+%    var obj = packageName(s) + "_" + baseName(s) + ".o";
+%}
+%else {
+%    var obj = packageName(s) + "_" + baseName(s) + ".obj";
+%}
+%    OBJS.push(obj)
+`obj`: `s` makefile
+       @-$(call RM, `obj`)
+%if (TARGET.$name.match(/gnu/)) {
+       $(COMPILE) -o `obj`
+%}
+%else {
+       $(COMPILE) --output_file=`obj`
+%}
+%}
+
+`LIB`: `OBJS.join(" ")`
+       @echo ar`TARGET.suffix` $^ ...
+       @-$(call RM, $@)
+%if (BIOS.buildingAppLib == false) {
+       @-$(call RM, `Build.$private.libDir``LIB`)
+%}
+       @$(AR) $@ $^
+%if (BIOS.buildingAppLib == false) {
+       @$(CP) `LIB` `Build.$private.libDir`
+%}
+
+clean:
+       @-$(call RM, `LIB`)
+%if (BIOS.buildingAppLib == false) {
+       @-$(call RM, `Build.$private.libDir``LIB`)
+%}
+%if (TARGET.$name.match(/gnu/)) {
+       @-$(call RM, BIOS.o)
+%}
+%else {
+       @-$(call RM, BIOS.obj)
+%}
+%for (var i = 0; i < OBJS.length; i++) {
+       @-$(call RM, `OBJS[i]`)
+%}
index 02485de71c57eceb4461a870e331b36a0c005070..34a581066350b237fa49375d41412a0121253297 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_674 = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptDsp",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c"
 ];
 
 var trgFilter_674 = {
-        field: "isa",
-        list: [ "674" ]
+    field: "isa",
+    list: [ "674" ]
 };
 
 var objList_arp32 = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptArp32",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptArp32.c"
 ];
 
 var trgFilter_arp32 = {
-        field: "isa",
-        list: [ "arp32" ]
+    field: "isa",
+    list: [ "arp32" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
-IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, arguments);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
+    IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, arguments);
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32,
+            ["profile=smp"]);
+}
 
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
-IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "InterruptArp32.c",
+    "InterruptDsp.c",
+    "NotifyCircSetup.c",
+    "NotifySetup.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 205e5305e9e9db8794031a8acddbb0cd83f2221b..6ae0b4e137937b934bd535b0f9dc2e08836db13d 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_64P = [
-      "Interrupt",
-      "MultiProcSetup",
-      "NotifySetup",
-      "NotifyCircSetup",
+    "Interrupt.c",
+    "MultiProcSetup.c",
+    "NotifySetup.c",
+    "NotifyCircSetup.c"
 ];
 
 var trgFilter_64P = {
@@ -48,18 +49,22 @@ var trgFilter_64P = {
         list: [ "64P", "64P_big_endian", "66" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, arguments);
+    IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "Interrupt.c",
+    "MultiProcSetup.c",
+    "NotifyCircSetup.c",
+    "NotifySetup.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
 
 Pkg.generatedFiles.$add("lib/");
-
-Pkg.generatedFiles.$add("lib/");
index ae45afa60c003f4f79c0620bee9176ef0d1d73fe..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
+
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
+    }
 }
index 6cb5e224db3397102193e2cf7615a7fe660876ad..8143843da9ce6db36b42c37aee48a9a57f551f13 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_common = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "NotifyMbxSetup",
-      "NotifyDriverMbx",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "NotifyMbxSetup.c",
+    "NotifyDriverMbx.c"
 ];
 
 var objList_674 = [
-      "InterruptDsp",
+    "InterruptDsp.c"
 ].concat(objList_common);
 
 var trgFilter_674 = {
-        field: "isa",
-        list: [ "674" ]
+    field: "isa",
+    list: [ "674" ]
 };
 
 var objList_m3 = [
-      "InterruptDucati",
+    "InterruptDucati.c"
 ].concat(objList_common);
 
 var trgFilter_m3 = {
-        field: "isa",
-        list: [ "v7M" ]
+    field: "isa",
+    list: [ "v7M" ]
 };
 
 var objList_a8f = [
-      "InterruptHost",
+    "InterruptHost.c"
 ].concat(objList_common);
 
 var trgFilter_a8f = {
-        field: "isa",
-        list: [ "v7A" ]
+    field: "isa",
+    list: [ "v7A" ]
 };
 
 var objList_arp32 = [
-      "InterruptEve",
+    "InterruptEve.c"
 ].concat(objList_common);
 
 var trgFilter_arp32 = {
-        field: "isa",
-        list: [ "arp32" ]
+    field: "isa",
+    list: [ "arp32" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
-IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, arguments);
-IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, arguments);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
+    IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, arguments);
+    IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, arguments);
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32,
+            ["profile=smp"]);
+}
 
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
-IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, ["profile=smp"]);
-IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "InterruptDsp.c",
+    "InterruptDucati.c",
+    "InterruptHost.c",
+    "InterruptEve.c"
+].concat(objList_common);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 7c16ec14706938f917424fdfeeeb7cf400674b81..33b5e93373cd6ad596c4af0d6f9174d7136af510 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
+ *
+ */
+
+var Build = null;
+
+/*
+ *  ======== package.close ========
  */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
+
+/*
+ *  ======== Package.getLibs ========
+ *  This function is called when a program's configuration files are
+ *  being generated and it returns the name of a library appropriate
+ *  for the program's configuration.
+ */
+function getLibs(prog)
+{
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
+
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
+
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
+    }
+}
 
 /*
  *  ======== Package.validate ========
@@ -67,27 +113,3 @@ function validate()
         }
     }
 }
-
-/*
- *  ======== Package.getLibs ========
- *  This function is called when a program's configuration files are
- *  being generated and it returns the name of a library appropriate
- *  for the program's configuration.
- */
-function getLibs(prog)
-{
-    var Build = xdc.module("ti.sdo.ipc.Build");
-
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
-
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-}
index 37381a2a4bf23ab6491937d32b303184725383b3..71eaf6da0ccde59b05f2a2401c21f68afb8f0c38 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_674 = [
-    "InterruptDsp",
-    "NotifySetup",
-    "NotifyCircSetup",
+    "InterruptDsp.c",
+    "NotifySetup.c",
+    "NotifyCircSetup.c"
 ];
 
 var trgFilter_674 = {
@@ -48,9 +49,9 @@ var trgFilter_674 = {
 };
 
 var objList_v5T = [
-    "InterruptArm",
-    "NotifySetup",
-    "NotifyCircSetup",
+    "InterruptArm.c",
+    "NotifySetup.c",
+    "NotifyCircSetup.c"
 ];
 
 var trgFilter_v5T = {
@@ -58,21 +59,24 @@ var trgFilter_v5T = {
     list: [ "v5T" ]
 };
 
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
+    IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, arguments);
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, ["profile=smp"]);
+}
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
-IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
-IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "InterruptDsp.c",
+    "InterruptArm.c",
+    "NotifySetup.c",
+    "NotifyCircSetup.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
 
 Pkg.generatedFiles.$add("lib/");
-
-Pkg.generatedFiles.$add("lib/");
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 4b4abe89664a49dc35d67bc672c0eb5b32a96247..9edf9c458e1808c55173b0643c8cd96750270e80 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_64P = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptDsp",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c"
 ];
 
 var trgFilter_64P = {
-        field: "isa",
-        list: [ "64P" ]
+    field: "isa",
+    list: [ "64P" ]
 };
 
 var objList_v5T = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptArm",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptArm.c"
 ];
 
 var trgFilter_v5T = {
-        field: "isa",
-        list: [ "v5T" ]
+    field: "isa",
+    list: [ "v5T" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, arguments);
-IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, ["profile=smp"]);
-IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, arguments);
+    IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, arguments);
+    IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_v5T, undefined, trgFilter_v5T, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c",
+    "InterruptArm.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
 
 Pkg.generatedFiles.$add("lib/");
-
-Pkg.generatedFiles.$add("lib/");
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 78f747334c2694720a3f6f9f90dc6c15f8ce4129..fbde51e6ec608273dcc0fe5f0d76ac9222bdeaf6 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_28FP = [
-      "IpcMgr",
-      "NotifyDriverCirc",
-      "NameServerBlock",
-      "TransportCirc",
+    "IpcMgr.c",
+    "NotifyDriverCirc.c",
+    "NameServerBlock.c",
+    "TransportCirc.c"
 ];
 
 var trgFilter_28FP = {
-        field: "isa",
-        list: [ "28FP" ]
+    field: "isa",
+    list: [ "28FP" ]
 };
 
 var objList_m3 = [
-      "IpcMgr",
-      "NotifyDriverCirc",
-      "NameServerBlock",
-      "TransportCirc",
+    "IpcMgr.c",
+    "NotifyDriverCirc.c",
+    "NameServerBlock.c",
+    "TransportCirc.c"
 ];
+
 var trgFilter_m3 = {
-        field: "isa",
-        list: [ "v7M" ]
+    field: "isa",
+    list: [ "v7M" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_28FP, undefined, trgFilter_28FP, arguments);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_28FP, undefined, trgFilter_28FP, ["profile=smp"]);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_28FP, undefined, trgFilter_28FP, arguments);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
+    IpcBuild.buildLibs(objList_28FP, undefined, trgFilter_28FP,
+            ["profile=smp"]);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld", "linkcmd.xdt" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "linkcmd.xdt",
+    "IpcMgr.c",
+    "NotifyDriverCirc.c",
+    "NameServerBlock.c",
+    "TransportCirc.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index bfbb889f84bfc0c60dbb8c2a4d4d8374cd0e6a9c..d990fc3762ae767ac196ae71b22e002572aaa711 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
+
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
+    }
 }
 
 /*
@@ -57,13 +86,3 @@ function getSects()
 {
     return "ti/sdo/ipc/family/f28m35x/linkcmd.xdt";
 }
-
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-}
index c60860e6321baf12410aaf7baf1eb4a47c7554ce..5e0d2cf284c4e4a9db3d2b9c06e39d4a70a240cf 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_64P = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptDsp",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c"
 ];
 
 var trgFilter_64P = {
-        field: "isa",
-        list: [ "64P" ]
+    field: "isa",
+    list: [ "64P" ]
 };
 
 var objList_a8f = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptHost",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptHost.c"
 ];
 
 var trgFilter_a8f = {
-        field: "isa",
-        list: [ "v7A" ]
+    field: "isa",
+    list: [ "v7A" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, arguments);
-IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, ["profile=smp"]);
-IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, arguments);
+    IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, arguments);
+    IpcBuild.buildLibs(objList_64P, undefined, trgFilter_64P, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c",
+    "InterruptHost.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
 
 Pkg.generatedFiles.$add("lib/");
-
-Pkg.generatedFiles.$add("lib/");
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 22010f7500a0e15b1c5d03eb3daaf0fe5269ee7d..628cb2fc9c238f338ac9395b7d6e8524836a31e5 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_64T = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptDsp",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c"
 ];
 
 var trgFilter_64T = {
-        field: "isa",
-        list: [ "64T" ]
+    field: "isa",
+    list: [ "64T" ]
 };
 
 var objList_m3 = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "InterruptDucati",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDucati.c"
 ];
 
 var trgFilter_m3 = {
-        field: "isa",
-        list: [ "v7M" ]
+    field: "isa",
+    list: [ "v7M" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_64T, undefined, trgFilter_64T, arguments);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_64T, undefined, trgFilter_64T, arguments);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
+    IpcBuild.buildLibs(objList_64T, undefined, trgFilter_64T, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
+}
 
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_64T, undefined, trgFilter_64T, ["profile=smp"]);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "InterruptDsp.c",
+    "InterruptDucati.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index def5404bbade0473dfff404d9d681d6f6e4586c1..b99a2752a2374473958830553963ccf691071179 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
+ *
+ */
+
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
+
+/*
+ *  ======== Package.getLibs ========
+ *  This function is called when a program's configuration files are
+ *  being generated and it returns the name of a library appropriate
+ *  for the program's configuration.
  */
+function getLibs(prog)
+{
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
+
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
+
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
+    }
+}
 
 /*
  *  ======== Package.validate ========
@@ -68,28 +114,3 @@ function validate()
         }
     }
 }
-
-/*
- *  ======== Package.getLibs ========
- *  This function is called when a program's configuration files are
- *  being generated and it returns the name of a library appropriate
- *  for the program's configuration.
- */
-
-function getLibs(prog)
-{
-    var Build = xdc.module("ti.sdo.ipc.Build");
-
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
-
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-}
index 829bf1bc627ba2fad4d7901005d5ea611f9141b0..21ff2cfcc0a8e972ef7d86bc12df8a5ce500364d 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.bld ========
- *
  */
-
-//Pkg.makePrologue = "include custom.mak";
-xdc.loadCapsule('procNamesDocGen.xs');
-
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+var Pkg = xdc.useModule('xdc.bld.PackageContents');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
-
-var objList = [
-];
-
-/* generate makefiles */
-IpcBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+xdc.loadCapsule('procNamesDocGen.xs');
 
 Pkg.otherFiles = [ "package.bld", "doc-files", "procNamesDocGen.xs" ];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
-
-Pkg.generatedFiles.$add("lib/");
index 033e77e195363b01ca66b8f752692343727c28d7..3f092ae2be038f187fcc67bc68b881c081e633d2 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/*
- *  ======== package.xs ========
- *
- */
-
 
 /*
- *  ======== Package.getLibs ========
- *  This function is called when a program's configuration files are
- *  being generated and it returns the name of a library appropriate
- *  for the program's configuration.
+ *  ======== package.xs ========
  */
 
-function getLibs(prog)
-{
-    var Build = xdc.module("ti.sdo.ipc.Build");
-
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
-
-/*
- *  ======== package.close ========
+/* Empty placeholder for package functions. Currently, this
+ * package does not provide any target libraries.
  */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-}
index 196230a0b8d6ba5784f10551ebff9b95bc1a550a..c2365c88ed5a77b5cf2ae83a6c9a06ab2edbfa55 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_66 = [
-      "Interrupt",
-      "MultiProcSetup",
-      "NotifySetup",
-      "NotifyCircSetup",
+    "Interrupt.c",
+    "MultiProcSetup.c",
+    "NotifySetup.c",
+    "NotifyCircSetup.c"
 ];
 
 var trgFilter_66 = {
-        field: "isa",
-        list: [ "66" ]
+    field: "isa",
+    list: [ "66" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, arguments);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, arguments);
+    IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, ["profile=smp"]);
+}
 
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld"
+].concat(objList_66);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
 
 Pkg.generatedFiles.$add("lib/");
-
-Pkg.generatedFiles.$add("lib/");
index ae45afa60c003f4f79c0620bee9176ef0d1d73fe..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
+
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
+    }
 }
index da90e0c6a44144e871bcabadfa15e9b41b674136..f3dbaf1eb97cb168a202469839f0248a835dd0ee 100644 (file)
 /*
  *  ======== package.bld ========
  */
-
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+var Pkg = xdc.useModule('xdc.bld.PackageContents');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_common = [
-      "NotifySetup",
-      "NotifyCircSetup",
-      "NotifyMbxSetup",
-      "NotifyDriverMbx",
+    "NotifySetup.c",
+    "NotifyCircSetup.c",
+    "NotifyMbxSetup.c",
+    "NotifyDriverMbx.c"
 ];
 
 var objList_674 = [
-      "InterruptDsp",
+    "InterruptDsp.c"
 ].concat(objList_common);
 
 var trgFilter_674 = {
-        field: "isa",
-        list: [ "674" ]
+    field: "isa",
+    list: [ "674" ]
 };
 
 var objList_m3 = [
-      "InterruptDucati",
+    "InterruptDucati.c"
 ].concat(objList_common);
 
 var trgFilter_m3 = {
-        field: "isa",
-        list: [ "v7M" ]
+    field: "isa",
+    list: [ "v7M" ]
 };
 
 var objList_a8f = [
-      "InterruptHost",
+    "InterruptHost.c"
 ].concat(objList_common);
 
 var trgFilter_a8f = {
-        field: "isa",
-        list: [ "v7A", "v7A8" ]
+    field: "isa",
+    list: [ "v7A", "v7A8" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
-IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
-IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
-IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, arguments);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, arguments);
+    IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, arguments);
+    IpcBuild.buildLibs(objList_674, undefined, trgFilter_674, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_m3, undefined, trgFilter_m3, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_a8f, undefined, trgFilter_a8f, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "InterruptDsp.c",
+    "InterruptDucati.c",
+    "InterruptHost.c"
+].concat(objList_common);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 7c16ec14706938f917424fdfeeeb7cf400674b81..a4024b7f8bd26708c98bf5adbedcb0bd9ce98a90 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
+ *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
+
+/*
+ *  ======== Package.getLibs ========
+ *  This function is called when a program's configuration files are
+ *  being generated and it returns the name of a library appropriate
+ *  for the program's configuration.
+ */
+function getLibs(prog)
+{
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
+
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
+
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
+    }
+}
 /*
  *  ======== Package.validate ========
  */
@@ -67,27 +112,3 @@ function validate()
         }
     }
 }
-
-/*
- *  ======== Package.getLibs ========
- *  This function is called when a program's configuration files are
- *  being generated and it returns the name of a library appropriate
- *  for the program's configuration.
- */
-function getLibs(prog)
-{
-    var Build = xdc.module("ti.sdo.ipc.Build");
-
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
-
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-}
index 8b2cfd5905dcb40ef69b39ba176fc9a913e7e958..728f176b123ea347ac4c486c8d10a2a883bf55fc 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_common = [
-      "NotifySetup",
+    "NotifySetup.c"
 ];
 
 var objList_66 = [
-      "InterruptDsp",
+    "InterruptDsp.c"
 ].concat(objList_common);
 
 var trgFilter_66 = {
-        field: "isa",
-        list: [ "66" ]
+    field: "isa",
+    list: [ "66" ]
 };
 
 var objList_m4 = [
-      "InterruptIpu",
+    "InterruptIpu.c"
 ].concat(objList_common);
 
 var trgFilter_m4 = {
-        field: "isa",
-        list: [ "v7M", "v7M4" ]
+    field: "isa",
+    list: [ "v7M", "v7M4" ]
 };
 
 var objList_arp32 = [
-      "InterruptArp32",
+    "InterruptArp32.c"
 ].concat(objList_common);
 
 var trgFilter_arp32 = {
-        field: "isa",
-        list: [ "arp32" ]
+    field: "isa",
+    list: [ "arp32" ]
 };
 
 var objList_host = [
-      "InterruptHost",
+    "InterruptHost.c"
 ].concat(objList_common);
 
 var trgFilter_host = {
-        field: "isa",
-        list: [ "v7A15" ]
+    field: "isa",
+    list: [ "v7A15" ]
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, arguments);
-IpcBuild.buildLibs(objList_m4, undefined, trgFilter_m4, arguments);
-IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, arguments);
-IpcBuild.buildLibs(objList_host, undefined, trgFilter_host, arguments);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, arguments);
+    IpcBuild.buildLibs(objList_m4, undefined, trgFilter_m4, arguments);
+    IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, arguments);
+    IpcBuild.buildLibs(objList_host, undefined, trgFilter_host, arguments);
+    IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_m4, undefined, trgFilter_m4, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32,
+            ["profile=smp"]);
+    IpcBuild.buildLibs(objList_host, undefined, trgFilter_host,
+            ["profile=smp"]);
+}
 
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_66, undefined, trgFilter_66, ["profile=smp"]);
-IpcBuild.buildLibs(objList_m4, undefined, trgFilter_m4, ["profile=smp"]);
-IpcBuild.buildLibs(objList_arp32, undefined, trgFilter_arp32, ["profile=smp"]);
-IpcBuild.buildLibs(objList_host, undefined, trgFilter_host, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "InterruptDsp.c",
+    "InterruptIpu.c",
+    "InterruptArp32.c",
+    "InterruptHost.c"
+].concat(objList_common);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index ddaec667b8f1fbe3272376fe81956dc0989f2e95..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
 
 /*
- *  ======== Package.getLibs ========
- *  This function is called when a program's configuration files are
- *  being generated and it returns the name of a library appropriate
- *  for the program's configuration.
+ *  ======== package.close ========
  */
-
-function getLibs(prog)
+function close()
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
+    Build = xdc.useModule('ti.sdo.ipc.Build');
 }
 
 /*
- *  ======== package.close ========
+ *  ======== Package.getLibs ========
+ *  This function is called when a program's configuration files are
+ *  being generated and it returns the name of a library appropriate
+ *  for the program's configuration.
  */
-function close()
+function getLibs(prog)
 {
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /*
-     * Force the Build module to get used if any module
-     * in this package is used
-     */
-    for (var mod in this.$modules) {
-        if (this.$modules[mod].$used == true) {
-            xdc.useModule('ti.sdo.ipc.Build');
-            break;
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
+
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
         }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 623e5811536df560213748d633f85069d01d168f..1d73bfc853709978fb7b840f1633518de69d2007 100644 (file)
 
 /*
  *  ======== package.bld ========
- *
  */
-
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+var Pkg = xdc.useModule('xdc.bld.PackageContents');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList_0 = [
-    "GateMPSupportNull",
-    "GatePeterson",
-    "GatePetersonN"
+    "GateMPSupportNull.c",
+    "GatePeterson.c",
+    "GatePetersonN.c"
 ];
 
 var objList_3 = [
-    "GateHWSem",
-    "GateHWSpinlock",
+    "GateHWSem.c",
+    "GateHWSpinlock.c"
 ].concat(objList_0);
 
 var objList_1 = [
-    "GateAAMonitor",
-    "GateAAMonitor_asm",
+    "GateAAMonitor.c",
+    "GateAAMonitor_asm.s64P"
 ].concat(objList_3);
 
 var objList_2 = [
-    "GateHWSpinlock",
+    "GateHWSpinlock.c"
 ].concat(objList_0);
 
 var trgFilter_1 = {
@@ -77,19 +77,29 @@ var trgFilter_0 = {
     list: trgFilter_1.list.concat(trgFilter_2.list).concat(trgFilter_3.list)
 };
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList_0, undefined, trgFilter_0, arguments);
-IpcBuild.buildLibs(objList_1, undefined, trgFilter_1, arguments);
-IpcBuild.buildLibs(objList_2, undefined, trgFilter_2, arguments);
-IpcBuild.buildLibs(objList_3, undefined, trgFilter_3, arguments);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList_0, undefined, trgFilter_0, arguments);
+    IpcBuild.buildLibs(objList_1, undefined, trgFilter_1, arguments);
+    IpcBuild.buildLibs(objList_2, undefined, trgFilter_2, arguments);
+    IpcBuild.buildLibs(objList_3, undefined, trgFilter_3, arguments);
+    IpcBuild.buildLibs(objList_0, undefined, trgFilter_0, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_1, undefined, trgFilter_1, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_2, undefined, trgFilter_2, ["profile=smp"]);
+    IpcBuild.buildLibs(objList_3, undefined, trgFilter_3, ["profile=smp"]);
+}
 
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList_0, undefined, trgFilter_0, ["profile=smp"]);
-IpcBuild.buildLibs(objList_1, undefined, trgFilter_1, ["profile=smp"]);
-IpcBuild.buildLibs(objList_2, undefined, trgFilter_2, ["profile=smp"]);
-IpcBuild.buildLibs(objList_3, undefined, trgFilter_3, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld",
+    "GateMPSupportNull.c",
+    "GatePeterson.c",
+    "GatePetersonN.c",
+    "GateHWSem.c",
+    "GateHWSpinlock.c",
+    "GateAAMonitor.c",
+    "GateAAMonitor_asm.s64P",
+    "GateHWSpinlock.c"
+];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 08803aca1793dbb0877e51a1cbf053b766ed9814..f4d78f4c06759dcb7fb0fbd8ff736502b33e126d 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var commonObjList = [
-    "HeapMemMP",
-    "HeapBufMP",
-    "HeapMultiBufMP",
+    "HeapMemMP.c",
+    "HeapBufMP.c",
+    "HeapMultiBufMP.c"
 ];
 
 var objList0 = [
 ].concat(commonObjList);
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList0, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList0, undefined, null, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList0, undefined, null, arguments);
+    IpcBuild.buildLibs(objList0, undefined, null, ["profile=smp"]);
+}
 
 Pkg.otherFiles = [
-        "package.bld",
-        "_HeapBufMP.h",
-        "_HeapMemMP.h",
-        "_HeapMultiBufMP.h",
-];
+    "package.bld",
+    "_HeapBufMP.h",
+    "_HeapMemMP.h",
+    "_HeapMultiBufMP.h"
+].concat(commonObjList);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 9f58c42496dd3c4ce4ae0e5d43bd2fa7bfb2adc6..430172f65107b362fe4d6f8f7862e75009cde3ca 100644 (file)
  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * */
+ */
+
 /*
  *  ======== instrumented.cfg.xs ========
- *
  */
 
 var BIOS = xdc.module('ti.sysbios.BIOS');
-
-BIOS.libType = BIOS.LibType_Custom;
 BIOS.buildingAppLib = false;
-BIOS.assertsEnabled = true;
-BIOS.logsEnabled = true;
 
-var SourceDir = xdc.module("xdc.cfg.SourceDir");
+var Build = xdc.module('ti.sdo.ipc.Build');
+Build.libType = Build.LibType_Custom;
+Build.assertsEnabled = true;
+Build.logsEnabled = true;
+
+var SourceDir = xdc.module('xdc.cfg.SourceDir');
 SourceDir.verbose = 1;
 
+/* remove all symbolic debug info */
+if (Program.build.target.$name.match(/gnu/)) {
+    Build.customCCOpts = Build.customCCOpts.replace("-g","");
+}
+else if (Program.build.target.$name.match(/iar/)) {
+    throw new Error("IAR not supported by IPC");
+}
+else  {
+    Build.customCCOpts = Build.customCCOpts.replace("-g","");
+    Build.customCCOpts = Build.customCCOpts.replace("--optimize_with_debug","");
+    Build.customCCOpts += "--symdebug:none ";
+    /* suppress warnings regarding .asmfunc and .endasmfunc */
+    Build.customCCOpts +=
+            "--asm_define\".asmfunc= \" --asm_define\".endasmfunc= \" ";
+}
+
 /* suppress un-placed sections warning from m3 Hwi.meta$init() */
 if (Program.sectMap[".vecs"] !== undefined) {
     Program.sectMap[".vecs"].type = "DSECT";
index 3ee9f849c2642c472f26ea734beceedc1a450552..e0c22ed5c052016fa7b91f312cc2ef9c48f279d5 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
-var objList = [
-];
-
-
-/* generate makefiles */
-IpcBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
-
 Pkg.otherFiles = [ "package.bld" ];
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
-
-Pkg.generatedFiles.$add("lib/");
index 033e77e195363b01ca66b8f752692343727c28d7..3f092ae2be038f187fcc67bc68b881c081e633d2 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/*
- *  ======== package.xs ========
- *
- */
-
 
 /*
- *  ======== Package.getLibs ========
- *  This function is called when a program's configuration files are
- *  being generated and it returns the name of a library appropriate
- *  for the program's configuration.
+ *  ======== package.xs ========
  */
 
-function getLibs(prog)
-{
-    var Build = xdc.module("ti.sdo.ipc.Build");
-
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
-
-/*
- *  ======== package.close ========
+/* Empty placeholder for package functions. Currently, this
+ * package does not provide any target libraries.
  */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-}
index 8b31571295c07bc469d6dc11c363739ad5bd14ae..bcf7919228526b4d68b5358a83dbfba50abc8476 100644 (file)
 %%{
     var File = xdc.module("xdc.services.io.File");
 
+    var BIOS = xdc.module("ti.sysbios.BIOS");
+
     var Build = xdc.module("ti.sdo.ipc.Build");
 
     var TARGET = $args[0];
 
     var XDCROOT = String(environment['xdc.rootDir'] + '/packages/').replace(/\\/g, "/");
 
-    var BIOS = xdc.module("ti.sysbios.BIOS");
-
     var CGEN = TARGET.rootDir.replace(/\\/g, "/");
 
     function baseName(path) {
@@ -59,7 +59,7 @@ vpath %.c `XDCROOT`
 
 XOPTS = `'-I"' + XDCROOT + '"' + " -Dxdc_target_types__=" + File.getDOSPath(TARGET.$package.packageRepository) + TARGET.stdInclude + " -Dxdc_target_name__=" + TARGET.name`
 
-CCOPTS ?= `BIOS.getCCOpts(TARGET.name)`
+CCOPTS = `BIOS.getCCOpts(TARGET.name)`
 
 XDC_ROOT  = `XDCROOT`
 
@@ -73,11 +73,16 @@ IPC_INC    = -I"`xdc.getPackageRepository("ti.sdo.ipc")`"
 
 UTILS_INC    = -I"`xdc.getPackageRepository("ti.sdo.utils")`"
 
+%if (TARGET.$name.match(/gnu/)) {
+CC = `CGEN`/`TARGET.ccBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+ASM = `CGEN`/`TARGET.asmBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+AR = `CGEN`/`TARGET.arBin.cmd` `TARGET.ar.opts`
+%}
+%else {
 CC = `CGEN`/bin/`TARGET.cc.cmd` $(CCOPTS) -I `CGEN`/include
-
 ASM = `CGEN`/bin/`TARGET.asm.cmd` $(CCOPTS) -I `CGEN`/include
-
 AR = `CGEN`/bin/`TARGET.ar.cmd` `TARGET.ar.opts`
+%}
 
 %if (environment["os.name"].match(/Windows.*/i)) {
 %if (BIOS.buildingAppLib == false) {
@@ -85,10 +90,12 @@ AR = `CGEN`/bin/`TARGET.ar.cmd` `TARGET.ar.opts`
 %}
 DEL = cmd.exe /q /c del /f
 CP = cmd.exe /q /c copy /Y
+MKDIR = mkdir
 %}
 %else {
 DEL = rm -f
 CP = cp -f
+MKDIR = mkdir -p
 %}
 
 define RM
@@ -111,16 +118,33 @@ all: `LIB`
 
 %var sources = Build.getAsmFiles(TARGET.$name);
 %for each (var s in sources) {
+%if (TARGET.$name.match(/gnu/)) {
+%    var obj = packageName(s) + "_" + baseName(s) + ".o";
+%}
+%else {
 %    var obj = packageName(s) + "_" + baseName(s) + ".obj";
+%}
 %    OBJS.push(obj)
 `obj`: `s` makefile
        @-$(call RM, $@)
+%if (TARGET.$name.match(/gnu/)) {
+       $(ASSEMBLE) -o `obj`
+%}
+%else {
        $(ASSEMBLE) --output_file=`obj`
+%}
 
 %}
 
+%if (TARGET.$name.match(/gnu/)) {
+Ipc.o: `Build.getCFiles(TARGET.$name)` makefile
+       @-$(call RM, Ipc.o)
+       @-$(call RM, Ipc.o.dep)
+%}
+%else {
 Ipc.obj: `Build.getCFiles(TARGET.$name)` makefile
        @-$(call RM, $@)
+%}
        @echo cl`TARGET.suffix` $< ...
        @$(CC) $(BUILD_DEFS) $(XOPTS) $(BIOS_INC) \
        $(IPC_INC) $(UTILS_INC) \
@@ -128,14 +152,21 @@ Ipc.obj: `Build.getCFiles(TARGET.$name)` makefile
 %for each (var s in sources) {
 %    if (s.substring(0,4) == "xdc/") {
        $(XDC_ROOT)`s` \
+%    } else if (s.substring(0,2) == "./") {
+       `s` \
 %    } else {
        $(IPC_ROOT)`s` \
 %    }
 %}
 
+%if (TARGET.$name.match(/gnu/)) {
+`LIB`: Ipc.o `OBJS.join(" ")`
+%}
+%else {
 `LIB`: Ipc.obj `OBJS.join(" ")`
-       @echo ar`TARGET.suffix` $^ ...
+%}
        @-$(call RM, $@)
+       @echo ar`TARGET.suffix` $^ ...
        @$(AR) $@ $^
 
 %if (BIOS.buildingAppLib == false) {
@@ -150,7 +181,19 @@ clean:
 %if (BIOS.buildingAppLib == false) {
        @-$(call RM, "`Build.$private.libDir``LIB`")
 %}
+%if (TARGET.$name.match(/gnu/)) {
+       @-$(call RM, Ipc.o)
+%}
+%else {
        @-$(call RM, Ipc.obj)
+%}
 %for (var i = 0; i < OBJS.length; i++) {
        @-$(call RM, `OBJS[i]`)
 %}
+
+# create output directories
+ifneq ($(MAKECMDGOALS),clean)
+ifeq ($(wildcard `Build.$private.libDir`),)
+    $(shell $(MKDIR) `Build.$private.libDir`)
+endif
+endif
index 1390dec0d7dcd85f9e1821f8e17aeea49988f6b5..4cec177b54cb3aeb82fc56fbe77c816d6e95f080 100644 (file)
@@ -106,7 +106,12 @@ endef
 
 %var LIB = "ipc.a" + TARGET.suffix;
 
+%if (BIOS.buildingAppLib == false) {
+all: `Build.$private.libDir``LIB`
+%}
+%else {
 all: `LIB`
+%}
 
 %var sources = Build.getAsmFiles(TARGET.$name);
 %for each (var s in sources) {
@@ -131,9 +136,12 @@ all: `LIB`
        @echo ar`TARGET.suffix` $^ ...
        @-$(call RM, $@)
        @$(AR) $@ $^
+
 %if (BIOS.buildingAppLib == false) {
+`Build.$private.libDir``LIB`: `LIB`
+       @echo cp `LIB`
        @-$(call RM, "`Build.$private.libDir``LIB`")
-       $(CP) `LIB` "`Build.$private.libDir``LIB`"
+       @$(CP) `LIB` "`Build.$private.libDir``LIB`"
 %}
 
 clean:
index 8087ff7f0c49e7711d1d83947d48eab702ae8b23..9f913b819606e7d3784dc51695392b435c459029 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== nonInstrumented.cfg.xs ========
- *
  */
 
 var BIOS = xdc.module('ti.sysbios.BIOS');
-
-BIOS.libType = BIOS.LibType_Custom;
 BIOS.buildingAppLib = false;
-BIOS.assertsEnabled = false;
-BIOS.logsEnabled = false;
 
-var SourceDir = xdc.module("xdc.cfg.SourceDir");
+var Build = xdc.module('ti.sdo.ipc.Build');
+Build.libType = Build.LibType_Custom;
+Build.assertsEnabled = false;
+Build.logsEnabled = false;
+
+var SourceDir = xdc.module('xdc.cfg.SourceDir');
 SourceDir.verbose = 1;
 
+/* remove all symbolic debug info */
+if (Program.build.target.$name.match(/gnu/)) {
+    Build.customCCOpts = Build.customCCOpts.replace("-g","");
+}
+else if (Program.build.target.$name.match(/iar/)) {
+    throw new Error("IAR not supported by IPC");
+}
+else {
+    Build.customCCOpts = Build.customCCOpts.replace("-g","");
+    Build.customCCOpts = Build.customCCOpts.replace("--optimize_with_debug","");
+    Build.customCCOpts += "--symdebug:none ";
+    /* suppress warnings regarding .asmfunc and .endasmfunc */
+    Build.customCCOpts +=
+            "--asm_define\".asmfunc= \" --asm_define\".endasmfunc= \" ";
+}
+
 /* suppress un-placed sections warning from m3 Hwi.meta$init() */
 if (Program.sectMap[".vecs"] !== undefined) {
     Program.sectMap[".vecs"].type = "DSECT";
index 8bf2948bf2241180e180c9477166da92ac7a340f..3abd4c87f051b93d3ad7da01d621b53230248a84 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList = [
-      "NotifyDriverShm",
-      "NotifyDriverCirc",
-      "NotifySetupNull",
+    "NotifyDriverShm.c",
+    "NotifyDriverCirc.c",
+    "NotifySetupNull.c"
 ];
 
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList, undefined, null, arguments);
+    IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+}
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
-
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld"
+].concat(objList);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index d2da811da9f2a2739bf36e425ae9e575c41f0a3b..1c9c4f06203bf383dca4204e761fe81e07da6ce8 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList = [
-      "NameServerRemoteNotify",
-      "NameServerMessageQ",
+    "NameServerRemoteNotify.c",
+    "NameServerMessageQ.c"
 ];
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList, undefined, null, arguments);
+    IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld"
+].concat(objList);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index b72868568516eb2b22628d9165fab4f737e56b5e..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
+ *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 8ce61a6e8d4111d1f5135aa8bf0e5d27ea191e42..bc1a0380d63b0742daed2e1de5f7a8d65d170e19 100644 (file)
 /*
  *  ======== package.bld ========
  */
-
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+var Pkg = xdc.useModule('xdc.bld.PackageContents');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList = [
-      "Notify",
-      "GateMP",
-      "Ipc",
-      "MessageQ",
-      "SharedRegion",
-      "ListMP",
+    "Notify.c",
+    "GateMP.c",
+    "Ipc.c",
+    "MessageQ.c",
+    "SharedRegion.c",
+    "ListMP.c"
 ];
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList, undefined, null, arguments);
+    IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+}
 
 Pkg.otherFiles = [
     "package.bld",
@@ -62,38 +63,39 @@ Pkg.otherFiles = [
     "_Ipc.h",
     "Ipc.c",
     "makefile.xdt",
+    "debugMakefile.xdt",
     "makefile_gccArmLto.xdt",
     "instrumented.cfg.xs", "nonInstrumented.cfg.xs",
     "instrumented.cfg", "nonInstrumented.cfg",
-    "smpInstrumented.cfg", "smpNonInstrumented.cfg",
-];
+    "smpInstrumented.cfg", "smpNonInstrumented.cfg"
+].concat(objList);
 
 var testArray = [
     {   name: 'instrumented',
-        config: "instrumented",
-        libdir: "instrumented",
+        config: "instrumented.cfg",
+        libdir: "instrumented"
     },
     {   name: 'nonInstrumented',
-        config: "nonInstrumented",
-        libdir: "nonInstrumented",
-    },
+        config: "nonInstrumented.cfg",
+        libdir: "nonInstrumented"
+    }
 ];
 
 /* Build non-SMP pre-built libs */
-for each (var targ in Build.targets) {
+for (var t = 0; t < Build.targets.length; t++) {
+    var targ = Build.targets[t];
 
     /* For each test... */
     for each (var test in testArray) {
-
         var platform = test.platform ? test.platform : targ.platform;
 
         var cfg = Pkg.addConfiguration(test.name,
                                         targ, platform, {
                                         cfgScript: test.config,
                                         prelink: false,
-                                        profile: "release",
                                         exportCfg: false,
                                         exportSrc: false,
+                                        profile: "release"
                                      });
 
         var myLib = "lib/ipc/"
@@ -127,9 +129,9 @@ for each (var targ in Build.targets) {
                                         targ, platform, {
                                         cfgScript: test.config,
                                         prelink: false,
-                                        profile: "release",
                                         exportCfg: false,
                                         exportSrc: false,
+                                        profile: "release"
                                      });
 
         var myLib = "lib/smpipc/"
index b6c1493fa03ffe6d9cefea5f38d2ba77ac1dc54b..8dd787bd2f0181174496fe3eabeea401c416b9c0 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
- *
  */
 
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    /* Force the Build module to get used if any module
+     * in this package is used.
+     */
+    for (var mod in this.$modules) {
+        if (this.$modules[mod].$used == true) {
+            xdc.useModule('ti.sdo.ipc.Build');
+            break;
+        }
+    }
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var name = this.$name + ".a" + prog.build.target.suffix;
-    var lib = "";
-    var libdir = "";
-
-    var BIOS = xdc.module("ti.sysbios.BIOS");
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var lib;
+    var libPath;
+    var suffix;
 
-    if (BIOS.smpEnabled == true) {
-        libdir = "lib/smpipc/";
-    }
-    else {
-        libdir = "lib/ipc/";
-    }
+    var Build = xdc.module('ti.sdo.ipc.Build');
 
-    switch (BIOS.libType) {
-        case BIOS.LibType_Instrumented:
-        case BIOS.LibType_NonInstrumented:
-        case BIOS.LibType_Custom:
+    switch (Build.libType) {
+        case Build.LibType_Instrumented:
+        case Build.LibType_NonInstrumented:
+        case Build.LibType_Custom:
+        case Build.LibType_Debug:
             if (Build.$used == false) return (null);
             lib = Build.$private.outputDir + Build.$private.libraryName;
             return ("!" + String(java.io.File(lib).getCanonicalPath()));
-            break;
 
-        case BIOS.LibType_Debug:
-            lib = libdir + "debug/" + name;
-            if (java.io.File(this.packageBase + lib).exists()) {
-                return lib;
+        case Build.LibType_PkgLib:
+            /* lib path defined in Build.buildLibs() */
+            libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
+
+            /* find a compatible suffix */
+            if ("findSuffix" in prog.build.target) {
+                suffix = prog.build.target.findSuffix(this);
             }
-            break;
-    }
+            else {
+                suffix = prog.build.target.suffix;
+            }
+            return (libPath + "/" + this.$name + ".a" + suffix);
 
-    /* could not find any library, throw exception */
-    throw Error("Library not found: " + name);
+        default:
+            throw new Error("unknown Build.libType: " + Build.libType);
+    }
 }
 
 /*
@@ -86,24 +103,3 @@ function getSects()
 {
     return "ti/sdo/ipc/linkcmd.xdt";
 }
-
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-
-    /*
-     * Force the Build module to get used if any module
-     * in this package is used
-     */
-    for (var mod in this.$modules) {
-        if (this.$modules[mod].$used == true) {
-            xdc.useModule('ti.sdo.ipc.Build');
-            break;
-        }
-    }
-}
index 29c283af94566cfef81ed80492444f509236eda7..882553573caa7ffc14f8fb7f02594dde7411c27e 100644 (file)
  * 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');
 var IpcBuild = xdc.loadCapsule("ti/sdo/ipc/Build.xs");
 
 var objList = [
-      "TransportShm",
-      "TransportShmSetup",
-      "TransportShmCirc",
-      "TransportShmCircSetup",
-      "TransportShmNotify",
-      "TransportShmNotifySetup",
-      "TransportNullSetup",
+    "TransportShm.c",
+    "TransportShmSetup.c",
+    "TransportShmCirc.c",
+    "TransportShmCircSetup.c",
+    "TransportShmNotify.c",
+    "TransportShmNotifySetup.c",
+    "TransportNullSetup.c"
 ];
 
-/* generate makefiles */
-IpcBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    IpcBuild.buildLibs(objList, undefined, null, arguments);
+    IpcBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+}
 
-Pkg.otherFiles = [ "package.bld" ];
+Pkg.otherFiles = [
+    "package.bld"
+].concat(objList);
 
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
index 033e77e195363b01ca66b8f752692343727c28d7..e040c2a1f34a48593ab8cf12099936ff3d1757b1 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
  *
  */
 
+var Build = null;
+
+/*
+ *  ======== package.close ========
+ */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    Build = xdc.useModule('ti.sdo.ipc.Build');
+}
 
 /*
  *  ======== Package.getLibs ========
  *  being generated and it returns the name of a library appropriate
  *  for the program's configuration.
  */
-
 function getLibs(prog)
 {
-    var Build = xdc.module("ti.sdo.ipc.Build");
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+    var libPath;
+    var suffix;
 
-    /* use shared getLibs() */
-    return (Build.getLibs(this));
-}
+    if (Build.libType == Build.LibType_PkgLib) {
+        /* lib path defined in Build.buildLibs() */
+        libPath = (BIOS.smpEnabled ? "lib/smpipc/debug" : "lib/ipc/debug");
 
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
+        /* find a compatible suffix */
+        if ("findSuffix" in prog.build.target) {
+            suffix = prog.build.target.findSuffix(this);
+        }
+        else {
+            suffix = prog.build.target.suffix;
+        }
+        return (libPath + "/" + this.$name + ".a" + suffix);
+    }
+    else {
+        return (Build.getLibs(this));
     }
 }
index 86ea6cd07f903b43862a7f845dec3b481dc22644..56dbb2975a457a6c05e7946f25f30f9b88a9bb2c 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== Build.xdc ========
+ *  @_nodoc
  *  metaonly module to support building various package/product libraries
  *
  */
@@ -53,6 +55,11 @@ metaonly module Build
      */
     config String libDir = null;
 
+    /*!
+     *  ======== getDefaultCustomCCOpts ========
+     */
+    String getDefaultCustomCCOpts();
+
     /*!
      *  ======== getDefs ========
      *  Get the compiler -D options necessary to build
index ef7fb4d00fd50c28accd8c126feb3d1050fc19b0..55fa300cab9c10836a7d2f42666155cf8332c2e2 100644 (file)
@@ -39,24 +39,31 @@ var BIOS = xdc.module("ti.sysbios.BIOS");
 var Build = xdc.module("ti.sdo.utils.Build");
 var tplt = "";
 
-if ((BIOS.libType == BIOS.LibType_Custom) &&
-        (Build.$private.outputDir != undefined)) {
+if (((BIOS.libType == BIOS.LibType_Custom) ||
+    (BIOS.libType == BIOS.LibType_Debug)) &&
+    (Build.$private.outputDir != undefined)) {
 
     if (Build.doBuild) {
-        /* generate makefile from makefile.xdt
-         *    $args[0] = the RTSC target, so the makefile knows how to run the
-         *               compiler and archiver
+        /* generate makefile from template
+         * $args[0] = the RTSC target, so the makefile knows how to
+         *            run the compiler and archiver
          */
-        print("generating custom ti.sdo.utils library makefile ... ");
+        print("generating custom ti.sdo.utils library makefile ...");
 
         if (Program.build.target.$name.match(/gnu/) &&
-            (Program.build.target.name.match(/A15/) ||
+            (Program.build.target.name.match(/M3/) ||
+             Program.build.target.name.match(/M4/) ||
+             Program.build.target.name.match(/M4F/) ||
+             Program.build.target.name.match(/A15/) ||
              Program.build.target.name.match(/A9/)  ||
              Program.build.target.name.match(/A8/))) {
 
             tplt = xdc.loadTemplate(this.$package.packageBase +
                     "/makefile_gccArmLto.xdt");
         }
+        else if (Program.build.target.$name.match(/iar/)) {
+            throw new Error("IAR not supported by IPC");
+        }
         else {
             tplt = xdc.loadTemplate(this.$package.packageBase +
                     "/makefile.xdt");
@@ -75,3 +82,4 @@ if ((BIOS.libType == BIOS.LibType_Custom) &&
     tplt.genFile(Build.$private.outputDir + "/makefile", this,
             [Program.build.target]);
 }
+%%}
index 9b57a0ed3d43b1acfaff98ebe7c280df83239c3f..c05f66e01d3194e3f6c2b9a4d5f55b2d7bef306f 100644 (file)
 var BIOS = null;
 var Build = null;
 
+var custom28xOpts = " -q -mo ";
+var custom6xOpts = " -q -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 ";
+var customARP32xOpts = " -q --gen_func_subsections ";
+var customArmOpts = " -q -ms --opt_for_speed=2 ";
+var customGnuArmM3Opts = " ";
+var customGnuArmM4Opts = " ";
+var customGnuArmM4FOpts = " ";
+var customGnuArmA9Opts = " ";
+var customGnuArmA8Opts = " ";
+var customGnuArmA15Opts = " ";
+
+var ccOptsList = {
+    "ti.targets.C28_large"                      : custom28xOpts,
+    "ti.targets.C28_float"                      : custom28xOpts,
+    "ti.targets.C64P"                           : custom6xOpts,
+    "ti.targets.elf.C64P"                       : custom6xOpts,
+    "ti.targets.C64P_big_endian"                : custom6xOpts,
+    "ti.targets.elf.C64P_big_endian"            : custom6xOpts,
+    "ti.targets.C674"                           : custom6xOpts,
+    "ti.targets.elf.C674"                       : custom6xOpts,
+    "ti.targets.elf.C67P"                       : custom6xOpts,
+    "ti.targets.elf.C64T"                       : custom6xOpts,
+    "ti.targets.elf.C66"                        : custom6xOpts,
+    "ti.targets.elf.C66_big_endian"             : custom6xOpts,
+    "ti.targets.arp32.elf.ARP32"                : customARP32xOpts,
+    "ti.targets.arp32.elf.ARP32_far"            : customARP32xOpts,
+    "ti.targets.arm.elf.Arm9"                   : customArmOpts,
+    "ti.targets.arm.elf.A8F"                    : customArmOpts,
+    "ti.targets.arm.elf.A8Fnv"                  : customArmOpts,
+    "ti.targets.arm.elf.M3"                     : customArmOpts,
+    "ti.targets.arm.elf.M4"                     : customArmOpts,
+    "ti.targets.arm.elf.M4F"                    : customArmOpts,
+    "gnu.targets.arm.M3"                        : customGnuArmM3Opts,
+    "gnu.targets.arm.M4"                        : customGnuArmM4Opts,
+    "gnu.targets.arm.M4F"                       : customGnuArmM4FOpts,
+    "gnu.targets.arm.A8F"                       : customGnuArmA8Opts,
+    "gnu.targets.arm.A9F"                       : customGnuArmA9Opts,
+    "gnu.targets.arm.A15F"                      : customGnuArmA15Opts,
+};
+
+/*
+ *  ======== module$meta$init ========
+ */
+function module$meta$init()
+{
+    /* Only process during "cfg" phase */
+    if (xdc.om.$name != "cfg") {
+        return;
+    }
+
+    Build = this;
+
+    /*
+     * Set default verbose level for custom build flow
+     * User can override this in their cfg file.
+     */
+    var SourceDir = xdc.module("xdc.cfg.SourceDir");
+    SourceDir.verbose = 2;
+}
+
 /*
  *  ======== module$use ========
  */
@@ -45,10 +105,41 @@ function module$use()
     BIOS = xdc.module("ti.sysbios.BIOS");
     Build = this;
 
-    if (!Build.doBuild) {
-        return;
+//  if (!Build.doBuild) {
+//      return;
+//  }
+
+    /*
+     * Get the profile associated with the ti.sdo.ipc package.
+     * The profile can be specified on a per package basis with a line like
+     * this in your .cfg script:
+     *
+     * xdc.loadPackage('ti.sysbios').profile = "release";
+     */
+    if (this.$package.profile != undefined) {
+        profile = this.$package.profile;
+    }
+    else {
+        profile = Program.build.profile;
     }
 
+    /*
+     * Gracefully handle non-supported whole_program profiles
+     */
+    if (profile.match(/whole_program/)
+        && (BIOS.libType != BIOS.LibType_Debug)) {
+        /* allow build to proceed */
+        BIOS.libType = BIOS.LibType_Debug;
+        /* but warning the user */
+        BIOS.$logWarning("The '" + profile +
+            "' build profile will not be supported " +
+            "in future releases of SYS/BIOS.  " +
+            "Use 'release' or 'debug' profiles together with the " +
+            "'BIOS.libType' configuration parameter to specify your " +
+            "preferred library.  See the compatibility section of " +
+            "your SYS/BIOS release notes for more information.",
+            "Profile Deprecation Warning", BIOS);
+    }
     /* inform getLibs() about location of library */
     switch (BIOS.libType) {
         case BIOS.LibType_Instrumented:
@@ -63,6 +154,7 @@ function module$use()
                         + (BIOS.smpEnabled ? "smputils/nonInstrumented/" : "utils/nonInstrumented/");
             break;
 
+        case BIOS.LibType_Debug:
         case BIOS.LibType_Custom:
             this.$private.libraryName = "/utils.a" + Program.build.target.suffix;
             var SourceDir = xdc.useModule("xdc.cfg.SourceDir");
@@ -114,10 +206,10 @@ function module$use()
             break;
     }
 }
+
 /*
  * Add pre-built Instrumented and Non-Intrumented release libs
  */
-
 var utilsSources = "utils/MultiProc.c " +
                    "utils/List.c " +
                    "utils/NameServerRemoteNull.c " +
@@ -135,6 +227,76 @@ var cFiles = {
         { cSources: [] },
 }
 
+function getDefaultCustomCCOpts()
+{
+    var BIOS = xdc.module('ti.sysbios.BIOS');
+
+    /* start with target.cc.opts */
+    var customCCOpts = Program.build.target.cc.opts;
+
+    /* add target unique custom ccOpts */
+    if (!(ccOptsList[Program.build.target.$name] === undefined)) {
+        customCCOpts += ccOptsList[Program.build.target.$name];
+    }
+
+    /* Gnu targets need to pick up ccOpts.prefix and suffix */
+    if (Program.build.target.$name.match(/gnu/)) {
+        customCCOpts += " -O3 ";
+        customCCOpts += " " + Program.build.target.ccOpts.prefix + " ";
+        customCCOpts += " " + Program.build.target.ccOpts.suffix + " ";
+    }
+    else if (Program.build.target.$name.match(/iar/)) {
+        customCCOpts += " --mfc ";
+    }
+    else {
+        /* ti targets do program level compile */
+        customCCOpts += " --program_level_compile -o3 -g " +
+                "--optimize_with_debug ";
+    }
+
+    /* undo optimizations if this is a Debug build */
+    if (BIOS.libType == BIOS.LibType_Debug) {
+        if (Program.build.target.$name.match(/gnu/)) {
+            customCCOpts = customCCOpts.replace("-O3","");
+            /* add in stack frames for stack back trace */
+            customCCOpts += " -mapcs ";
+        }
+        else {
+            customCCOpts = customCCOpts.replace(" -o3","");
+            customCCOpts = customCCOpts.replace(" --optimize_with_debug","");
+            if (Program.build.target.$name.match(/arm/)) {
+                customCCOpts = customCCOpts.replace(" --opt_for_speed=2","");
+            }
+        }
+    }
+
+    return (customCCOpts);
+}
+
+/*
+ *  ======== getDefs ========
+ */
+function getDefs()
+{
+    var Defaults = xdc.module('xdc.runtime.Defaults');
+    var Diags = xdc.module("xdc.runtime.Diags");
+    var BIOS = xdc.module("ti.sysbios.BIOS");
+
+    var defs = "";
+
+    if ((BIOS.assertsEnabled == false) ||
+        ((Defaults.common$.diags_ASSERT == Diags.ALWAYS_OFF)
+            && (Defaults.common$.diags_INTERNAL == Diags.ALWAYS_OFF))) {
+        defs += " -Dxdc_runtime_Assert_DISABLE_ALL";
+    }
+
+    if (BIOS.logsEnabled == false) {
+        defs += " -Dxdc_runtime_Log_DISABLE_ALL";
+    }
+
+    return (defs);
+}
+
 /*
  *  ======== getCFiles ========
  */
@@ -197,30 +359,6 @@ function getAsmFiles(target)
     return (asmListNone);
 }
 
-/*
- *  ======== getDefs ========
- */
-function getDefs()
-{
-    var Defaults = xdc.module('xdc.runtime.Defaults');
-    var Diags = xdc.module("xdc.runtime.Diags");
-    var BIOS = xdc.module("ti.sysbios.BIOS");
-
-    var defs = "";
-
-    if ((BIOS.assertsEnabled == false) ||
-        ((Defaults.common$.diags_ASSERT == Diags.ALWAYS_OFF)
-            && (Defaults.common$.diags_INTERNAL == Diags.ALWAYS_OFF))) {
-        defs += " -Dxdc_runtime_Assert_DISABLE_ALL";
-    }
-
-    if (BIOS.logsEnabled == false) {
-        defs += " -Dxdc_runtime_Log_DISABLE_ALL";
-    }
-
-    return (defs);
-}
-
 /*
  *  ======== getLibs ========
  */
@@ -228,26 +366,17 @@ function getLibs(pkg)
 {
     var BIOS = xdc.module("ti.sysbios.BIOS");
 
-    if (BIOS.libType != BIOS.LibType_Debug) {
-        return null;
-    }
-
-    var lib = "";
-    var name = pkg.$name + ".a" + prog.build.target.suffix;
-
-    if (BIOS.smpEnabled == true) {
-        lib = "lib/smputils/debug/" + name;
-    }
-    else {
-        lib = "lib/utils/debug/" + name;
-    }
+    switch (BIOS.libType) {
+        case BIOS.LibType_Custom:
+        case BIOS.LibType_Instrumented:
+        case BIOS.LibType_NonInstrumented:
+        case BIOS.LibType_Debug:
+            return null;
 
-    if (java.io.File(pkg.packageBase + lib).exists()) {
-        return lib;
+        default:
+            throw new Error("BIOS.libType not supported: " + BIOS.libType);
+            break;
     }
-
-    /* could not find any library, throw exception */
-    throw Error("Library not found: " + name);
 }
 
 /*
@@ -280,12 +409,14 @@ function getProfiles(xdcArgs)
 /*
  *  ======== buildLibs ========
  *  This function generates the makefile goals for the libraries
- *  produced by a ti.sysbios package.
+ *  produced by a package.
  */
 function buildLibs(objList, relList, filter, xdcArgs)
 {
-    for (var i = 0; i < xdc.module('xdc.bld.BuildEnvironment').targets.length; i++) {
-        var targ = xdc.module('xdc.bld.BuildEnvironment').targets[i];
+    var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+
+    for (var i = 0; i < Build.targets.length; i++) {
+        var targ = Build.targets[i];
 
         /* skip target if not supported */
         if (!supportsTarget(targ, filter)) {
@@ -332,7 +463,6 @@ function buildLibs(objList, relList, filter, xdcArgs)
     }
 }
 
-
 /*
  *  ======== supportsTarget ========
  *  Returns true if target is in the filter object. If filter
diff --git a/packages/ti/sdo/utils/debugMakefile.xdt b/packages/ti/sdo/utils/debugMakefile.xdt
new file mode 100644 (file)
index 0000000..4fe2c1e
--- /dev/null
@@ -0,0 +1,173 @@
+%%{
+/*
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * *  Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * *  Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * *  Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+%%}
+%%{
+    var File = xdc.module("xdc.services.io.File");
+
+    var BIOS = xdc.module("ti.sysbios.BIOS");
+
+    var Build = xdc.module("ti.sysbios.Build");
+
+    var TARGET = $args[0];
+
+    var XOPTS = '-I "' + environment['xdc.rootDir'] + '/packages" '
+       + "-Dxdc_target_types__=" + TARGET.stdInclude
+       + " -Dxdc_target_name__=" + TARGET.name;
+
+    var CGEN = TARGET.rootDir.replace(/\\/g, "/");
+
+    function baseName(path) {
+       return path.substr(path.lastIndexOf('/') + 1).replace(/\.[^\.]+$/, "");
+    }
+
+    function packageName(path) {
+       var dirpath = path.substring(0, path.lastIndexOf('/'));
+       return dirpath.substr(dirpath.lastIndexOf('/') + 1);
+    }
+    var OBJS = [];
+%%}
+vpath % `File.getDOSPath(this.$package.packageRepository) + "ti/sysbios/"`
+vpath %.c `environment['xdc.rootDir'] + '/packages/'`
+
+CCOPTS    = `BIOS.getCCOpts(TARGET.name)`
+
+XDC_ROOT = `environment['xdc.rootDir'] + '/packages/'`
+
+BIOS_ROOT = `File.getDOSPath(this.$package.packageRepository) + "ti/sysbios/"`
+
+BIOS_DEFS = `BIOS.getDefs()`
+
+BIOS_INC  = -I"`File.getDOSPath(this.$package.packageRepository)`"
+
+%if (TARGET.$name.match(/gnu/)) {
+CC = `CGEN`/`TARGET.ccBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+ASM = `CGEN`/`TARGET.asmBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+AR = `CGEN`/`TARGET.arBin.cmd` `TARGET.ar.opts`
+%}
+%else {
+CC = `CGEN`/bin/`TARGET.cc.cmd` $(CCOPTS) -I `CGEN`/include
+ASM = `CGEN`/bin/`TARGET.asm.cmd` $(CCOPTS) -I `CGEN`/include
+AR = `CGEN`/bin/`TARGET.ar.cmd` `TARGET.ar.opts`
+%}
+
+%if (environment["os.name"].match(/Windows.*/i)) {
+DEL = cmd.exe /q /c del /f
+CP = cmd.exe /q /c copy /Y
+%}
+%else {
+DEL = rm -f
+CP = cp -f
+%}
+
+define RM
+       $(if $(wildcard $1),$(DEL) $1,:)
+endef
+
+define ASSEMBLE
+       @echo asm`TARGET.suffix` $< ...
+       @$(ASM) $(BIOS_DEFS) `XOPTS` $(BIOS_INC) $<
+endef
+
+define COMPILE
+       @echo cl`TARGET.suffix` $< ...
+       @$(CC) $(BIOS_DEFS) `XOPTS` $(BIOS_INC) $<
+endef
+
+%var LIB = "sysbios.lib";
+
+all: `LIB`
+
+%var sources = BIOS.getAsmFiles(TARGET.$name);
+%for each (var s in sources) {
+%if (TARGET.$name.match(/gnu/)) {
+%    var obj = packageName(s) + "_" + baseName(s) + ".o";
+%}
+%else {
+%    var obj = packageName(s) + "_" + baseName(s) + ".obj";
+%}
+%    OBJS.push(obj)
+`obj`: `s` makefile
+       @-$(call RM, $@)
+%if (TARGET.$name.match(/gnu/)) {
+       $(ASSEMBLE) -o `obj`
+%}
+%else {
+       $(ASSEMBLE) --output_file=`obj`
+%}
+
+%}
+
+%var sources = BIOS.getCFiles(TARGET.name).split(' ');
+%for each (var s in sources) {
+%if (TARGET.$name.match(/gnu/)) {
+%    var obj = packageName(s) + "_" + baseName(s) + ".o";
+%}
+%else {
+%    var obj = packageName(s) + "_" + baseName(s) + ".obj";
+%}
+%    OBJS.push(obj)
+`obj`: `s` makefile
+       @-$(call RM, `obj`)
+%if (TARGET.$name.match(/gnu/)) {
+       $(COMPILE) -o `obj`
+%}
+%else {
+       $(COMPILE) --output_file=`obj`
+%}
+%}
+
+`LIB`: `OBJS.join(" ")`
+       @echo ar`TARGET.suffix` $^ ...
+       @-$(call RM, $@)
+%if (BIOS.buildingAppLib == false) {
+       @-$(call RM, `Build.$private.libDir``LIB`)
+%}
+       @$(AR) $@ $^
+%if (BIOS.buildingAppLib == false) {
+       @$(CP) `LIB` `Build.$private.libDir`
+%}
+
+clean:
+       @-$(call RM, `LIB`)
+%if (BIOS.buildingAppLib == false) {
+       @-$(call RM, `Build.$private.libDir``LIB`)
+%}
+%if (TARGET.$name.match(/gnu/)) {
+       @-$(call RM, BIOS.o)
+%}
+%else {
+       @-$(call RM, BIOS.obj)
+%}
+%for (var i = 0; i < OBJS.length; i++) {
+       @-$(call RM, `OBJS[i]`)
+%}
index 6d8156791623aead993dc97ecea48b150bdb1f2a..e3fe07d11b80198d923ed3a04ba7fc470fa347ac 100644 (file)
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ *  ======== instrumented.cfg.xs ========
+ */
+
 var BIOS = xdc.module('ti.sysbios.BIOS');
 
 BIOS.libType = BIOS.LibType_Custom;
@@ -40,6 +44,18 @@ BIOS.logsEnabled = true;
 var SourceDir = xdc.module("xdc.cfg.SourceDir");
 SourceDir.verbose = 1;
 
+/* remove all symbolic debug info */
+if (Program.build.target.$name.match(/gnu/)) {
+    BIOS.customCCOpts = BIOS.customCCOpts.replace("-g","");
+}
+else if (!Program.build.target.$name.match(/iar/)) {
+    BIOS.customCCOpts = BIOS.customCCOpts.replace("-g","");
+    BIOS.customCCOpts = BIOS.customCCOpts.replace("--optimize_with_debug","");
+    BIOS.customCCOpts += "--symdebug:none ";
+    /* suppress warnings regarding .asmfunc and .endasmfunc */
+    BIOS.customCCOpts += "--asm_define\".asmfunc= \" --asm_define\".endasmfunc= \" ";
+}
+
 /* suppress un-placed sections warning from m3 Hwi.meta$init() */
 if (Program.sectMap[".vecs"] !== undefined) {
     Program.sectMap[".vecs"].type = "DSECT";
index f5dd6c8d6674f33bf64e2ae361f78e6abc84330f..104a84cc48e0e364ca8fda3b4f68a6e44b1b2754 100644 (file)
 %%{
     var File = xdc.module("xdc.services.io.File");
 
+    var BIOS = xdc.module("ti.sysbios.BIOS");
+
     var Build = xdc.module("ti.sdo.utils.Build");
 
     var TARGET = $args[0];
 
     var XDCROOT = String(environment['xdc.rootDir'] + '/packages/').replace(/\\/g, "/");
 
-    var BIOS = xdc.module("ti.sysbios.BIOS");
-
     var CGEN = TARGET.rootDir.replace(/\\/g, "/");
 
     function baseName(path) {
@@ -59,7 +59,7 @@ vpath %.c `XDCROOT`
 
 XOPTS = `'-I"' + XDCROOT + '"' + " -Dxdc_target_types__=" + File.getDOSPath(TARGET.$package.packageRepository) + TARGET.stdInclude + " -Dxdc_target_name__=" + TARGET.name`
 
-CCOPTS ?= `BIOS.getCCOpts(TARGET.$name)`
+CCOPTS = `BIOS.getCCOpts(TARGET.name)`
 
 XDC_ROOT  = `XDCROOT`
 
@@ -75,11 +75,16 @@ IPC_INC    = -I"`xdc.getPackageRepository("ti.sdo.ipc")`"
 
 UTILS_INC    = -I"`xdc.getPackageRepository("ti.sdo.utils")`"
 
+%if (TARGET.$name.match(/gnu/)) {
+CC = `CGEN`/`TARGET.ccBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+ASM = `CGEN`/`TARGET.asmBin.cmd` $(CCOPTS) -I `CGEN`/arm-none-eabi/include
+AR = `CGEN`/`TARGET.arBin.cmd` `TARGET.ar.opts`
+%}
+%else {
 CC = `CGEN`/bin/`TARGET.cc.cmd` $(CCOPTS) -I `CGEN`/include
-
 ASM = `CGEN`/bin/`TARGET.asm.cmd` $(CCOPTS) -I `CGEN`/include
-
 AR = `CGEN`/bin/`TARGET.ar.cmd` `TARGET.ar.opts`
+%}
 
 %if (environment["os.name"].match(/Windows.*/i)) {
 %if (BIOS.buildingAppLib == false) {
@@ -87,10 +92,12 @@ AR = `CGEN`/bin/`TARGET.ar.cmd` `TARGET.ar.opts`
 %}
 DEL = cmd.exe /q /c del /f
 CP = cmd.exe /q /c copy /Y
+MKDIR = mkdir
 %}
 %else {
 DEL = rm -f
 CP = cp -f
+MKDIR = mkdir -p
 %}
 
 define RM
@@ -113,16 +120,33 @@ all: `LIB`
 
 %var sources = Build.getAsmFiles(TARGET.$name);
 %for each (var s in sources) {
+%if (TARGET.$name.match(/gnu/)) {
+%    var obj = packageName(s) + "_" + baseName(s) + ".o";
+%}
+%else {
 %    var obj = packageName(s) + "_" + baseName(s) + ".obj";
+%}
 %    OBJS.push(obj)
 `obj`: `s` makefile
        @-$(call RM, $@)
+%if (TARGET.$name.match(/gnu/)) {
+       $(ASSEMBLE) -o `obj`
+%}
+%else {
        $(ASSEMBLE) --output_file=`obj`
+%}
 
 %}
 
+%if (TARGET.$name.match(/gnu/)) {
+Ipc.o: `Build.getCFiles(TARGET.$name)` makefile
+       @-$(call RM, Ipc.o)
+       @-$(call RM, Ipc.o.dep)
+%}
+%else {
 UTILS.obj: `Build.getCFiles(TARGET.$name)` makefile
        @-$(call RM, $@)
+%}
        @echo cl`TARGET.suffix` $< ...
        @$(CC) $(BUILD_DEFS) $(XOPTS) $(SYSBIOS_INC) $(BIOS_INC) \
        $(IPC_INC) $(UTILS_INC) \
@@ -130,14 +154,21 @@ UTILS.obj: `Build.getCFiles(TARGET.$name)` makefile
 %for each (var s in sources) {
 %    if (s.substring(0,4) == "xdc/") {
        $(XDC_ROOT)`s` \
+%    } else if (s.substring(0,2) == "./") {
+       `s` \
 %    } else {
        $(IPC_ROOT)`s` \
 %    }
 %}
 
+%if (TARGET.$name.match(/gnu/)) {
+`LIB`: UTILS.o `OBJS.join(" ")`
+%}
+%else {
 `LIB`: UTILS.obj `OBJS.join(" ")`
-       @echo ar`TARGET.suffix` $^ ...
+%}
        @-$(call RM, $@)
+       @echo ar`TARGET.suffix` $^ ...
        @$(AR) $@ $^
 
 %if (BIOS.buildingAppLib == false) {
@@ -152,7 +183,19 @@ clean:
 %if (BIOS.buildingAppLib == false) {
        @-$(call RM, "`Build.$private.libDir``LIB`")
 %}
+%if (TARGET.$name.match(/gnu/)) {
+       @-$(call RM, UTILS.o)
+%}
+%else {
        @-$(call RM, UTILS.obj)
+%}
 %for (var i = 0; i < OBJS.length; i++) {
        @-$(call RM, `OBJS[i]`)
 %}
+
+# create output directories
+ifneq ($(MAKECMDGOALS),clean)
+ifeq ($(wildcard `Build.$private.libDir`),)
+    $(shell $(MKDIR) `Build.$private.libDir`)
+endif
+endif
index 2e30ddd21357ac134124add2e787c6b2990d749f..9f03148c30c228591005a6703e4877a3a4d2a3fb 100644 (file)
@@ -104,7 +104,12 @@ endef
 
 %var LIB = "utils.a" + TARGET.suffix;
 
+%if (BIOS.buildingAppLib == false) {
+all: `Build.$private.libDir``LIB`
+%}
+%else {
 all: `LIB`
+%}
 
 %var sources = Build.getAsmFiles(TARGET.$name);
 %for each (var s in sources) {
@@ -129,9 +134,12 @@ all: `LIB`
        @echo ar`TARGET.suffix` $^ ...
        @-$(call RM, $@)
        @$(AR) $@ $^
+
 %if (BIOS.buildingAppLib == false) {
+`Build.$private.libDir``LIB`: `LIB`
+       @echo cp `LIB`
        @-$(call RM, "`Build.$private.libDir``LIB`")
-       $(CP) `LIB` "`Build.$private.libDir``LIB`"
+       @$(CP) `LIB` "`Build.$private.libDir``LIB`"
 %}
 
 clean:
index bb326e216bc77e4fc648e0bf0d8a5703a2214f8a..40c125d3ce4ed54520accab3eecc3078a3174bb9 100644 (file)
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ *  ======== nonInstrumented.cfg.xs ========
+ */
+
 var BIOS = xdc.module('ti.sysbios.BIOS');
 
 BIOS.libType = BIOS.LibType_Custom;
@@ -40,6 +44,18 @@ BIOS.logsEnabled = false;
 var SourceDir = xdc.module("xdc.cfg.SourceDir");
 SourceDir.verbose = 1;
 
+/* remove all symbolic debug info */
+if (Program.build.target.$name.match(/gnu/)) {
+    BIOS.customCCOpts = BIOS.customCCOpts.replace("-g","");
+}
+else if (!Program.build.target.$name.match(/iar/)) {
+    BIOS.customCCOpts = BIOS.customCCOpts.replace("-g","");
+    BIOS.customCCOpts = BIOS.customCCOpts.replace("--optimize_with_debug","");
+    BIOS.customCCOpts += "--symdebug:none ";
+    /* suppress warnings regarding .asmfunc and .endasmfunc */
+    BIOS.customCCOpts += "--asm_define\".asmfunc= \" --asm_define\".endasmfunc= \" ";
+}
+
 /* suppress un-placed sections warning from m3 Hwi.meta$init() */
 if (Program.sectMap[".vecs"] !== undefined) {
     Program.sectMap[".vecs"].type = "DSECT";
index 333dcfb9b459abdf173fd6e7a28606a9b6559056..17bb145f37c3e7009080d967c8dac9c7922e4703 100644 (file)
 /*
  *  ======== package.bld ========
  */
-
+var Build = xdc.useModule('xdc.bld.BuildEnvironment');
+var Pkg = xdc.useModule('xdc.bld.PackageContents');
 var UtilsBuild = xdc.loadCapsule("ti/sdo/utils/Build.xs");
 
 var objList = [
-    "NameServer",
-    "NameServerRemoteNull",
-    "List",
-    "MultiProc",
+    "NameServer.c",
+    "NameServerRemoteNull.c",
+    "List.c",
+    "MultiProc.c"
 ];
 
-
-/* generate makefiles */
-UtilsBuild.buildLibs(objList, undefined, null, arguments);
-
-/* generate smp makefiles */
-UtilsBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+/* if not building a product release, build package libraries */
+if (Bld_goal != "release") {
+    UtilsBuild.buildLibs(objList, undefined, null, arguments);
+    UtilsBuild.buildLibs(objList, undefined, null, ["profile=smp"]);
+}
 
 Pkg.otherFiles = [
     "package.bld",
@@ -56,38 +56,39 @@ Pkg.otherFiles = [
     "_NameServer.h",
     "UTILS.c",
     "makefile.xdt",
+    "debugMakefile.xdt",
     "makefile_gccArmLto.xdt",
     "instrumented.cfg.xs", "nonInstrumented.cfg.xs",
     "instrumented.cfg", "nonInstrumented.cfg",
-    "smpInstrumented.cfg", "smpNonInstrumented.cfg",
-];
+    "smpInstrumented.cfg", "smpNonInstrumented.cfg"
+].concat(objList);
 
 var testArray = [
     {   name: 'instrumented',
-        config: "instrumented",
-        libdir: "instrumented",
+        config: "instrumented.cfg",
+        libdir: "instrumented"
     },
     {   name: 'nonInstrumented',
-        config: "nonInstrumented",
-        libdir: "nonInstrumented",
-    },
+        config: "nonInstrumented.cfg",
+        libdir: "nonInstrumented"
+    }
 ];
 
 /* Build non-SMP pre-built libs */
-for each (var targ in Build.targets) {
+for (var t = 0; t < Build.targets.length; t++) {
+    var targ = Build.targets[t];
 
     /* For each test... */
     for each (var test in testArray) {
-
         var platform = test.platform ? test.platform : targ.platform;
 
         var cfg = Pkg.addConfiguration(test.name,
                                         targ, platform, {
                                         cfgScript: test.config,
                                         prelink: false,
-                                        profile: "release",
                                         exportCfg: false,
                                         exportSrc: false,
+                                        profile: "release"
                                      });
 
         var myLib = "lib/utils/"
@@ -121,9 +122,9 @@ for each (var targ in Build.targets) {
                                         targ, platform, {
                                         cfgScript: test.config,
                                         prelink: false,
-                                        profile: "release",
                                         exportCfg: false,
                                         exportSrc: false,
+                                        profile: "release"
                                      });
 
         var myLib = "lib/smputils/"
@@ -133,7 +134,6 @@ for each (var targ in Build.targets) {
     }
 }
 
-
 /* include source files in the release package */
 Pkg.attrs.exportSrc = true;
 Pkg.attrs.exportCfg = true;
index 902956a1cbeaabf8903ae020a4391ab58718b021..39e42b74c3666cac5b02afdc13ebd39b2086e64b 100644 (file)
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /*
  *  ======== package.xs ========
+ *
+ */
+
+/*
+ *  ======== package.close ========
  */
+function close()
+{
+    if (xdc.om.$name != 'cfg') {
+        return;
+    }
+
+    /* Force the Build module to get used if any module
+     * in this package is used.
+     */
+    for (var mod in this.$modules) {
+        if (this.$modules[mod].$used == true) {
+            xdc.useModule('ti.sdo.utils.Build');
+            break;
+        }
+    }
+}
 
 /*
  *  ======== Package.getLibs ========
@@ -53,6 +75,7 @@ function getLibs(prog)
 
     var name = this.$name + ".a" + suffix;
     var lib = "";
+    var libdir = "";
 
     var BIOS = xdc.module("ti.sysbios.BIOS");
     var Build = xdc.module("ti.sdo.utils.Build");
@@ -68,44 +91,21 @@ function getLibs(prog)
         case BIOS.LibType_Instrumented:
         case BIOS.LibType_NonInstrumented:
         case BIOS.LibType_Custom:
-            if (Build.$used && Build.doBuild) {
+        case BIOS.LibType_Debug:
+//          if (Build.$used && Build.doBuild) {
+            if (Build.$used) {
                 lib = Build.$private.outputDir + Build.$private.libraryName;
                 return ("!" + String(java.io.File(lib).getCanonicalPath()));
             }
-            else {
-                return null;
-            }
+//          else {
+//              return null;
+//          }
             break;
 
-        case BIOS.LibType_Debug:
-            lib = libdir + "debug/" + name;
-            if (java.io.File(this.packageBase + lib).exists()) {
-                return lib;
-            }
-            break;
+        default:
+            throw new Error("unknown BIOS.libType: " + BIOS.libType);
     }
 
     /* could not find any library, throw exception */
     throw Error("Library not found: " + name);
 }
-
-/*
- *  ======== package.close ========
- */
-function close()
-{
-    if (xdc.om.$name != 'cfg') {
-        return;
-    }
-
-    /*
-     * Force the Build module to get used if any module
-     * in this package is used
-     */
-    for (var mod in this.$modules) {
-        if (this.$modules[mod].$used == true) {
-            xdc.useModule('ti.sdo.utils.Build');
-            break;
-        }
-    }
-}