summaryrefslogblamecommitdiffstats
blob: e6d3cfe50ea2623003cd60806cf7930b35023505 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                   
                                                    


                                                                                      
                                                              

















                                                                                 
                                       










                                                                                                
                                                                 





                                                                 








                                                                        





























                                                                                                 
                                                           
                                                         

                                                         


                                                              
                                                        
                                                      
                                                    
                                                    
                                                    





                                                               





                                                                           
                                                               
                                                   












                                                            
     
/******************************************************************************
 * FILE PURPOSE: Build description for the osal Driver
 ******************************************************************************
 * FILE NAME: package.bld
 *
 * DESCRIPTION: 
 *  This file contains the build specification and description for the osal driver
 *  
 *  The file takes the following parameters from the command line through the
 *  XDCARGS variable.
 *      XDCARGS[0] = osal Driver Install Type 
 *      Valid Values are "TAR" or "SETUP"
 *      DEFAULT is "SETUP"
 *
 *  Example for a valid command:
 *      xdc XDCARGS="SETUP" release   
 *
 * Copyright (C) 2014-2019, Texas Instruments, Inc.
 *****************************************************************************/

/* List of all subdirectories that combine to make the osal Socket Driver Package. */
var subDirectories = [ "src", "docs", "arch", "soc", "test"];

var osalDriverInstallType;

/* Determine if we need to create the InstallJammer Application or not? 
 * osal LLD Deliverables be either of the following formats:
 *  - TAR Ball Package
 *  - Setup Executable 
 * DEFAULT is a SETUP Executable. */

if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
    osalDriverInstallType = "TAR";
else
    osalDriverInstallType = arguments[0];

/* Irrespective of the InstallType we always create a TAR Ball Package as a part
 * of the RTSC Build. Here we determine the name of the TAR Ball Package
 *  Format is as follows:
 *      osal_<version> */
var osalRTSCFileName = "osal" + "_" + 
                      osalDriverReleaseVersion[0] + "_" +  osalDriverReleaseVersion[1] + "_" + 
                      osalDriverReleaseVersion[2]  + "_" + osalDriverReleaseVersion[3];

/******************************************************************
 ************************ Release Banner **************************
 ******************************************************************/

print ("************* osal Socket Driver Build Information *************");
print ("osal Socket Driver Install      : " + osalDriverInstallType);
print ("osal Socket Driver LLD Version  : " + osalDriverReleaseVersion);
print ("C66 Tools Directory             : " + c66ToolsBaseDir);
print ("C67 Tools Directory             : " + c674ToolsBaseDir);
print ("M4  Tools Directory             : " + m4ToolsBaseDir);
print ("A15 Tools Directory             : " + a15ToolsBaseDir);
print ("A9 Tools Directory              : " + a9ToolsBaseDir);
print ("A8 Tools Directory              : " + a8ToolsBaseDir);
print ("RTSC File Name	                : " + osalRTSCFileName);
print ("osal Socket Driver LLD Path     : " + osalDriverPath);
if (pOpts == 1) 
{
    print ("CC LE opts                      : " + C66LE.ccOpts.prefix);
    print ("CC BE opts                      : " + C66BE.ccOpts.prefix);
    print ("M4 LE opts                      : " + M4LE.ccOpts.prefix);
    print ("A15 basic opts                  : " + A15LE.ccOpts.prefix);
    print ("A9 basic opts                   : " + A9LE.ccOpts.prefix);
    print ("A8 basic opts                   : " + A8LE.ccOpts.prefix);
}
print ("****************************************************************");

/* Create the release package for the osal LLD */
Pkg.defaultRelease = Pkg.addRelease (osalRTSCFileName, {prefix: "./packages/"});

/* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
 * not supported in the XDC tools being used. Currenly builds need to be done with the 
 * following options:-
 *   xdc MK_FIXLISTOPTS=-t release 
 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
//Pkg.attrs = {archiver : "zip"};

/* Cycle through all the sub-directories and build all the files */
for (var i = 0; i < subDirectories.length; i++) 
{
    /* Load the capsule in the sub directory. */
    var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");

    print ("Building directory " + subDirectories[i]);

    /* Build the capsule. */
    caps.modBuild();

    /* Package the module.xs files for building via package */
    Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
}

/* Package the remaining files */
Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
Pkg.otherFiles[Pkg.otherFiles.length++] = "config_mk.bld";
Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
Pkg.otherFiles[Pkg.otherFiles.length++] = "SemaphoreP.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "MuxIntcP.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "CacheP.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "HwiP.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "SwiP.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "osal.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "osalver.h";
Pkg.otherFiles[Pkg.otherFiles.length++] = "osalver.h.xdt";
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_nonos_indp.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_nonos.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_tirtos_indp.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_tirtos.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "src/src_common_nonos.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "src/src_common_tirtos.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "osal_component.mk";
Pkg.otherFiles[Pkg.otherFiles.length++] = "./lib";

/* Generate Users Manual Doxyfile */
var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
tplt.genFile("./docs/Doxyfile",osalDriverReleaseVersion); 

/* Generate Settings.xdc */
var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
tplt.genFile("./Settings.xdc",osalDriverReleaseVersion); 

/* Generate paver.h */
var tplt = xdc.loadTemplate("./osalver.h.xdt");
tplt.genFile("./osalver.h",osalDriverReleaseVersion);