1 /******************************************************************************
2 * FILE PURPOSE: Build description for the i2c Driver
3 ******************************************************************************
4 * FILE NAME: package.bld
5 *
6 * DESCRIPTION:
7 * This file contains the build specification and description for the i2c 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-2018, Texas Instruments, Inc.
19 *****************************************************************************/
21 /* List of all subdirectories that combine to make the i2c Socket Driver Package. */
22 var subDirectories = [ "src", "docs", "soc", "test", "example", "firmware" ];
24 var driverInstallType;
26 /* Determine if we need to create the InstallJammer Application or not?
27 * i2c 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 * i2c_<version> */
41 var i2cRTSCFileName = "i2c" + "_" +
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 ("************* i2c Socket Driver Build Information *************");
52 print ("i2c Socket Driver Install : " + driverInstallType);
53 print ("i2c Socket Driver LLD Version : " + driverReleaseVersion);
54 print ("RTSC File Name : " + i2cRTSCFileName);
55 print ("i2c Socket Driver LLD Path : " + driverPath);
56 print ("C66 Tools Directory : " + c66ToolsBaseDir);
57 print ("M4 Tools Directory : " + m4ToolsBaseDir);
58 print ("A15 Tools Directory : " + a15ToolsBaseDir);
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 i2c LLD */
69 Pkg.defaultRelease = Pkg.addRelease (i2cRTSCFileName, {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++] = "I2C.h";
105 Pkg.otherFiles[Pkg.otherFiles.length++] = "I2Cver.h";
106 Pkg.otherFiles[Pkg.otherFiles.length++] = "I2Cver.h.xdt";
107 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
108 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
109 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
110 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
111 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile.mk";
112 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_indp.mk";
113 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_profile_indp.mk";
114 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_profile.mk";
115 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/makefile_icss_i2c.mk";
116 Pkg.otherFiles[Pkg.otherFiles.length++] = "src/src_files_common.mk";
117 Pkg.otherFiles[Pkg.otherFiles.length++] = "i2c_component.mk";
118 Pkg.otherFiles[Pkg.otherFiles.length++] = "./lib";
120 /* Generate Users Manual Doxyfile */
121 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
122 tplt.genFile("./docs/Doxyfile",driverReleaseVersion);
123 }
125 /* Generate Settings.xdc */
126 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
127 tplt.genFile("./Settings.xdc",driverReleaseVersion);
129 /* Generate paver.h */
130 var tplt = xdc.loadTemplate("./I2Cver.h.xdt");
131 tplt.genFile("./I2Cver.h",driverReleaseVersion);