1 /******************************************************************************
2 * FILE PURPOSE: Build description for the MCBSP Driver
3 ******************************************************************************
4 * FILE NAME: package.bld
5 *
6 * DESCRIPTION:
7 * This file contains the build specification and description for the MCBSP driver
8 *
9 * The file takes the following parameters from the command line through the
10 * XDCARGS variable.
11 * XDCARGS[0] = MCBSP Driver Install Type
12 * Valid Values are "TAR" or "SETUP"
13 * DEFAULT is "SETUP"
14 *
15 * Example for a valid command:
16 * xdc XDCARGS="SETUP" release
17 *
18 * Copyright (C) 2012, Texas Instruments, Inc.
19 *****************************************************************************/
21 /* List of all subdirectories that combine to make the MCBSP Driver Package. */
22 var subDirectories = [ "src", "docs", "include","device","example" ];
24 var mcbspDriverInstallType;
26 /* Determine if we need to create the InstallJammer Application or not?
27 * MCBSP LLD Deliverables be either of the following formats:
28 * - TAR Ball Package
29 * - Setup Executable
30 * DEFAULT is a SETUP Executable. */
32 if ((arguments[0] != "TAR") && (arguments[0] != "SETUP"))
33 mcbspDriverInstallType = "TAR";
34 else
35 mcbspDriverInstallType = arguments[0];
37 /* Irrespective of the InstallType we always create a TAR Ball Package as a part
38 * of the RTSC Build. Here we determine the name of the TAR Ball Package
39 * Format is as follows:
40 * mcbsp_<version> */
41 var mcbspRTSCFileName = "mcbsp" + "_" + mcbspLLDPartNumber + "_" +
42 mcbspDriverReleaseVersion[0] + "_" + mcbspDriverReleaseVersion[1] + "_" +
43 mcbspDriverReleaseVersion[2] + "_" + mcbspDriverReleaseVersion[3];
45 /******************************************************************
46 ************************ Release Banner **************************
47 ******************************************************************/
49 print ("************* MCBSP Driver Build Information *************");
50 print ("MCBSP Driver Install : " + mcbspDriverInstallType);
51 print ("MCBSP Driver LLD Version : " + mcbspDriverReleaseVersion);
52 print ("Tools Directory : " + toolsBaseDir);
53 print ("RTSC File Name : " + mcbspRTSCFileName);
54 print ("MCBSP Driver LLD Path : " + mcbspDriverPath);
55 print ("CC LE opts : " + C66LE.ccOpts.prefix);
56 print ("CC BE opts : " + C66BE.ccOpts.prefix);
57 print ("****************************************************************");
59 /* Create the release package for the MCBSP LLD */
60 Pkg.defaultRelease = Pkg.addRelease (mcbspRTSCFileName, {prefix: "./packages/"});
62 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
63 * not supported in the XDC tools being used. Currenly builds need to be done with the
64 * following options:-
65 * xdc MK_FIXLISTOPTS=-t release
66 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
67 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
68 //Pkg.attrs = {archiver : "zip"};
70 /* Cycle through all the sub-directories and build all the files */
71 for (var i = 0; i < subDirectories.length; i++)
72 {
73 /* Load the capsule in the sub directory. */
74 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
76 print ("Building directory " + subDirectories[i]);
78 /* Build the capsule. */
79 caps.modBuild();
81 /* Package the module.xs files for building via package */
82 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
83 }
85 /* Package the remaining files */
86 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
87 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
88 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
89 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
90 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
91 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
92 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_drv.h";
93 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_osal.h";
94 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_types.h";
95 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbspver.h";
96 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbspver.h.xdt";
97 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
98 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
102 /* Generate Users Manual Doxyfile */
103 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
104 tplt.genFile("./docs/Doxyfile",mcbspDriverReleaseVersion);
106 /* Generate Settings.xdc */
107 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
108 tplt.genFile("./Settings.xdc",mcbspDriverReleaseVersion);
110 /* Generate paver.h */
111 var tplt = xdc.loadTemplate("./mcbspver.h.xdt");
112 tplt.genFile("./mcbspver.h",mcbspDriverReleaseVersion);