1 /******************************************************************************
2 * FILE PURPOSE: Build description for the spi Driver
3 ******************************************************************************
4 * FILE NAME: package.bld
5 *
6 * DESCRIPTION:
7 * This file contains the build specification and description for the spi driver
8 *
9 * The file takes the following parameters from the command line through the
10 * XDCARGS variable.
11 * XDCARGS[0] = 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) 2014-2015, Texas Instruments, Inc.
19 *****************************************************************************/
21 /* List of all subdirectories that combine to make the spi Socket Driver Package. */
22 var subDirectories = [ "src", "docs", "test", "example", "soc", "firmware" ];
24 var driverInstallType;
26 /* Determine if we need to create the InstallJammer Application or not?
27 * spi 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 driverInstallType = "TAR";
34 else
35 driverInstallType = 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 * spi_<version> */
41 var spiRTSCFileName = "spi" + "_" +
42 driverReleaseVersion[0] + "_" + driverReleaseVersion[1] + "_" +
43 driverReleaseVersion[2] + "_" + driverReleaseVersion[3];
45 var package_type = java.lang.System.getenv("PDK_PACKAGE_TYPE");
47 /******************************************************************
48 ************************ Release Banner **************************
49 ******************************************************************/
51 print ("************* spi Socket Driver Build Information *************");
52 print ("spi Socket Driver Install : " + driverInstallType);
53 print ("spi Socket Driver LLD Version : " + driverReleaseVersion);
54 print ("C66 Tools Directory : " + c66ToolsBaseDir);
55 print ("M4 Tools Directory : " + m4ToolsBaseDir);
56 print ("A15 Tools Directory : " + a15ToolsBaseDir);
57 print ("RTSC File Name : " + spiRTSCFileName);
58 print ("spi Socket Driver LLD Path : " + driverPath);
59 if (pOpts == 1)
60 {
61 print ("CC LE opts : " + C66LE.ccOpts.prefix);
62 print ("CC BE opts : " + C66BE.ccOpts.prefix);
63 print ("M4 LE opts : " + M4LE.ccOpts.prefix);
64 print ("A15 basic opts : " + A15LE.ccOpts.prefix);
65 }
66 print ("****************************************************************");
68 /* Create the release package for the spi LLD */
69 Pkg.defaultRelease = Pkg.addRelease (spiRTSCFileName, {prefix: "./packages/"});
71 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
72 * not supported in the XDC tools being used. Currenly builds need to be done with the
73 * following options:-
74 * xdc MK_FIXLISTOPTS=-t release
75 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
76 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
77 //Pkg.attrs = {archiver : "zip"};
79 if (package_type != "package_type_makefile")
80 {
81 /* Cycle through all the sub-directories and build all the files */
82 for (var i = 0; i < subDirectories.length; i++)
83 {
84 /* Load the capsule in the sub directory. */
85 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
87 print ("Building directory " + subDirectories[i]);
89 /* Build the capsule. */
90 caps.modBuild();
92 /* Package the module.xs files for building via package */
93 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
94 }
96 /* Package the remaining files */
97 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
98 Pkg.otherFiles[Pkg.otherFiles.length++] = "config_mk.bld";
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
101 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
102 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
103 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
104 Pkg.otherFiles[Pkg.otherFiles.length++] = "SPI.h";
105 Pkg.otherFiles[Pkg.otherFiles.length++] = "MCSPI.h";
106 Pkg.otherFiles[Pkg.otherFiles.length++] = "SPIver.h";
107 Pkg.otherFiles[Pkg.otherFiles.length++] = "SPIver.h.xdt";
108 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
109 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
110 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
111 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
112 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile.mk";
113 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_dma.mk";
114 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_profile.mk";
115 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_icss_espi.mk";
116 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_dma_profile.mk";
117 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_indp.mk";
118 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_profile_indp.mk";
119 Pkg.otherFiles[Pkg.otherFiles.length++] = "src/src_files_common.mk";
120 Pkg.otherFiles[Pkg.otherFiles.length++] = "spi_component.mk";
121 Pkg.otherFiles[Pkg.otherFiles.length++] = "./lib";
123 /* Generate Users Manual Doxyfile */
124 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
125 tplt.genFile("./docs/Doxyfile",driverReleaseVersion);
126 }
128 /* Generate Settings.xdc */
129 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
130 tplt.genFile("./Settings.xdc",driverReleaseVersion);
132 /* Generate paver.h */
133 var tplt = xdc.loadTemplate("./SPIver.h.xdt");
134 tplt.genFile("./SPIver.h",driverReleaseVersion);