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", "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 ("Coverity Analysis : " + (coverityAnalysis == "ON" ? "ON" : "OFF"));
56 print ("CC LE opts : " + C66LE.ccOpts.prefix);
57 print ("CC BE opts : " + C66BE.ccOpts.prefix);
58 print ("****************************************************************");
60 /* Create the release package for the MCBSP LLD */
61 Pkg.defaultRelease = Pkg.addRelease (mcbspRTSCFileName, {prefix: "./packages/"});
63 /* Moving forward we need to set the Archiver of the package to be ZIP. This is currently
64 * not supported in the XDC tools being used. Currenly builds need to be done with the
65 * following options:-
66 * xdc MK_FIXLISTOPTS=-t release
67 * ZIP is a better option as it works natively with INSTALL Jammer and we can remove the
68 * uncompression into a temporary directory. XDC Tools with xdc-rXX support the ZIP archiver. */
69 //Pkg.attrs = {archiver : "zip"};
71 /* Cycle through all the sub-directories and build all the files */
72 for (var i = 0; i < subDirectories.length; i++)
73 {
74 /* Load the capsule in the sub directory. */
75 var caps = xdc.loadCapsule (subDirectories[i]+"/Module.xs");
77 print ("Building directory " + subDirectories[i]);
79 /* Build the capsule. */
80 caps.modBuild();
82 /* Package the module.xs files for building via package */
83 Pkg.otherFiles[Pkg.otherFiles.length++] = subDirectories[i]+"/Module.xs";
84 }
86 /* Package the remaining files */
87 Pkg.otherFiles[Pkg.otherFiles.length++] = "config.bld";
88 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.bld";
89 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xdc";
90 Pkg.otherFiles[Pkg.otherFiles.length++] = "package.xs";
91 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc";
92 Pkg.otherFiles[Pkg.otherFiles.length++] = "Settings.xdc.xdt";
93 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_drv.h";
94 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_osal.h";
95 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbsp_types.h";
96 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbspver.h";
97 Pkg.otherFiles[Pkg.otherFiles.length++] = "mcbspver.h.xdt";
98 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/Doxyfile";
99 Pkg.otherFiles[Pkg.otherFiles.length++] = "docs/doxyfile.xdt";
100 Pkg.otherFiles[Pkg.otherFiles.length++] = "build/buildlib.xs";
101 Pkg.otherFiles[Pkg.otherFiles.length++] = "makefile";
103 /* Generate Users Manual Doxyfile */
104 var tplt = xdc.loadTemplate("./docs/doxyfile.xdt");
105 tplt.genFile("./docs/Doxyfile",mcbspDriverReleaseVersion);
107 /* Generate Settings.xdc */
108 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");
109 tplt.genFile("./Settings.xdc",mcbspDriverReleaseVersion);
111 /* Generate paver.h */
112 var tplt = xdc.loadTemplate("./mcbspver.h.xdt");
113 tplt.genFile("./mcbspver.h",mcbspDriverReleaseVersion);
115 /*********************************************************************
116 *********************** INSTALL-JAMMER Support **********************
117 * In order to create the InstallJammer Application; we need to UNTAR
118 * the package into a temporary directory. This is required because
119 * currently the InstallJammer does not support the TAR Files and thus
120 * creating an UNTAR of the file. So to work-around the problem we will
121 * do the following in the EPILOGUE Section:-
122 * (a) Create a temporary directory called 'tmp'
123 * (b) UNTAR the package into 'tmp'
124 * (c) Run the INSTALL Jammer on 'tmp'
125 * (d) Remove the 'tmp' directory.
126 *
127 * This can be done only after the 'release' package has been created.
128 * Thus all of this work is being done in the EPILOGUE.
129 *********************************************************************/
130 if (mcbspDriverInstallType == "SETUP")
131 {
132 /* Create the Install Jammer Version Variable. This is used inside the
133 * MPI File to create the Final executable.
134 * The format supported is as follows:-
135 * - setupwin32_mcbsp_<device>_<version>.exe
136 */
137 var InstallJammerVersion = "-DVersion " + mcbspLLDPartNumber + "_" +
138 mcbspDriverReleaseVersion[0] + "_" + mcbspDriverReleaseVersion[1] + "_" +
139 mcbspDriverReleaseVersion[2] + "_" + mcbspDriverReleaseVersion[3];
141 /* This is the location where the tmp directory is located; this is used as
142 * the input directory for the Install Jammer. */
143 var PackageBaseDir = " -DPackageBaseDir " + mcbspDriverPath + "./tmp";
145 /* This is the location where the MCBSP LLD will be installed by default. */
146 var WinInstallDir = " -DWinInstallDir C:/Program Files/Texas Instruments/mcbsp" + "_" +
147 mcbspLLDPartNumber + "_" +
148 mcbspDriverReleaseVersion[0] + "_" + mcbspDriverReleaseVersion[1] + "_" +
149 mcbspDriverReleaseVersion[2] + "_" + mcbspDriverReleaseVersion[3];
151 /* Create the actual EPILOGUE Section for the INSTALLER */
152 Pkg.makeEpilogue += "release: install_application\n";
153 Pkg.makeEpilogue += "install_application:\n";
154 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";
155 Pkg.makeEpilogue += "\t @echo Creating the Install\n";
156 Pkg.makeEpilogue += "\t @echo -------------------------------------------------------\n";
157 Pkg.makeEpilogue += "\t -$(MKDIR) tmp\n";
158 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/packages\n";
159 Pkg.makeEpilogue += "\t -$(MKDIR) tmp/eclipse\n";
160 Pkg.makeEpilogue += "\t -$(CP) -R eclipse tmp\n";
161 Pkg.makeEpilogue += "\t tar -xf ./packages/" + mcbspRTSCFileName + ".tar" + " -Ctmp/packages \n";
162 Pkg.makeEpilogue += "\t installjammer " + InstallJammerVersion + PackageBaseDir + WinInstallDir +
163 " --output-dir packages/ --build install/mcbsplld.mpi\n";
164 Pkg.makeEpilogue += "\t -$(RMDIR) /S /Q tmp\n\n";
166 /* We need to clean after ourselves; extend the 'clean' target to take care of this. */
167 Pkg.makeEpilogue += "clean::\n";
168 Pkg.makeEpilogue += "\t $(RM) packages/*.exe\n";
169 Pkg.makeEpilogue += "\t $(RM) packages/*.bin\n";
170 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q eclipse\n";
171 Pkg.makeEpilogue += "\t $(RMDIR) /S /Q tmp\n";
172 }
174 /***************************************************************************
175 ********************************* MINI Package ****************************
176 ***************************************************************************/
177 /* Check if we need to create the mini package? */
178 if (miniBuild == "ON")
179 {
180 /* Create the MINI RTSC Package */
181 var libUtility = xdc.loadCapsule ("build/buildlib.xs");
182 libUtility.createMiniPkg(mcbspRTSCFileName);
183 }